Skip to content
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

Defer import warnings in pathlib #119049

Closed
barneygale opened this issue May 14, 2024 · 2 comments
Closed

Defer import warnings in pathlib #119049

barneygale opened this issue May 14, 2024 · 2 comments
Labels
performance Performance or resource usage topic-pathlib

Comments

@barneygale
Copy link
Contributor

barneygale commented May 14, 2024

As of GH-118793, the warnings module is used only once in pathlib, by PurePath.is_reserved(). We should be able to move the import warnings line into that method. But beware! Doing so seems to cause a failure in test_io, which needs further investigation.

Linked PRs

@Eclips4
Copy link
Member

Eclips4 commented May 15, 2024

But beware! Doing so seems to cause a failure in test_io, which needs further investigation.

I've written #119063 to address this. FYI, this is not related to pathlib :)

serhiy-storchaka pushed a commit that referenced this issue May 16, 2024
… API (GH-119063)

The source line was not displayed if the warnings module had not yet
been imported.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 16, 2024
…d by C API (pythonGH-119063)

The source line was not displayed if the warnings module had not yet
been imported.
(cherry picked from commit 100c7ab)

Co-authored-by: Kirill Podoprigora <[email protected]>
Eclips4 added a commit to Eclips4/cpython that referenced this issue May 17, 2024
serhiy-storchaka pushed a commit that referenced this issue May 17, 2024
…ed by C API (GH-119063) (GH-119106)

The source line was not displayed if the warnings module had not yet
been imported.
(cherry picked from commit 100c7ab)

Co-authored-by: Kirill Podoprigora <[email protected]>
@barneygale
Copy link
Contributor Author

Woot! Thank you @Eclips4 for sorting this :)

estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
…d by C API (pythonGH-119063)

The source line was not displayed if the warnings module had not yet
been imported.
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance or resource usage topic-pathlib
Projects
None yet
Development

No branches or pull requests

2 participants