Bug 1595331
Summary: | python-peewee FTFBS with Python 3.7 | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Viliam Križan <vkrizan> |
Component: | python-peewee | Assignee: | Viliam Križan <vkrizan> |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | cstratak, mhroncok, vkrizan |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | python-peewee-2.10.2-5.fc29 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-06-26 20:39:31 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1565020 |
Description
Viliam Križan
2018-06-26 15:57:13 UTC
The generator should return instead. See https://www.python.org/dev/peps/pep-0479/ (Sorry, it took me a while to realize you already say that in the begging of the text.) (In reply to Miro Hrončok from comment #2) > (Sorry, it took me a while to realize you already say that in the begging of > the text.) No problem =) For some reason the scratch build hangs on running the test suite: https://koji.fedoraproject.org/koji/taskinfo?taskID=27883743 You cannot convert all raise StopIteration to returns. You should amke sure that generators (functions that yield) never raise it. Sometimes that involves stuff like: try: yield self.iterate() except StopIteration: return I'm trying a different patch in https://koji.fedoraproject.org/koji/taskinfo?taskID=27885548 Should I push if it works, or would you like to review? Here it is anyway: diff --git a/peewee.py b/peewee.py index cd29348..44e7601 100644 --- a/peewee.py +++ b/peewee.py @@ -2350,7 +2350,10 @@ class QueryResultWrapper(object): def iterator(self): while True: - yield self.iterate() + try: + yield self.iterate() + except StopIteration: + return def next(self): if self._idx < self._ct: diff --git a/playhouse/_speedups.pyx b/playhouse/_speedups.pyx index 184ee07..a9a297c 100644 --- a/playhouse/_speedups.pyx +++ b/playhouse/_speedups.pyx @@ -213,7 +213,10 @@ cdef class _QueryResultWrapper(object): def iterator(self): while True: - yield self.iterate() + try: + yield self.iterate() + except StopIteration: + return def __next__(self): cdef object inst --------- Your patch made it iterate forever, because iterate (not a generator) never raised an exception and instead returned None, while iterator (a generator) was yielding Nones forever. ppc64le fails with unrelated problem. Thanks Miro! Feel free to push it. I've pushed it and started another build, but the ppc64le problem will probably hit us again. https://koji.fedoraproject.org/koji/taskinfo?taskID=27887082 Yeah the ppc64le have problems with concurrency. Sometimes it fails. Would `ExcludeArch` help? I guess we do not need any PPC architecture. It built. ¯\_(ツ)_/¯ Excluding the arch would put unnecessary burden on noarch packages that (build)require pythonX-peewee. |