Skip to content

Warnings and errors specific to the C implementation of the warnings module #122255

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

Open
serhiy-storchaka opened this issue Jul 25, 2024 · 1 comment

Comments

@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented Jul 25, 2024

New deprecation warnings about missing or inconsistent __spec__.loader and __loader__ introduced in #86298 are emitted only for the C implementation of the warnings module. Existing errors (AttributeError or ValueError) are also only raised for the C implementation of the warnings module. See tests added in #122227.

I believe that before turning the deprecation warnings into errors, we should add warnings for the Python implementation.

cc @brettcannon, @warsaw

Linked PRs

serhiy-storchaka added a commit that referenced this issue Aug 8, 2024
They are similar to white box tests for gh-86298 in test_importlib.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Aug 8, 2024
They are similar to white box tests for pythongh-86298 in test_importlib.
(cherry picked from commit fe13c9b)

Co-authored-by: Serhiy Storchaka <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Aug 8, 2024
They are similar to white box tests for pythongh-86298 in test_importlib.
(cherry picked from commit fe13c9b)

Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Aug 8, 2024
… of the warnings module

In the linecache module and in the Python implementation of the
warnings module, a DeprecationWarning is issued when
m.__loader__ differs from m.__spec__.loader (like in the C
implementation of the warnings module).
gpshead pushed a commit that referenced this issue Aug 9, 2024
…H-122818)

gh-122255: Add black box tests in test_warnings (GH-122227)

They are similar to white box tests for gh-86298 in test_importlib.
(cherry picked from commit fe13c9b)

Co-authored-by: Serhiy Storchaka <[email protected]>
@serhiy-storchaka
Copy link
Member Author

Tests are failed for this change, and I think this is because it exposes a flaw in the current code. Opened #123011.

serhiy-storchaka added a commit that referenced this issue Aug 14, 2024
…H-122819)

They are similar to white box tests for gh-86298 in test_importlib.
(cherry picked from commit fe13c9b)

Co-authored-by: Serhiy Storchaka <[email protected]>
blhsing pushed a commit to blhsing/cpython that referenced this issue Aug 22, 2024
They are similar to white box tests for pythongh-86298 in test_importlib.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant