GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-140287: Handle `PYTHONSTARTUP` script exceptions in the asyncio REPL by johnslavik · Pull Request #140288 · python/cpython

Conversation

@johnslavik

@johnslavik johnslavik commented Oct 18, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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

  • Issue: The asyncio REPL interactive daemon thread doesn't handle PYTHONSTARTUP exceptions #140287

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@johnslavik
Handle PYTHONSTARTUP script exceptions
faa22f4
@bedevere-app bedevere-app Bot mentioned this pull request Oct 18, 2025
The asyncio REPL interactive daemon thread doesn't handle PYTHONSTARTUP exceptions #140287
Closed
johnslavik added 6 commits October 18, 2025 12:13
@johnslavik
Add blurb
5b3ad2c
@johnslavik
Use console.showtraceback() instead of sys.excepthook()
00edac4
@johnslavik
Properly run asyncio REPL in REPL tests
e396622
@johnslavik
Move comment to a better place
4079074
@johnslavik
Add tests
0440d0e
@johnslavik
Merge branch 'properly-run-asyncio-repl-in-repl-tests' into asyncio-r…
af6f657
…epl-handle-python-startup
@johnslavik

johnslavik commented Oct 23, 2025

Copy link
Copy Markdown
Member Author

Please merge #140298 first.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@johnslavik
johnslavik marked this pull request as ready for review October 23, 2025 14:57
@johnslavik
johnslavik requested review from 1st1, asvetlov, kumaraditya303 and willingc as code owners October 23, 2025 14:57
@bedevere-app bedevere-app Bot added the awaiting review label Oct 23, 2025
@johnslavik
johnslavik marked this pull request as draft October 23, 2025 15:00
@bedevere-app bedevere-app Bot removed the awaiting review label Oct 23, 2025
johnslavik added 4 commits October 24, 2025 23:31
@johnslavik
Merge branch 'main' into asyncio-repl-handle-python-startup
848638d
@johnslavik
Improve test structure
d158dbf
@johnslavik
Use SHORT_TIMEOUT
9355da7
@johnslavik
Revert "Use SHORT_TIMEOUT"
3dc4cac
This reverts commit 9355da7.
johnslavik
johnslavik commented Oct 27, 2025
View reviewed changes
Comment thread Lib/test/test_repl.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_repl.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@johnslavik
johnslavik marked this pull request as ready for review October 27, 2025 01:15
@bedevere-app bedevere-app Bot added the awaiting review label Oct 27, 2025
@johnslavik johnslavik mentioned this pull request Oct 27, 2025
The asyncio REPL reaches for PYTHONSTARTUP in isolated mode #140648
Closed
johnslavik added 5 commits October 27, 2025 02:26
@johnslavik
Force no colorization
c786584
@johnslavik
Linecache doesn't matter and shouldn't break tests
b76db67
@johnslavik
Don't rely on line numbering on Windows...
cad1748
@johnslavik
Different names
d114ed5
@johnslavik
Idiomatize and simplify
e6e10ad
@bedevere-app bedevere-app Bot added the awaiting review label Apr 1, 2026
@johnslavik

johnslavik commented Apr 1, 2026

Copy link
Copy Markdown
Member Author

cc @kumaraditya303

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

johnslavik added 5 commits April 5, 2026 13:28
@johnslavik
Remove unnecessary decorator
442bbe3
@johnslavik
Catch compilation errors too
c115345
@johnslavik
Close startup file before executing code
02cfe94
@johnslavik
Rename new_pythonstartup_env to temp_pythonstartup
30983a5
@johnslavik
Rename code to source (code could be confused with the code obj…
8d37d53
…ect)
@johnslavik johnslavik added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels Apr 5, 2026
@johnslavik
johnslavik requested a review from ambv April 5, 2026 12:06
@johnslavik
Bring back uncolorization decorator (hypothesis failures)
e357efc
@johnslavik
johnslavik requested review from pablogsal and removed request for kumaraditya303 April 7, 2026 14:34
@johnslavik johnslavik assigned pablogsal Apr 13, 2026
pablogsal
pablogsal reviewed Apr 24, 2026
View reviewed changes
Comment thread Lib/test/test_repl.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

pablogsal
pablogsal reviewed Apr 24, 2026
View reviewed changes
Comment thread Lib/asyncio/__main__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

johnslavik added 2 commits April 24, 2026 21:43
@johnslavik
Assert on success return code
bbce6f6
@johnslavik
Remove trailing TODO
a3c86b1
@johnslavik
johnslavik requested a review from pablogsal April 25, 2026 11:28
@pablogsal
pablogsal merged commit 5ea3ae7 into python:main Apr 25, 2026
51 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Apr 25, 2026

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting review label Apr 25, 2026
@bedevere-app

bedevere-app Bot commented Apr 25, 2026

Copy link
Copy Markdown

GH-148987 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Apr 25, 2026
@bedevere-app

bedevere-app Bot commented Apr 25, 2026

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Apr 25, 2026
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@johnslavik @ljfp
pythongh-140287: Handle PYTHONSTARTUP script exceptions in the asyn…
955bef7
…cio REPL (python#140288)
hugovk pushed a commit that referenced this pull request Apr 29, 2026
@miss-islington @johnslavik
[3.14] gh-140287: Handle PYTHONSTARTUP script exceptions in the asy…
adfde79
…ncio REPL (GH-140288) (#148987)

Co-authored-by: Bartosz Sławecki <[email protected]>
hugovk pushed a commit that referenced this pull request Apr 29, 2026
@miss-islington @johnslavik
[3.13] gh-140287: Handle PYTHONSTARTUP script exceptions in the asy…
0c83e50
…ncio REPL (GH-140288) (#148988)

Co-authored-by: Bartosz Sławecki <[email protected]>
@johnslavik
johnslavik deleted the asyncio-repl-handle-python-startup branch July 21, 2026 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@1st1 1st1 Awaiting requested review from 1st1 1st1 is a code owner
@asvetlov asvetlov Awaiting requested review from asvetlov asvetlov is a code owner
@willingc willingc Awaiting requested review from willingc willingc is a code owner
@ambv ambv Awaiting requested review from ambv
@pablogsal pablogsal Awaiting requested review from pablogsal

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@pablogsal pablogsal

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@johnslavik @pablogsal
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.