| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
On Windows, sysconfig.get_platform() checks for 'amd64' in sys.version to detect 64-bit builds. However, sys.version can be truncated (e.g., ~100 chars on clang builds), causing 'amd64' to be missing and returning 'win32' incorrectly. This fix adds sys.maxsize > 2**32 as a fallback check, which is reliable even when sys.version is truncated. Also reorders arm64 check before arm32 for proper precedence. Fixes: python#145410
When typing 'help(help)' inside the interactive help utility (help> prompt), the error message incorrectly suggested 'help()' which would exit the interactive help and return to the interpreter. Since we're already at the help> prompt, the correct command is 'help' (without parentheses) to redisplay the intro. This change updates the error message from: 'Use help() to get the interactive help utility.' to: 'Use 'help' to get the interactive help utility.' This makes the message consistent with the actual behavior - typing 'help' at the help> prompt calls self.intro() as expected.
Sorry, something went wrong.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead. |
Sorry, something went wrong.
|
I think proper title would be gh-94466 rather than Fix issue #94466. Please read the devguide before submitting a PR. |
Sorry, something went wrong.
| if os.name == 'nt': | ||
| import _sysconfig | ||
| platform = _sysconfig.get_platform() | ||
| if platform: | ||
| return platform | ||
| # Check for architecture in sys.version first, then fall back to sys.maxsize | ||
| # which is reliable even when sys.version is truncated (e.g., clang builds on Windows) | ||
| if 'amd64' in sys.version.lower(): | ||
| return 'win-amd64' | ||
| if sys.maxsize > 2**32: | ||
| # 64-bit Windows where sys.version may be truncated | ||
| return 'win-amd64' | ||
| if '(arm64)' in sys.version.lower(): | ||
| return 'win-arm64' | ||
| if '(arm)' in sys.version.lower(): | ||
| return 'win-arm32' | ||
| return sys.platform |
There was a problem hiding this comment.
This is unrelated (leaked from #146146).
Sorry, something went wrong.
|
I've closed this because of unrelated changes. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Good day
Summary
This PR fixes issue #94466, which reports an invalid help message when using help(help) inside the interactive help utility.
The Problem
When a user is at the help> prompt and types something like help(help), the error message displayed says:
However, at the help> prompt, typing help() would exit the interactive help and return to the Python interpreter. The correct command to redisplay the intro is simply help (without parentheses).
The Fix
Changed the error message from:
to:
This makes the message consistent with the actual behavior - typing help at the help> prompt calls self.intro() as expected (line 2041 in pydoc.py).
Testing
The fix was verified by examining the code path:
Files Changed
Thank you for your attention. If there are any issues or suggestions, please leave a comment and I will address them promptly.
Warmly,
Jah-yee