Message81834
On Python3 time.strptime(string[, format]) accepts bytes as arguments
and then fails:
>>> strptime(b"2009", "%Y")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Programs\Python30\lib\_strptime.py", line 454, in _strptime_time
return _strptime(data_string, format)[0]
File "C:\Programs\Python30\lib\_strptime.py", line 322, in _strptime
found = format_regex.match(data_string)
TypeError: can't use a string pattern on a bytes-like object
time.strftime already rejects bytes arguments:
>>> strftime(b'%Y')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: strftime() argument 1 must be str, not bytes
time.strptime should do the same and reject bytes for both the arguments
(string and format).
(With Py2.x both str and unicode args work.) |
|
Date |
User |
Action |
Args |
2009-02-12 22:50:34 | ezio.melotti | set | recipients:
+ ezio.melotti |
2009-02-12 22:50:34 | ezio.melotti | set | messageid: <1234479034.17.0.353291380083.issue5236@psf.upfronthosting.co.za> |
2009-02-12 22:50:32 | ezio.melotti | link | issue5236 messages |
2009-02-12 22:50:31 | ezio.melotti | create | |
|