New submission from Ezio Melotti <ezio.melo...@gmail.com>: 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.) ---------- components: Library (Lib), Unicode messages: 81834 nosy: ezio.melotti severity: normal status: open title: time.strptime should reject bytes arguments on Py3 type: behavior versions: Python 3.0, Python 3.1 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5236> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com