-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-45223: Lib/pty.py: handle stdin I/O errors same way as master I/O errors #28388
base: main
Are you sure you want to change the base?
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). Recognized GitHub usernameWe couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames: This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
7a949ec
to
87df07c
Compare
This PR is stale because it has been open for 30 days with no activity. |
Just signed the CLA, will check in a few days if it's active. |
@kanavin Just checked now and it still says no |
If i type @kanavin into https://check-python-cla.herokuapp.com/ I get 500 Internal server error. How did you check? |
Need to use |
Right, I had it set on bpo with @. I removed that, and it looks good now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good:
Ran 7 tests in 0.049s
OK (expected failures=1)
== Tests result: SUCCESS ==
✅ Deploy Preview for python-cpython-preview canceled.
|
reading stdin can throw the same I/O errors as reading from master fd does, e.g. when running under Yocto's test harness: ====================================================================== ERROR: test_spawn_doesnt_hang (test.test_pty.PtyTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python3.10/test/test_pty.py", line 316, in test_spawn_doesnt_hang pty.spawn([sys.executable, '-c', 'print("hi there")']) File "/usr/lib/python3.10/pty.py", line 181, in spawn _copy(master_fd, master_read, stdin_read) File "/usr/lib/python3.10/pty.py", line 157, in _copy data = stdin_read(STDIN_FILENO) File "/usr/lib/python3.10/pty.py", line 132, in _read return os.read(fd, 1024) OSError: [Errno 5] Input/output error So let's treat both channels the same. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
b0f657f
to
924e0c3
Compare
@kanavin Can you explain the way to reproduce the error? I would like to try this in my local and check if the error still exists. |
We use this to run the tests: I just confirmed: when running |
reading stdin can throw the same I/O errors as reading from master fd does,
e.g. when running under Yocto's test harness:
ERROR: test_spawn_doesnt_hang (test.test_pty.PtyTest)
Traceback (most recent call last):
File "/usr/lib/python3.10/test/test_pty.py", line 316, in test_spawn_doesnt_hang
pty.spawn([sys.executable, '-c', 'print("hi there")'])
File "/usr/lib/python3.10/pty.py", line 181, in spawn
_copy(master_fd, master_read, stdin_read)
File "/usr/lib/python3.10/pty.py", line 157, in _copy
data = stdin_read(STDIN_FILENO)
File "/usr/lib/python3.10/pty.py", line 132, in _read
return os.read(fd, 1024)
OSError: [Errno 5] Input/output error
So let's treat both channels the same.
Signed-off-by: Alexander Kanavin alex@linutronix.de
https://bugs.python.org/issue45223