This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2017年05月31日 12:01 by mjpieters, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 1886 | merged | vstinner, 2017年05月31日 14:39 | |
| PR 2022 | merged | vstinner, 2017年06月09日 11:23 | |
| PR 2030 | merged | vstinner, 2017年06月09日 15:14 | |
| Messages (10) | |||
|---|---|---|---|
| msg294835 - (view) | Author: Martijn Pieters (mjpieters) * | Date: 2017年05月31日 12:01 | |
I'm not sure where exactly the error lies, but issue 27128 broke iter() for Argument Clinic class methods. The following works in Python 3.5, but not in Python 3.6: from datetime import datetime from asyncio import Task next(iter(datetime.now, None)) next(iter(Task.all_tasks, None)) In 3.6 StopIteration is raised: >>> next(iter(datetime.now, None)) Traceback (most recent call last): File "<stdin>", line 1, in <module> StopIteration >>> next(iter(Task.all_tasks, None)) Traceback (most recent call last): File "<stdin>", line 1, in <module> StopIteration (In 3.5 a `datetime.datetime` and `set` object are produced, respectively) The only thing these two methods have in common is that they are class methods with no arguments, parsed out by the Argument Clinic generated code (so using _PyArg_Parser). What appears to have changed is that iter() was switched from using PyObject_Call to _PyObject_FastCall, see https://github.com/python/cpython/commit/99ee9c70a73ec2f3db68785821a9f2867c3f637f |
|||
| msg294836 - (view) | Author: Martijn Pieters (mjpieters) * | Date: 2017年05月31日 12:09 | |
Forgot to addthis: this bug was found via https://stackoverflow.com/questions/44283540/iter-not-working-with-datetime-now |
|||
| msg294841 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2017年05月31日 12:30 | |
It works in 3.5 and 3.7, but raises a StopIteration in 3.6. |
|||
| msg294845 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年05月31日 14:41 | |
Oh, it's my fault: it's a bug coming from FASTCALL optimizations. The strange thing is that the bug wasn't catched by the giant Python test suite :-( I knew that _PyStack_UnpackDict() has a bug in Python 3.6, but I completely forgot to fix it :-( https://github.com/python/cpython/pull/1886 fixes the bug, but has not test yet. |
|||
| msg294847 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2017年05月31日 16:10 | |
next(iter(datetime.now, None)) can be turned into a nice test. |
|||
| msg295515 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年06月09日 11:24 | |
New changeset f0ff849adc6b4a01f9d1f08d9ad0f1511ff84541 by Victor Stinner in branch '3.6': bpo-30524: Fix _PyStack_UnpackDict() (#1886) https://github.com/python/cpython/commit/f0ff849adc6b4a01f9d1f08d9ad0f1511ff84541 |
|||
| msg295535 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年06月09日 14:48 | |
New changeset 3b5cf85edc188345668f987c824a2acb338a7816 by Victor Stinner in branch 'master': bpo-30524: Write unit tests for FASTCALL (#2022) https://github.com/python/cpython/commit/3b5cf85edc188345668f987c824a2acb338a7816 |
|||
| msg295566 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年06月09日 20:28 | |
New changeset b7577456c430283f8b7ec4e914b701cb943cc69b by Victor Stinner in branch '3.6': bpo-30524: Write unit tests for FASTCALL (#2022) (#2030) https://github.com/python/cpython/commit/b7577456c430283f8b7ec4e914b701cb943cc69b |
|||
| msg295572 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年06月09日 20:45 | |
Sorry for the regression, sadly, it wasn't catch before by any test. I added a lot of new tests, so we should cover more cases. Oh, and the bug has been fixed in 3.6 :-) |
|||
| msg296486 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年06月20日 20:34 | |
bpo-30473 has been marked as a duplicate of this bug. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:47 | admin | set | github: 74709 |
| 2017年06月20日 20:34:33 | vstinner | set | messages: + msg296486 |
| 2017年06月20日 20:34:13 | vstinner | link | issue30473 superseder |
| 2017年06月09日 20:45:17 | vstinner | set | status: open -> closed resolution: fixed messages: + msg295572 stage: needs patch -> resolved |
| 2017年06月09日 20:28:35 | vstinner | set | messages: + msg295566 |
| 2017年06月09日 15:14:31 | vstinner | set | pull_requests: + pull_request2096 |
| 2017年06月09日 14:48:47 | vstinner | set | messages: + msg295535 |
| 2017年06月09日 11:24:56 | vstinner | set | messages: + msg295515 |
| 2017年06月09日 11:23:48 | vstinner | set | pull_requests: + pull_request2088 |
| 2017年05月31日 16:10:41 | serhiy.storchaka | set | messages: + msg294847 |
| 2017年05月31日 15:08:49 | rhettinger | set | priority: normal -> high |
| 2017年05月31日 14:41:03 | vstinner | set | messages: + msg294845 |
| 2017年05月31日 14:39:28 | vstinner | set | pull_requests: + pull_request1962 |
| 2017年05月31日 12:30:35 | serhiy.storchaka | set | keywords:
+ 3.6regression messages: + msg294841 components: + Interpreter Core versions: - Python 3.7 |
| 2017年05月31日 12:19:35 | abarry | set | nosy:
+ vstinner, serhiy.storchaka type: behavior stage: needs patch |
| 2017年05月31日 12:09:35 | mjpieters | set | messages: + msg294836 |
| 2017年05月31日 12:01:15 | mjpieters | create | |