Skip to content
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

gh-121790: Fix interactive console initialization #121793

Merged
merged 6 commits into from
Jul 15, 2024

Conversation

zvyn
Copy link
Contributor

@zvyn zvyn commented Jul 15, 2024

@zvyn zvyn force-pushed the zvyn/fix_interactive_console_init branch from a33259e to 9a24df1 Compare July 15, 2024 14:29
Lib/_pyrepl/main.py Outdated Show resolved Hide resolved
Lib/_pyrepl/simple_interact.py Show resolved Hide resolved
Lib/_pyrepl/simple_interact.py Show resolved Hide resolved
Lib/_pyrepl/simple_interact.py Outdated Show resolved Hide resolved
Lib/_pyrepl/simple_interact.py Outdated Show resolved Hide resolved
Comment on lines -520 to -523
try:
from _pyrepl.main import CAN_USE_PYREPL
except ImportError:
CAN_USE_PYREPL = False
Copy link
Contributor

Choose a reason for hiding this comment

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

I simplify this here because in the current state of the code there is no reason for this import to ever fail.

Comment on lines -198 to -199
def test_asyncio_repl_no_tty_fails(self):
assert assert_python_failure("-m", "asyncio")
Copy link
Contributor

Choose a reason for hiding this comment

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

this test used to be test_asyncio_repl_is_ok before we broke it

@ambv ambv added skip news topic-repl Related to the interactive shell labels Jul 15, 2024
Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

Thanks @ambv! Confirmed that this PR fixes #121790

@ambv
Copy link
Contributor

ambv commented Jul 15, 2024

The Windows failure in the PYTHONSTARTUP test is a bit peculiar. It's actually an exception in asyncio proper:

Traceback (most recent call last):
  File "C:\Users\ambv\OneDrive\Documents\GitHub\cpython\Lib\runpy.py", line 189, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
                               ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "C:\Users\ambv\OneDrive\Documents\GitHub\cpython\Lib\runpy.py", line 148, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "C:\Users\ambv\OneDrive\Documents\GitHub\cpython\Lib\runpy.py", line 112, in _get_module_details
    __import__(pkg_name)
    ~~~~~~~~~~^^^^^^^^^^
  File "C:\Users\ambv\OneDrive\Documents\GitHub\cpython\Lib\asyncio\__init__.py", line 43, in <module>
    from .windows_events import *
  File "C:\Users\ambv\OneDrive\Documents\GitHub\cpython\Lib\asyncio\windows_events.py", line 8, in <module>
    import _overlapped
OSError: [WinError 10106] The requested service provider could not be loaded or initialized

It's definitely related though, so I'm investigating.

@ambv ambv merged commit e5c7216 into python:main Jul 15, 2024
39 checks passed
@ambv ambv added the needs backport to 3.13 bugs and security fixes label Jul 15, 2024
@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 15, 2024
)

(cherry picked from commit e5c7216)

Co-authored-by: Milan Oberkirch <milan.oberkirch@geops.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
@bedevere-app
Copy link

bedevere-app bot commented Jul 15, 2024

GH-121822 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 15, 2024
ambv added a commit that referenced this pull request Jul 15, 2024
…H-121822)

(cherry picked from commit e5c7216)

Co-authored-by: Milan Oberkirch <milan.oberkirch@geops.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
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