itchyny <itchyny.itch...@gmail.com> added the comment: 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue43295> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com