[issue5236] time.strptime should reject bytes arguments on Py3
Brett Cannon br...@python.org added the comment: I am going to do a review at http://codereview.appspot.com/28147 ; not done yet. -- ___ 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
[issue5236] time.strptime should reject bytes arguments on Py3
Brett Cannon br...@python.org added the comment: Applied in r70755 for py3k. I am not backporting as I changed it to explicitly check both arguments which is a change in semantics. -- resolution: - accepted status: open - closed versions: -Python 3.0 ___ 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
[issue5236] time.strptime should reject bytes arguments on Py3
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Please remove the whitespace changes in the patch (around _cache_lock). Otherwise it is good. -- nosy: +amaury.forgeotdarc ___ 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
[issue5236] time.strptime should reject bytes arguments on Py3
Tennessee Leeuwenburg tleeuwenb...@gmail.com added the comment: Thanks for the comments all and sorry for the delay -- life! -- ___ 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
[issue5236] time.strptime should reject bytes arguments on Py3
Changes by Tennessee Leeuwenburg tleeuwenb...@gmail.com: Added file: http://bugs.python.org/file13355/strptime_patch_v2.txt ___ 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
[issue5236] time.strptime should reject bytes arguments on Py3
Changes by Tennessee Leeuwenburg tleeuwenb...@gmail.com: -- stage: test needed - patch review ___ 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
[issue5236] time.strptime should reject bytes arguments on Py3
Tennessee Leeuwenburg tleeuwenb...@gmail.com added the comment: Python implementation to raise this exception if a bytes argument is passed in as argument 1. Test case added to test_time -- Added file: http://bugs.python.org/file13311/strptime_patch.txt ___ 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
[issue5236] time.strptime should reject bytes arguments on Py3
Tennessee Leeuwenburg tleeuwenb...@gmail.com added the comment: I believe this shouldn't be tagged as part of the Lib component... Also, I am happy to work on this issue, developing tests and a patch. Would that be appropriate? I may take a little while to get the hang of things, but I'm happy to put some time into this. -- components: +Extension Modules -Library (Lib), Unicode nosy: +tleeuwenb...@gmail.com ___ 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
[issue5236] time.strptime should reject bytes arguments on Py3
Tennessee Leeuwenburg tleeuwenb...@gmail.com added the comment: My mistake, it is part of the Lib component ... I failed to see the callback to Python from timemodule.c and jumped to conclusions. In any case, I'm happy to work on this. -- ___ 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
[issue5236] time.strptime should reject bytes arguments on Py3
Tennessee Leeuwenburg tleeuwenb...@gmail.com added the comment: See also thread http://mail.python.org/pipermail/python-dev/2009-March/087104.html -- ___ 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
[issue5236] time.strptime should reject bytes arguments on Py3
Brett Cannon br...@python.org added the comment: If you want to work on it, Tennesse, then go for it! -- components: +Library (Lib) -Extension Modules priority: - normal ___ 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
[issue5236] time.strptime should reject bytes arguments on Py3
Changes by Brett Cannon br...@python.org: -- assignee: - brett.cannon nosy: +brett.cannon stage: - test needed ___ 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
[issue5236] time.strptime should reject bytes arguments on Py3
New submission from Ezio Melotti ezio.melo...@gmail.com: On Python3 time.strptime(string[, format]) accepts bytes as arguments and then fails: strptime(b2009, %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