Skip to content

gh-128636: Fix crash in PyREPL when os.environ is overwritten with an invalid value#128653

Merged
pablogsal merged 4 commits into
python:mainfrom
tomasr8:pyrepl-environ
Jan 22, 2025
Merged

gh-128636: Fix crash in PyREPL when os.environ is overwritten with an invalid value#128653
pablogsal merged 4 commits into
python:mainfrom
tomasr8:pyrepl-environ

Conversation

@tomasr8

@tomasr8 tomasr8 commented Jan 8, 2025

Copy link
Copy Markdown
Member

This fixes the crash by catching TypeError and ValueError in addition to KeyError. I'm not sure if this the best fix, but it's the least invasive one. Feedback welcome!

@tomasr8

tomasr8 commented Jan 9, 2025

Copy link
Copy Markdown
Member Author

I'll look into the test failure later today

@pablogsal

Copy link
Copy Markdown
Member

Thanks for the PR @tomasr8 !

@pablogsal pablogsal merged commit ba9a4b6 into python:main Jan 22, 2025
@miss-islington-app

Copy link
Copy Markdown

Thanks @tomasr8 for the PR, and @pablogsal 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 Jan 22, 2025
… with an invalid value (pythonGH-128653)

(cherry picked from commit ba9a4b6)

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
@bedevere-app

bedevere-app Bot commented Jan 22, 2025

Copy link
Copy Markdown

GH-129186 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 Jan 22, 2025
pablogsal pushed a commit that referenced this pull request Jan 22, 2025
…n with an invalid value (GH-128653) (#129186)

gh-128636: Fix crash in PyREPL when `os.environ` is overwritten with an invalid value (GH-128653)
(cherry picked from commit ba9a4b6)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
@tomasr8 tomasr8 deleted the pyrepl-environ branch January 22, 2025 16:54
@bedevere-app

bedevere-app Bot commented Aug 23, 2025

Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants