KEMBAR78
GH-102537: Handle check for PYTHONTZPATH failing in zoneinfo test by pganssle · Pull Request #102538 · python/cpython · GitHub
Skip to content

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 <1377457+pganssle@users.noreply.github.com>
@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 <1377457+pganssle@users.noreply.github.com>
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 <1377457+pganssle@users.noreply.github.com>
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 <1377457+pganssle@users.noreply.github.com>
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