GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||
GeezerVison is showing github.com — bpo-42143: Ensure PyFunction_NewWithQualName() can't fail after creating the func object by Jongy · Pull Request #22953 · python/cpython Conversation
|
|
|
||
| /* __module__: If module name is in globals, use it. | ||
| Otherwise, use None. */ | ||
| module = PyDict_GetItemWithError(globals, __name__); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This now runs before Py_INCREF(globals), not sure if relevant (because our caller should hold a reference to globals, right?)
Can put Py_INCREF(globals) before this call.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@serhiy-storchaka leftovers from #11112 :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
BTW, the other possible way is to move initialization of func_qualname before setting func_module.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you for catching this Jongy! Since the bug is present in released versions, please add a NEWS entry for this fix. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Yes, I mentioned it in the bpo, but it will also require to check with
Sure, I'll add an entry later today 👍 I can also add a small test featuring my crashing snippet from the bpo - a test that makes sure the construction of a |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Agree.
It is not required, but it would be nice. Add |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Pushed a NEWS entry. Also added 2 small fixes (spacing + missing About the tests - I couldn't find a rightful place to put them in... If you got any idea, I'd be glad to hear, otherwise we can just merge it as is. As for the commit message - I think the message of the first commit suffices. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @Jongy for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-23021 is a backport of this pull request to the 3.9 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ing the func object (pythonGH-22953) func_dealloc() does not handle partially-created objects. Best not to give it any. (cherry picked from commit 3505261) Co-authored-by: Yonatan Goldschmidt <[email protected]>
…ing the func object (pythonGH-22953) func_dealloc() does not handle partially-created objects. Best not to give it any. (cherry picked from commit 3505261) Co-authored-by: Yonatan Goldschmidt <[email protected]>
|
GH-23022 is a backport of this pull request to the 3.8 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you for your contribution @Jongy! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ing the func object (GH-22953) func_dealloc() does not handle partially-created objects. Best not to give it any. (cherry picked from commit 3505261) Co-authored-by: Yonatan Goldschmidt <[email protected]>
…ing the func object (GH-22953) (GH-23021) func_dealloc() does not handle partially-created objects. Best not to give it any. (cherry picked from commit 3505261) Co-authored-by: Yonatan Goldschmidt <[email protected]>
|
Thank you for reviewing, @serhiy-storchaka :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…lots1 * origin/master: (365 commits) bpo-42029: Remove IRIX code (pythonGH-23023) bpo-42143: Ensure PyFunction_NewWithQualName() can't fail after creating the func object (pythonGH-22953) bpo-34204: Use pickle.DEFAULT_PROTOCOL in shelve (pythonGH-19639) bpo-41805: Documentation for PEP 585 (pythonGH-22615) bpo-42161: Micro-optimize _collections._count_elements() (pythonGH-23008) bpo-42161: Remove private _PyLong_Zero and _PyLong_One (pythonGH-23003) bpo-42099: Fix reference to ob_type in unionobject.c and ceval (pythonGH-22829) bpo-41659: Disallow curly brace directly after primary (pythonGH-22996) bpo-6761: Enhance __call__ documentation (pythonGH-7987) bpo-42161: Modules/ uses _PyLong_GetZero() and _PyLong_GetOne() (pythonGH-22998) bpo-41474, Makefile: Add dependency on cpython/frameobject.h (pythonGH-22999) bpo-42157: Rename unicodedata.ucnhash_CAPI (pythonGH-22994) bpo-42161: Use _PyLong_GetZero() and _PyLong_GetOne() (pythonGH-22995) bpo-30681: Support invalid date format or value in email Date header (pythonGH-22090) bpo-42161: Add _PyLong_GetZero() and _PyLong_GetOne() (pythonGH-22993) bpo-42123: Run the parser two times and only enable invalid rules on the second run (pythonGH-22111) bpo-42157: Convert unicodedata.UCD to heap type (pythonGH-22991) bpo-42157: unicodedata avoids references to UCD_Type (pythonGH-22990) bpo-39101: Fixes BaseException hang in IsolatedAsyncioTestCase. (pythonGH-22654) bpo-1635741: _PyUnicode_Name_CAPI moves to internal C API (pythonGH-22713) ...
…ing the func object (pythonGH-22953) func_dealloc() does not handle partially-created objects. Best not to give it any.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.