Project

General

Profile

Development #41820

isdigit vs unicode

Added by Frédéric Péters about 1 year ago. Updated about 1 year ago.

Status:
Solution déployée
Priority:
Normal
Start date:
17 Apr 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

Revision c3a51403 (diff)
Added by Benjamin Dauvergne about 1 year ago

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

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

Revision 6bc74771 (diff)
Added by Benjamin Dauvergne about 1 year ago

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

This reverts commit c3a514037a9fc08fa3885c1ee6d3a20517e4d66d.

Revision da747f41 (diff)
Added by Benjamin Dauvergne about 1 year ago

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

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

History

#3

Updated by Benjamin Dauvergne about 1 year ago

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

#4

Updated by Benjamin Dauvergne about 1 year ago

  • Assignee set to Benjamin Dauvergne
#5

Updated by Benjamin Dauvergne about 1 year 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.
#6

Updated by Frédéric Péters about 1 year ago

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

#7

Updated by Benjamin Dauvergne about 1 year ago

  • Status changed from Résolu (à déployer) to En cours

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

#8

Updated by Benjamin Dauvergne about 1 year ago

#9

Updated by Benjamin Dauvergne about 1 year ago

Rebasé, patch bateau à relire.

#10

Updated by Benjamin Dauvergne about 1 year ago

  • Target version set to ticket facile
#11

Updated by Nicolas Roche about 1 year 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.

#12

Updated by Benjamin Dauvergne about 1 year 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.
#13

Updated by Frédéric Péters about 1 year ago

  • Status changed from Résolu (à déployer) to Solution déployée

Also available in: Atom PDF