Skip to content

Commit

Permalink
pythongh-100256: Skip inaccessible registry keys in the WinAPI mimety…
Browse files Browse the repository at this point in the history
…pe implementation (pythonGH-122047)

(cherry picked from commit 0bd9375)

Co-authored-by: Lucas Esposito <[email protected]>
  • Loading branch information
miss-islington and LucasEsposito authored Aug 7, 2024
1 parent 2e82353 commit 8f4892a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ Michael Ernst
Ben Escoto
Andy Eskilsson
André Espaze
Lucas Esposito
Stefan Esser
Nicolas Estibals
Jonathan Eunice
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:mod:`mimetypes` no longer fails when it encounters an inaccessible registry key.
2 changes: 1 addition & 1 deletion Modules/_winapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2268,7 +2268,7 @@ _winapi__mimetypes_read_windows_registry_impl(PyObject *module,
}

err = RegOpenKeyExW(hkcr, ext, 0, KEY_READ, &subkey);
if (err == ERROR_FILE_NOT_FOUND) {
if (err == ERROR_FILE_NOT_FOUND || err == ERROR_ACCESS_DENIED) {
err = ERROR_SUCCESS;
continue;
} else if (err != ERROR_SUCCESS) {
Expand Down

0 comments on commit 8f4892a

Please sign in to comment.