You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ensurepip fails ungracefully when mimetype is missing from Windows registry #100256
A "WinError 5 Access is denied" error occurs when ensurepip (for python 3.10 and above) is run and there are missing/inaccessible mimetypes in the Windows registry. Because ensurepip is used in the Python installer, it also fails silently there, causing pip to never be installed without alerting the user to the issue. The line in which the error occurs is here:
Bypassing that line and instead using self._read_windows_registry(add_type) (which is the fallback function I believe) fixes the problem. I believe that _mimetypes_read_windows_registry(add_type) needs to be able to fail more gracefully when it can't find a particular mimetype in the registry.
I found someone else describing exactly the issue here.
Your environment
CPython versions tested on: 3.10, 3.11
Operating system and architecture: Windows 10 LTSC, x64
Activity
huanghe2015 commentedon Aug 4, 2023
Same thing happened with me ,Patrick and Stackoverflow.
pythongh-100256: Read Windows registry with the fallback implementati…
pythongh-100256: Skip inaccessible registry keys in the WinAPI implem…
pythongh-100256: Skip inaccessible registry keys in the mimetype WinA…
LucasEsposito commentedon Jul 19, 2024
Opened a PR to address this issue
Merge branch 'main' into pythongh-100256-denied_access_to_windows_mim…
pythongh-100256: Skip inaccessible registry keys in the mimetype WinA…
gh-100256: Skip inaccessible registry keys in the WinAPI mimetype imp…
pythongh-100256: Skip inaccessible registry keys in the WinAPI mimety…
pythongh-100256: Skip inaccessible registry keys in the WinAPI mimety…
gh-100256: Skip inaccessible registry keys in the WinAPI mimetype imp…
pythongh-100256: Skip inaccessible registry keys in the WinAPI mimety…
[3.13] gh-100256: Skip inaccessible registry keys in the WinAPI mimet…
hugovk commentedon Nov 18, 2024
Triage: Closing, PRs have been merged and backported.