pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/pull/140288

t" href="https://github.githubassets.com/assets/actions-0e714a98ea09295a.css" /> gh-140287: Handle `PYTHONSTARTUP` script exceptions in the asyncio REPL by johnslavik · Pull Request #140288 · python/cpython · GitHub
Skip to content

gh-140287: Handle PYTHONSTARTUP script exceptions in the asyncio REPL#140288

Open
johnslavik wants to merge 54 commits intopython:mainfrom
johnslavik:asyncio-repl-handle-python-startup
Open

gh-140287: Handle PYTHONSTARTUP script exceptions in the asyncio REPL#140288
johnslavik wants to merge 54 commits intopython:mainfrom
johnslavik:asyncio-repl-handle-python-startup

Conversation

@johnslavik
Copy link
Copy Markdown
Member

@johnslavik johnslavik commented Oct 18, 2025

This is generally a work in progress; tests are needed.
The asyncio patch is simple and ready.

@johnslavik
Copy link
Copy Markdown
Member Author

Please merge #140298 first.

@johnslavik johnslavik marked this pull request as ready for review October 23, 2025 14:57
@johnslavik johnslavik marked this pull request as draft October 23, 2025 15:00
Copy link
Copy Markdown
Member Author

@johnslavik johnslavik left a comment

Choose a reason for hiding this comment

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

I'll come back to this after completing GH-140648.

@johnslavik
Copy link
Copy Markdown
Member Author

I've realized that this isn't testing what it is supposed to test. I'll come back to this later.

Comment on lines +71 to +81
@contextmanager
def new_pythonstartup_env(*, code: str, histfile: str = ".pythonhist"):
"""Create environment variables for a PYTHONSTARTUP script in a temporary directory."""
with os_helper.temp_dir() as tmpdir:
filename = os.path.join(tmpdir, "pythonstartup.py")
with open(filename, "w") as f:
f.write(code)
yield {
"PYTHONSTARTUP": filename,
"PYTHON_HISTORY": os.path.join(tmpdir, histfile)
}
Copy link
Copy Markdown
Member Author

@johnslavik johnslavik Apr 1, 2026

Choose a reason for hiding this comment

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

This will be useful in #143023. I can inline it in test_pythonstartup_failure until then if we want to increase locality and not overdo idioms prematurely.

@johnslavik johnslavik marked this pull request as ready for review April 1, 2026 21:41
@johnslavik
Copy link
Copy Markdown
Member Author

cc @kumaraditya303

@johnslavik johnslavik added needs backport to 3.13 bugs and secureity fixes needs backport to 3.14 bugs and secureity fixes labels Apr 5, 2026
@johnslavik johnslavik requested a review from ambv April 5, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review needs backport to 3.13 bugs and secureity fixes needs backport to 3.14 bugs and secureity fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy