This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python 2.7.7 regression in mimetypes read_windows_registry
Type: behavior Stage: resolved
Components: Library (Lib), Windows Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Vladimir.Iofik, agolde, benjamin.peterson, python-dev, tim.golden
Priority: release blocker Keywords: patch

Created on 2014-06-25 15:48 by agolde, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
21871.patch Vladimir.Iofik, 2014-06-28 14:23
Messages (4)
msg221553 - (view) Author: (agolde) Date: 2014-06-25 15:48
Python 2.7.7 seems to contain a regression of issue #10162 as compared with 2.7.6, re-introduced by the fix of issue #9291.

import mimetypes
mimetypes.init()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\INRO\Emme\Emme 4\Emme-4.1.3\Python27\lib\mimetypes.py",
 line 348, in init
    db.read_windows_registry()
  File "C:\Program Files\INRO\Emme\Emme 4\Emme-4.1.3\Python27\lib\mimetypes.py",
 line 256, in read_windows_registry
    with _winreg.OpenKey(hkcr, subkeyname) as subkey:
WindowsError: [Error 5] Access is denied

Whereas with Python 2.7.6 on the same system, this doesn't generate any errors.

It looks like in Python 2.7.6, "with _winreg.OpenKey(hkcr, subkeyname) as subkey:" was within a try-except which was moved with the patch for issue#9291 in Python 2.7.7
msg221785 - (view) Author: Vladimir Iofik (Vladimir.Iofik) * Date: 2014-06-28 13:07
I have attached patch to #21652 which partly reverts patch applied in #9291. I think we'll have to add one more test for this case.
msg221795 - (view) Author: Vladimir Iofik (Vladimir.Iofik) * Date: 2014-06-28 14:23
Test added.
msg221891 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-06-29 20:04
New changeset ee33d61f5e4b by Benjamin Peterson in branch '2.7':
add a test for access errors from OpenKey (closes #21871)
http://hg.python.org/cpython/rev/ee33d61f5e4b
History
Date User Action Args
2022-04-11 14:58:05adminsetgithub: 66070
2014-06-29 20:04:03python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg221891

resolution: fixed
stage: resolved
2014-06-28 14:23:47Vladimir.Iofiksetfiles: + 21871.patch
keywords: + patch
messages: + msg221795
2014-06-28 13:07:50Vladimir.Iofiksetmessages: + msg221785
2014-06-25 18:14:47benjamin.petersonsetpriority: normal -> release blocker
2014-06-25 18:14:36benjamin.petersonsetnosy: + tim.golden, benjamin.peterson, Vladimir.Iofik
2014-06-25 15:48:56agoldecreate