| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…o potential side effects
- Added some comments for dict del usages - Switched to `__builtin__` instead of conditional `__dict__` access - Use kwargs for improved readability
…ist conditional branch
|
Since this could cause a segfault, it should perhaps be considered a security issue to be backported to the security branches. However, the way to trigger it is so obscure that I'm not sure it's worth backporting. @ambv what do you think? |
Sorry, something went wrong.
|
Thanks @ionite34 for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
Sorry, something went wrong.
|
Sorry, @ionite34 and @JelleZijlstra, I could not cleanly backport this to 3.11 due to a conflict. |
Sorry, something went wrong.
|
Sorry @ionite34 and @JelleZijlstra, I had trouble checking out the 3.10 backport branch. |
Sorry, something went wrong.
|
@ionite34 are you interested in doing the 3.10/3.11 backports (and potentially 3.7-3.9 if we decide this is important enough)? It's probably a matter of installing cherry-picker locally and fixing a few conflicts. |
Sorry, something went wrong.
Yeah I could try 👀, though uh, I don't think I saw anything on the dev guide regarding backports. Am I essentially doing the stuff mentioned here? https://pypi.org/project/cherry_picker/#example |
Sorry, something went wrong.
|
Thanks! Yes, cherrry-picker will do most of the work of actually creating the PR, you just have to do the manual work to fix the merge. Just as general background, we develop every 3.x version in a separate branch. PRs are usually first against the main branch (which will be 3.12). If the PR fixes a bug (as opposed to a new feature), we'll backport the change into the bugfix branches, which are currently for 3.10 and 3.11. |
Sorry, something went wrong.
…`__reduce__` when internal access of `builtins.__dict__` exhausts the iterator (pythonGH-101769). (cherry picked from commit 54dfa14) Co-authored-by: Ionite <dev@ionite.io>
…`__reduce__` when internal access of `builtins.__dict__` exhausts the iterator (pythonGH-101769). (cherry picked from commit 54dfa14) Co-authored-by: Ionite <dev@ionite.io>
|
GH-102228 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
…`__reduce__` when internal access of `builtins.__dict__` exhausts the iterator (pythonGH-101769). (cherry picked from commit 54dfa14) Co-authored-by: Ionite <dev@ionite.io>
|
GH-102229 is a backport of this pull request to the 3.10 branch. |
Sorry, something went wrong.
| } else { | ||
| PyObject *reversed = _PyEval_GetBuiltin(&_Py_ID(reversed)); | ||
| listreviterobject *it = (listreviterobject *)_it; | ||
| if (it->it_seq) { |
There was a problem hiding this comment.
If it_seq is NULL then reversed is leaked here, _PyEval_GetBuiltin returns a strong reference.
Sorry, something went wrong.
There was a problem hiding this comment.
Good point, but doesn't that mean the old code also leaked references? I'll prepare a PR to fix this now.
Sorry, something went wrong.
There was a problem hiding this comment.
Oh wait, the N code to Py_BuildValue steals a reference, so the previous code was right in terms of refcounting.
Sorry, something went wrong.
…ing (pythonGH-102265) Followup from pythonGH-101769.. (cherry picked from commit d71edbd) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
…ing (pythonGH-102265) Followup from pythonGH-101769.. (cherry picked from commit d71edbd) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
…ce__` when internal access of `builtins.__dict__` exhausts the iterator (python#101769)
| Back | FazBrowse Home | New Git URL |
Summary
Affected methods
This PR also fixes a compounded issue where currently genericaliasobject.ga_iter_reduce does not handle empty iterators at all and has no NULL check
Along with moving the evaluation of _PyEval_GetBuiltin for potential side effects, this also adds handling of the NULL case (like the other iter_reduce functions have:
Linked Issue