Skip to content

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

Merged
miss-islington merged 2 commits into
python:mainfrom
pganssle:fix_tzpath_context
Mar 10, 2023
Merged

GH-102537: Handle check for PYTHONTZPATH failing in zoneinfo test#102538
miss-islington merged 2 commits into
python:mainfrom
pganssle:fix_tzpath_context

Conversation

@pganssle

@pgansslepganssle commented Mar 8, 2023

Copy link
Copy Markdown
Member

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

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
Copy Markdown
MemberAuthor

@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.

@pgansslepganssle added needs backport to 3.10 only security fixes needs backport to 3.11 only security fixes labels Mar 8, 2023

@hugovkhugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@miss-islington

Copy link
Copy Markdown
Contributor

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

@bedevere-bot

Copy link
Copy Markdown

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

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

Copy link
Copy Markdown

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-botbedevere-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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testsTests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@pganssle@miss-islington@bedevere-bot@hugovk