-
-
Notifications
You must be signed in to change notification settings - Fork 32k
_PyModule_IsPossiblyShadowing
can return -1
without an exception set
#130932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
3.13
bugs and security fixes
3.14
bugs and security fixes
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-bug
An unexpected behavior, bug, or error
Comments
Thanks for spotting! Will put a PR... |
hauntsaninja
added a commit
to hauntsaninja/cpython
that referenced
this issue
Mar 6, 2025
…iblyShadowing I chose to not raise an exception here because I think it would be confusing for module attribute access to start raising something other than AttributeError if e.g. the cwd goes away Without the change in moduleobject.c ``` ./python.exe -m unittest test.test_import.ImportTests.test_script_shadowing_stdlib_cwd_failure ... Assertion failed: (PyErr_Occurred()), function _PyObject_SetAttributeErrorContext, file object.c, line 1253. ```
hauntsaninja
added a commit
to hauntsaninja/cpython
that referenced
this issue
Mar 7, 2025
hauntsaninja
added a commit
that referenced
this issue
Mar 7, 2025
…adowing (#130934) I chose to not raise an exception here because I think it would be confusing for module attribute access to start raising something other than AttributeError if e.g. the cwd goes away Without the change in moduleobject.c ``` ./python.exe -m unittest test.test_import.ImportTests.test_script_shadowing_stdlib_cwd_failure ... Assertion failed: (PyErr_Occurred()), function _PyObject_SetAttributeErrorContext, file object.c, line 1253. ```
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Mar 7, 2025
…iblyShadowing (pythonGH-130934) I chose to not raise an exception here because I think it would be confusing for module attribute access to start raising something other than AttributeError if e.g. the cwd goes away Without the change in moduleobject.c ``` ./python.exe -m unittest test.test_import.ImportTests.test_script_shadowing_stdlib_cwd_failure ... Assertion failed: (PyErr_Occurred()), function _PyObject_SetAttributeErrorContext, file object.c, line 1253. ``` (cherry picked from commit 0a9ae5e) Co-authored-by: Shantanu <[email protected]>
hauntsaninja
added a commit
that referenced
this issue
Mar 7, 2025
…siblyShadowing (GH-130934) (#130939) gh-130932: Fix incorrect exception handling in _PyModule_IsPossiblyShadowing (GH-130934) I chose to not raise an exception here because I think it would be confusing for module attribute access to start raising something other than AttributeError if e.g. the cwd goes away Without the change in moduleobject.c ``` ./python.exe -m unittest test.test_import.ImportTests.test_script_shadowing_stdlib_cwd_failure ... Assertion failed: (PyErr_Occurred()), function _PyObject_SetAttributeErrorContext, file object.c, line 1253. ``` (cherry picked from commit 0a9ae5e) Co-authored-by: Shantanu <[email protected]>
kulikjak
added a commit
to kulikjak/cpython
that referenced
this issue
Mar 10, 2025
vstinner
pushed a commit
that referenced
this issue
Mar 11, 2025
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Mar 11, 2025
…31037) (cherry picked from commit 69309a5) Co-authored-by: Jakub Kulík <[email protected]>
vstinner
pushed a commit
that referenced
this issue
Mar 11, 2025
seehwan
pushed a commit
to seehwan/cpython
that referenced
this issue
Apr 16, 2025
…iblyShadowing (python#130934) I chose to not raise an exception here because I think it would be confusing for module attribute access to start raising something other than AttributeError if e.g. the cwd goes away Without the change in moduleobject.c ``` ./python.exe -m unittest test.test_import.ImportTests.test_script_shadowing_stdlib_cwd_failure ... Assertion failed: (PyErr_Occurred()), function _PyObject_SetAttributeErrorContext, file object.c, line 1253. ```
seehwan
pushed a commit
to seehwan/cpython
that referenced
this issue
Apr 16, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.13
bugs and security fixes
3.14
bugs and security fixes
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
This can lead to an assertion failure:
_Py_wgetcwd
does not set an exception on failure:cpython/Objects/moduleobject.c
Lines 923 to 924 in a025f27
Likely related to #95754
cc @hauntsaninja
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: