gh-100256: Skip inaccessible registry keys in the WinAPI mimetype implementation (GH-122047)
(cherry picked from commit
0bd93755f37e6b8beb597787fce39eb141179965)
Co-authored-by: Lucas Esposito <LucasEsposito@users.noreply.github.com>
Ben Escoto
Andy Eskilsson
André Espaze
+Lucas Esposito
Stefan Esser
Nicolas Estibals
Jonathan Eunice
--- /dev/null
+:mod:`mimetypes` no longer fails when it encounters an inaccessible registry key.
}
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) {