Projet

Général

Profil

Development #41820

isdigit vs unicode

Ajouté par Frédéric Péters il y a presque 4 ans. Mis à jour il y a presque 4 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Début:
17 avril 2020
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

On utilise parfois isdigit(),

passerelle/apps/astregs/models.py:            mobile = ''.join((n for n in r.TelephoneMobile if n.isdigit()))

mais isdigit() c'est vrai pour ①②③④ et autres.


Fichiers

Révisions associées

Révision c3a51403 (diff)
Ajouté par Benjamin Dauvergne il y a presque 4 ans

misc: replace v.isdigit() by is_number(v) (#41820)

isdigit() does not accept only ASCII decimal numbers as we expect.

Révision 6bc74771 (diff)
Ajouté par Benjamin Dauvergne il y a presque 4 ans

Revert "misc: replace v.isdigit() by is_number(v) (#41820)"

This reverts commit c3a514037a9fc08fa3885c1ee6d3a20517e4d66d.

Révision da747f41 (diff)
Ajouté par Benjamin Dauvergne il y a presque 4 ans

misc: replace v.isdigit() by is_number(v) (#41820)

isdigit() does not accept only ASCII decimal numbers as we expect.

Historique

#2

Mis à jour par Frédéric Péters il y a presque 4 ans

(nope, #41819#note-4).

#3

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

Alors v.isdecimal() and v.isascii().

#4

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

  • Assigné à mis à Benjamin Dauvergne
#5

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

  • Statut changé de Nouveau à Résolu (à déployer)
commit ae2de368820fc09da6fe4a4442713e5c19b8af1c
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Wed Apr 22 14:29:08 2020 +0200

    misc: replace v.isdigit() by is_number(v) (#41820)

    isdigit() does not accept only ASCII decimal numbers as we expect.
#6

Mis à jour par Frédéric Péters il y a presque 4 ans

Pas de relecture et build pété, https://jenkins.entrouvert.org/job/passerelle/

#7

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

  • Statut changé de Résolu (à déployer) à En cours

Yep désolé j'ai du me tromper de terminal.

#8

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

#9

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

Rebasé, patch bateau à relire.

#10

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

  • Version cible mis à ticket facile
#11

Mis à jour par Nicolas Roche (absent jusqu'au 3 avril) il y a presque 4 ans

  • Statut changé de Solution proposée à Solution validée

Je l'ai testé en travaillant sur les SMS, ça marche bien.
Je note que ta branche est en avance sur le patch proposé :

<<<
return string.isdecimal() and [ord(c) < 256 for c in string]
---
return string.isdecimal() and string.isascii()
>>>

Moi ça me va, ça me parraissait étrange de recevoir un tableau de booléens.

#12

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

  • Statut changé de Solution validée à Résolu (à déployer)
commit da747f414c5479fc2f43f36260766f7157f98847
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Wed Apr 22 14:29:08 2020 +0200

    misc: replace v.isdigit() by is_number(v) (#41820)

    isdigit() does not accept only ASCII decimal numbers as we expect.
#13

Mis à jour par Frédéric Péters il y a presque 4 ans

  • Statut changé de Résolu (à déployer) à Solution déployée

Formats disponibles : Atom PDF