Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-131189: Fix "msvcrt" import warning on Linux when "_ctypes" is not available.#131201

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ambv merged 1 commit intopython:mainfromplashchynski:fix_msvcrt_warning_on_linux
Jul 15, 2025

Conversation

plashchynski
Copy link
Contributor

@plashchynskiplashchynski commentedMar 13, 2025
edited by bedevere-appbot
Loading

On Linux, compiling without "libffi" causes a misleading warning
"No module named 'msvcrt'" when launching PyREPL.

On Linux, compiling without "libffi" causes a"No module named 'msvcrt'" warning when launching PyREPL.
@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

Copy link
Member

@sobolevnsobolevn left a comment

Choose a reason for hiding this comment

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

I cannot recreate the same setup as you have, can you please share what happens with this change in place?

@plashchynski
Copy link
ContributorAuthor

@sobolevn steps to reproduce on a fresh Ubuntu Server 24.04.2 setup:

sudo apt install build-essentialgit clone https://github.com/python/cpython.gitcd cpython./configuremake

Then:

./python

shows:

Python 3.14.0a5+ (heads/main:c497f83ad85, Mar 14 2025, 09:42:58) [GCC 13.3.0] on linuxType "help", "copyright", "credits" or "license" for more information.warning: can't use pyrepl: No module named 'msvcrt'>>>

Here's afull log.

with changes in this PR, it shows the following with the same setup:

Python 3.14.0a5+ (heads/fix_msvcrt_warning_on_linux:56364cef29, Mar 14 2025, 09:49:25) [GCC 13.3.0] on linuxType "help", "copyright", "credits" or "license" for more information.warning: can't use pyrepl: No module named '_ctypes'>>>

Here's afull log.

warning: can't use pyrepl: No module named 'msvcrt'

this warning is misleading, becausemsvcrt is available only on NT systems.

warning: can't use pyrepl: No module named '_ctypes'

this warning is consistent with the warningmake shows for missing necessary bits:

The necessary bits to build these optional modules were not found:_bz2                      _ctypes                   _ctypes_test           _curses                   _curses_panel             _dbm                   _gdbm                     _hashlib                  _lzma                  _ssl                      _tkinter                  _uuid                  readline                  zlib                                             To find the necessary bits, look in configure.ac and config.log.
sobolevn reacted with heart emoji

Copy link
Member

@sobolevnsobolevn left a comment

Choose a reason for hiding this comment

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

Thanks, it is clear now! LGTM. However, I am not the module's maintainer, let's wait for them to make the final decision :)

plashchynski reacted with thumbs up emoji
Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@ambvambv merged commitf320c95 intopython:mainJul 15, 2025
54 checks passed
@ambvambv added the needs backport to 3.14bugs and security fixes labelJul 15, 2025
@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJul 15, 2025
…is not available. (pythonGH-131201)Fix "msvcrt" import warning on Linux when "_ctypes" is not available.On Linux, compiling without "libffi" causes a"No module named 'msvcrt'" warning when launching PyREPL.(cherry picked from commitf320c95)Co-authored-by: Dzmitry Plashchynski <plashchynski@gmail.com>
@bedevere-app
Copy link

GH-136668 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelJul 15, 2025
ambv pushed a commit that referenced this pull requestJul 15, 2025
… is not available. (GH-131201) (GH-136668)Fix "msvcrt" import warning on Linux when "_ctypes" is not available.On Linux, compiling without "libffi" causes a"No module named 'msvcrt'" warning when launching PyREPL.(cherry picked from commitf320c95)Co-authored-by: Dzmitry Plashchynski <plashchynski@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@vstinnervstinnervstinner approved these changes

@sobolevnsobolevnsobolevn approved these changes

@pablogsalpablogsalAwaiting requested review from pablogsalpablogsal is a code owner

@lysnikolaoulysnikolaouAwaiting requested review from lysnikolaoulysnikolaou is a code owner

@ambvambvAwaiting requested review from ambvambv is a code owner

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@plashchynski@vstinner@sobolevn@ambv@picnixz

[8]ページ先頭

©2009-2025 Movatter.jp