It's kind of a non-issue, but it is true that if an error is raised while acquiring OS_ENV_LOCK or when calling os.environ.get, old_env won't be set, which will raise a NameError. This is a kind of rare situation anyway, and it would probably only come up during a non-recoverable error, but we may as well fix it — if only so that people who use CPython as an example of "good code" will have an example of the right way to handle this sort of situation.
Probably this is trivial enough that we can skip an issue and news, but I'll just create one anyway 😛
Activity
GH-102537: Handle check for PYTHONTZPATH failing in zoneinfo test (GH…
pythonGH-102537: Handle check for PYTHONTZPATH failing in zoneinfo te…
pythonGH-102537: Handle check for PYTHONTZPATH failing in zoneinfo te…
GH-102537: Handle check for PYTHONTZPATH failing in zoneinfo test (GH…
GH-102537: Handle check for PYTHONTZPATH failing in zoneinfo test (GH…
arhadthedev commented on Apr 2, 2023
Should this issue be closed as resolved?
hugovk commented on Nov 10, 2023
Yes, let's close it :)