Closed
Description
Bug report
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:
Line 250 in 024ac54
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
Linked PRs
- gh-100256: Skip inaccessible registry keys in the WinAPI mimetype implementation #122047
- [3.13] gh-100256: Skip inaccessible registry keys in the WinAPI mimetype implementation (GH-122047) #122786
- [3.12] gh-100256: Skip inaccessible registry keys in the WinAPI mimetype implementation (GH-122047) #122787