Message364117
You can validate the input before using it.
if '_' in s: raise ValueError
or
if not re.fullmatch('[0-9]+', s): raise ValueError
Do you want to accept "۱۲۳۴" or " 12 "? If not then validate the input before using int().
Also, do not use ast.literal_eval() with untrusted input without validation. It is not a "safe eval" and may even crash the interpreter. |
|
Date |
User |
Action |
Args |
2020-03-13 18:29:31 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, zd nex |
2020-03-13 18:29:31 | serhiy.storchaka | set | messageid: <1584124171.61.0.886117642667.issue39956@roundup.psfhosted.org> |
2020-03-13 18:29:31 | serhiy.storchaka | link | issue39956 messages |
2020-03-13 18:29:31 | serhiy.storchaka | create | |
|