Skip to content

GH-102537: Handle check for PYTHONTZPATH failing in zoneinfo test #102538

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

Merged
merged 2 commits into from
Mar 10, 2023

Conversation

pganssle
Copy link
Member

@pganssle pganssle commented Mar 8, 2023

It is possible but unlikely for the python_tzpath_context function to fail between the start of the try block and the point where os.environ.get succeeds, in which case old_env will be undefined. In this case, we want to take no action.

Practically speaking this will really only happen in an error condition anyway, so it doesn't really matter, but we should probably do it right anyway.

Automerge-Triggered-By: GH:pganssle

pganssle added 2 commits March 8, 2023 13:18
It is possible but unlikely for the `python_tzpath_context` function to
fail between the start of the `try` block and the point where
`os.environ.get` succeeds, in which case `old_env` will be undefined. In
this case, we want to take no action.

Practically speaking this will really only happen in an error condition
anyway, so it doesn't really matter, but we should probably do it right
anyway.
@pganssle
Copy link
Member Author

pganssle commented Mar 8, 2023

@hugovk Do you mind taking a look at the strategy here? There's an equivalent PR for backports.zoneinfo here: pganssle/zoneinfo#131

I figure it's likely to get more attention over here, so we can do the review here and incorporate any changes made here over there if necessary.

@pganssle pganssle added needs backport to 3.10 only security fixes needs backport to 3.11 only security fixes labels Mar 8, 2023
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@miss-islington
Copy link
Contributor

Thanks @pganssle for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-102586 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Mar 10, 2023
@bedevere-bot
Copy link

GH-102587 is a backport of this pull request to the 3.10 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 10, 2023
…st (pythonGH-102538)

It is possible but unlikely for the `python_tzpath_context` function to fail between the start of the `try` block and the point where `os.environ.get` succeeds, in which case `old_env` will be undefined. In this case, we want to take no action.

Practically speaking this will really only happen in an error condition anyway, so it doesn't really matter, but we should probably do it right anyway.
(cherry picked from commit 64bde50)

Co-authored-by: Paul Ganssle <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Mar 10, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 10, 2023
…st (pythonGH-102538)

It is possible but unlikely for the `python_tzpath_context` function to fail between the start of the `try` block and the point where `os.environ.get` succeeds, in which case `old_env` will be undefined. In this case, we want to take no action.

Practically speaking this will really only happen in an error condition anyway, so it doesn't really matter, but we should probably do it right anyway.
(cherry picked from commit 64bde50)

Co-authored-by: Paul Ganssle <[email protected]>
miss-islington added a commit that referenced this pull request Mar 10, 2023
…-102538)

It is possible but unlikely for the `python_tzpath_context` function to fail between the start of the `try` block and the point where `os.environ.get` succeeds, in which case `old_env` will be undefined. In this case, we want to take no action.

Practically speaking this will really only happen in an error condition anyway, so it doesn't really matter, but we should probably do it right anyway.
(cherry picked from commit 64bde50)

Co-authored-by: Paul Ganssle <[email protected]>
miss-islington added a commit that referenced this pull request Mar 13, 2023
…-102538)

It is possible but unlikely for the `python_tzpath_context` function to fail between the start of the `try` block and the point where `os.environ.get` succeeds, in which case `old_env` will be undefined. In this case, we want to take no action.

Practically speaking this will really only happen in an error condition anyway, so it doesn't really matter, but we should probably do it right anyway.
(cherry picked from commit 64bde50)

Co-authored-by: Paul Ganssle <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants