-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
strptime() fails to parse month names containing İ (U+0130) #136028
Copy link
Copy link
Closed
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Done
Bug report
Bug description:
strptime()fails to parse month names containing "İ" (U+0130, LATIN CAPITAL LETTER I WITH DOT ABOVE) like "İyun" or "İyul". This affects locales 'az_AZ', 'ber_DZ', 'ber_MA' and 'crh_UA'.This happens because
'İ'.lower() == 'i\u0307', but theremodule only supports 1-to-1 character matching in case-insensitive mode.There are several ways to fix this:
_strptime.LocaleTime. This is a large change and it would make converting names to indices more complex and/or slower. This is universal way which would work with any other letters which are converted to multiple characters in lower case (but currently 'İ' the only such case in Linux locales).The third way -- converting the input string to lower case before parsing -- does not work, because
Zfor timezone is case-sensitive.CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs