-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Improve InvalidTZPathWarning
warning with a stacklevel
#106233
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
Comments
sobolevn
added a commit
to sobolevn/cpython
that referenced
this issue
Jun 29, 2023
There is an existing test for InvalidTZPathWarning: test_env_variable_relative_paths. Test that it points at the right place: - with self.assertWarns(self.module.InvalidTZPathWarning):
+ with self.assertWarns(self.module.InvalidTZPathWarning) as w:
self.module.reset_tzpath()
+ self.assertEqual(w.filename, __file__) |
serhiy-storchaka
pushed a commit
that referenced
this issue
Feb 6, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Feb 6, 2024
…honGH-106234) (cherry picked from commit d7334e2) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
serhiy-storchaka
pushed a commit
that referenced
this issue
Feb 6, 2024
fsc-eriker
pushed a commit
to fsc-eriker/cpython
that referenced
this issue
Feb 14, 2024
Triage: can this be closed or is there more to do? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Given this code:
And this command to run it:
PYTHONTZPATH=ex.py ./python.exe ex.py
Output will be:
Setting
stacklevel
From
1
to5
:Looks like
5
is the best in terms of being informative, where this warning comes from.I will send a PR with the fix.
CC @pganssle
Linked PRs
zoneinfo.InvalidTZPathWarning
#106234The text was updated successfully, but these errors were encountered: