Skip to content

gh-121711: Set -m asyncio return_code to 1 for ENOTTY #121714

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

Merged
merged 1 commit into from
Jul 13, 2024

Conversation

zvyn
Copy link
Contributor

@zvyn zvyn commented Jul 13, 2024

@ghost
Copy link

ghost commented Jul 13, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

def test_asyncio_repl_is_ok(self):
assert_python_ok("-m", "asyncio")
def test_asyncio_repl_no_tty_fails(self):
assert assert_python_failure("-m", "asyncio")
Copy link
Member

@Eclips4 Eclips4 Jul 13, 2024

Choose a reason for hiding this comment

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

How do we now know that the asyncio REPL is not working? Initially, test_asyncio_repl_is_ok was added because the asyncio repl is not working on Windows due to a bug.
Additionally: We don't use assert statement in our test suite.

Copy link
Contributor Author

@zvyn zvyn Jul 13, 2024

Choose a reason for hiding this comment

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

The fact that the new test passes means that assert_python_ok never tested weather the repl works.

I think t should be testet without setting stdin on Popen (inside assert_python_ok).

I can add that test, but it will fail because of another bug I found and am intending to fix soonish (report pending, easy to reproduce by running python -m asyncio from the main branch).

Copy link
Contributor

Choose a reason for hiding this comment

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

@Eclips4 asyncio REPL is currently broken and this wasn't caught.

Copy link
Member

Choose a reason for hiding this comment

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

The fact that the new test passes means that assert_python_ok never tested weather the repl works.

I think t should be testet without setting stdin on Popen (inside assert_python_ok).

I can add that test, but it will fail because of another bug I found and am intending to fix soonish (report pending, easy to reproduce by running python -m asyncio from the main branch).

Yes, you're right, I'm also experiencing the problem with python -m asyncio:

./python -m asyncio
asyncio REPL 3.14.0a0 (heads/main:dc03ce797a, Jul 13 2024, 15:05:30) [GCC 13.2.0] on linux
Use "await" directly instead of "asyncio.run()".
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
TypeError: run_multiline_interactive_console() missing 1 required positional argument: 'namespace'
Internal error, exiting asyncio REPL...

@ambv ambv added needs backport to 3.13 bugs and security fixes skip news labels Jul 13, 2024
@ambv ambv merged commit a183474 into python:main Jul 13, 2024
34 checks passed
@miss-islington-app
Copy link

Thanks @zvyn for the PR, and @ambv 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 Jul 13, 2024
…GH-121714)

Set return_code to 1 for ENOTTY
(cherry picked from commit a183474)

Co-authored-by: Milan Oberkirch <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Jul 13, 2024

GH-121718 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 Jul 13, 2024
ambv pushed a commit that referenced this pull request Jul 13, 2024
…1714) (GH-121718)

Set return_code to 1 for ENOTTY
(cherry picked from commit a183474)

Co-authored-by: Milan Oberkirch <[email protected]>
@ambv ambv added the topic-repl Related to the interactive shell label Jul 13, 2024
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news topic-repl Related to the interactive shell
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants