Author itchyny
Recipients belopolsky, itchyny, p-ganssle
Date 2021-02-23.00:44:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1614041048.64.0.829643107911.issue43295@roundup.psfhosted.org>
In-reply-to
Content
I noticed another unexpectedeffect of the IGNORECASE flag. It enables some non-ascii characters to match against the alphabets.

>>> from datetime import datetime
>>> datetime.strptime("Apr\u0130l", "%B")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/local/lib/python3.9/_strptime.py", line 391, in _strptime
    month = locale_time.f_month.index(found_dict['B'].lower())
ValueError: 'apri̇l' is not in list

I expect time data does not match error. The ASCII flag will disable matching unexpected unicode characters.
History
Date User Action Args
2021-02-23 00:44:08itchynysetrecipients: + itchyny, belopolsky, p-ganssle
2021-02-23 00:44:08itchynysetmessageid: <1614041048.64.0.829643107911.issue43295@roundup.psfhosted.org>
2021-02-23 00:44:08itchynylinkissue43295 messages
2021-02-23 00:44:08itchynycreate