[issue5239] Change time.strptime() to make it work with Unicode chars

Ezio Melotti report at bugs.python.org
Fri Feb 13 17:26:08 CET 2009


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

Sorry, I misunderstood the meaning of "no-brainer".

If we add re.UNICODE on Py2, strptime should work fine with unicode
strings, but it could fail somehow with normal strings. Is it more
important to provide a way to use Unicode chars that works only with
unicode strings or to have a coherent behavior between str and unicode?

I don't think that adding re.UNICODE will break any existing code, but
it may cause problems if someone tries to use encoded str instead of
unicode (but shouldn't work already).

Also note that encoded strings should be a problem only if they have to
match a strptime directive (e.g. %Y), the other chars should be compared
as they are, so it should work with str and unicode as long as they are
not mixed (I think that whitespaces are treated differently though).

I'll try to add re.UNICODE and see what happens.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5239>
_______________________________________


More information about the Python-bugs-list mailing list