Development #41820
isdigit vs unicode
Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
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
Revert "misc: replace v.isdigit() by is_number(v) (#41820)"
This reverts commit c3a514037a9fc08fa3885c1ee6d3a20517e4d66d.
misc: replace v.isdigit() by is_number(v) (#41820)
isdigit() does not accept only ASCII decimal numbers as we expect.
Historique
Mis à jour par Benjamin Dauvergne il y a presque 4 ans
Il faut utiliser isdecimal().
https://stackoverflow.com/questions/22789392/str-isdecimal-and-str-isdigit-difference-example
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.
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/
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.
Mis à jour par Benjamin Dauvergne il y a presque 4 ans
- Fichier 0001-misc-replace-v.isdigit-by-is_number-v-41820.patch 0001-misc-replace-v.isdigit-by-is_number-v-41820.patch ajouté
- Tracker changé de Bug à Development
- Statut changé de En cours à Solution proposée
- Patch proposed changé de Non à Oui
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.
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.
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
misc: replace v.isdigit() by is_number(v) (#41820)
isdigit() does not accept only ASCII decimal numbers as we expect.