Skip to content

gh-114713: handle case of an empty string passed to ZoneInfo - #114731

Merged
Eclips4 merged 8 commits into
python:mainfrom
wrongnull:empy-key-zoneinfo
Apr 15, 2025
Merged

gh-114713: handle case of an empty string passed to ZoneInfo#114731
Eclips4 merged 8 commits into
python:mainfrom
wrongnull:empy-key-zoneinfo

Conversation

@wrongnull

@wrongnull wrongnull commented Jan 29, 2024

Copy link
Copy Markdown
Contributor

This special case will make the error message less confusing.

@Eclips4

Eclips4 commented Jan 29, 2024

Copy link
Copy Markdown
Member

I don't think that kind of change is needed in a NEWS entry. By other hand this change is user visible, so adding a NEWS entry probably makes sense.

Also, macOS CI/CD failure is unrelated. I'll restart it later.

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

I think it makes sense to check for an empty string before if os.path.isabs(path):, isn't it?

Comment thread Lib/zoneinfo/_tzpath.py Outdated
Comment thread Lib/test/test_zoneinfo/test_zoneinfo.py Outdated
@wrongnull

Copy link
Copy Markdown
Contributor Author

Thank you @sobolevn for the review. I agree with your statements so I rewrote the check

@sobolevn
sobolevn requested a review from pganssle January 30, 2024 21:25
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes and removed needs backport to 3.11 only security fixes labels May 9, 2024
@wrongnull
wrongnull requested a review from sobolevn August 28, 2024 07:32

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

Thank you, LGTM.
Though I think that a short NEWS entry would be good here.

@StanFromIreland

Copy link
Copy Markdown
Member

@wrongnull do you have a moment to add a NEWS entry?

@wrongnull

Copy link
Copy Markdown
Contributor Author

@wrongnull do you have a moment to add a NEWS entry?

yeah, I'm going to add it now

Comment thread Misc/NEWS.d/next/Library/2025-03-09-01-09-12.gh-issue-114713.lkq9vZ.rst Outdated
…kq9vZ.rst

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@tomasr8 tomasr8 removed the needs backport to 3.12 only security fixes label Apr 10, 2025
@StanFromIreland

Copy link
Copy Markdown
Member

@Eclips4 friendly ping :-)

Comment thread Misc/NEWS.d/next/Library/2025-03-09-01-09-12.gh-issue-114713.lkq9vZ.rst Outdated
@Eclips4
Eclips4 enabled auto-merge (squash) April 15, 2025 18:23
@Eclips4
Eclips4 merged commit 884df11 into python:main Apr 15, 2025
@miss-islington-app

Copy link
Copy Markdown

Thanks @wrongnull for the PR, and @Eclips4 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 15, 2025
…oneInfo` (pythonGH-114731)

(cherry picked from commit 884df11)

Co-authored-by: Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
@bedevere-app

bedevere-app Bot commented Apr 15, 2025

Copy link
Copy Markdown

GH-132563 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Apr 15, 2025
Eclips4 added a commit that referenced this pull request Apr 15, 2025
…ZoneInfo` (GH-114731) (#132563)

gh-114713: Handle case of an empty string passed to `zoneinfo.ZoneInfo` (GH-114731)
(cherry picked from commit 884df11)

Co-authored-by: Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Eclips4 added a commit to Eclips4/cpython that referenced this pull request May 3, 2025
Eclips4 added a commit that referenced this pull request May 3, 2025
Revert "gh-114713: Handle case of an empty string passed to `zoneinfo.ZoneInfo` (#114731)"

This reverts commit 884df11.
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 3, 2025
Revert "pythongh-114713: Handle case of an empty string passed to `zoneinfo.ZoneInfo` (pythonGH-114731)"

This reverts commit 884df11.
(cherry picked from commit fe44fc4)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Eclips4 added a commit that referenced this pull request May 3, 2025
gh-114713: Revert gh-114731 (GH-133330)

Revert "gh-114713: Handle case of an empty string passed to `zoneinfo.ZoneInfo` (GH-114731)"

This reverts commit 884df11.
(cherry picked from commit fe44fc4)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
Revert "pythongh-114713: Handle case of an empty string passed to `zoneinfo.ZoneInfo` (python#114731)"

This reverts commit 884df11.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants