Development #41820
isdigit vs unicode
Status:
Fermé
Priority:
Normal
Assignee:
Target version:
Start date:
17 April 2020
Due date:
% Done:
0%
Estimated time:
Patch proposed:
Yes
Planning:
No
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.
Files
Associated revisions
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.
History
Updated by Benjamin Dauvergne over 4 years ago
Il faut utiliser isdecimal().
https://stackoverflow.com/questions/22789392/str-isdecimal-and-str-isdigit-difference-example
Updated by Benjamin Dauvergne over 4 years ago
- Status changed from Nouveau to 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.
Updated by Frédéric Péters over 4 years ago
Pas de relecture et build pété, https://jenkins.entrouvert.org/job/passerelle/
Updated by Benjamin Dauvergne over 4 years ago
- Status changed from Résolu (à déployer) to En cours
Yep désolé j'ai du me tromper de terminal.
Updated by Benjamin Dauvergne over 4 years ago
- File 0001-misc-replace-v.isdigit-by-is_number-v-41820.patch 0001-misc-replace-v.isdigit-by-is_number-v-41820.patch added
- Tracker changed from Bug to Development
- Status changed from En cours to Solution proposée
- Patch proposed changed from No to Yes
Updated by Nicolas Roche over 4 years ago
- Status changed from Solution proposée to 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.
Updated by Benjamin Dauvergne over 4 years ago
- Status changed from Solution validée to 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.
Updated by Frédéric Péters over 4 years ago
- Status changed from Résolu (à déployer) to Solution déployée
misc: replace v.isdigit() by is_number(v) (#41820)
isdigit() does not accept only ASCII decimal numbers as we expect.