homepage

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: test_logging may fail with 'Access is denied' when pywin32 is installed
Type: behavior Stage: resolved
Components: Library (Lib), Windows Versions: Python 3.6, Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: paul.moore, python-dev, steve.dower, tim.golden, vinay.sajip, zach.ware
Priority: normal Keywords: easy

Created on 2015年09月14日 04:21 by zach.ware, last changed 2022年04月11日 14:58 by admin. This issue is now closed.

Messages (7)
msg250610 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2015年09月14日 04:21
With an installed Python with pywin32 installed, running the test as a non-privileged user:
======================================================================
ERROR: test_basic (test.test_logging.NTEventLogHandlerTest)
----------------------------------------------------------------------
Traceback (most recent call last):
 File "C:\Python34\lib\test\test_logging.py", line 4108, in test_basic
 h = logging.handlers.NTEventLogHandler('test_logging')
 File "C:\Python34\lib\logging\handlers.py", line 1011, in __init__
 self._welu.AddSourceToRegistry(appname, dllname, logtype)
 File "C:\Python34\lib\site-packages\win32\lib\win32evtlogutil.py", line 35, in AddSourceToRegistry
 "SYSTEM\\CurrentControlSet\\Services\\EventLog\\%s\\%s" % (eventLogType, appName))
pywintypes.error: (5, 'RegCreateKey', 'Access is denied.')
The test should skip in the case of 'Access is denied'.
Assumed to affect 2.7 and up, but haven't checked anything but 3.4.
msg252046 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015年10月01日 19:39
New changeset 72c57c120c19 by Vinay Sajip in branch '3.4':
Fixes #25097: Windows test is skipped if there are insufficient privileges, rather than failing.
https://hg.python.org/cpython/rev/72c57c120c19
New changeset b54528d8d8c3 by Vinay Sajip in branch '3.5':
Fixes #25097: Merged fi from 3.4.
https://hg.python.org/cpython/rev/b54528d8d8c3
New changeset 757baaedc043 by Vinay Sajip in branch 'default':
Fixes #25097: Merged fix from 3.5.
https://hg.python.org/cpython/rev/757baaedc043 
msg252056 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2015年10月01日 20:15
Thanks, Vinay!
msg252140 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2015年10月02日 16:24
I'm not able to build on Windows at the moment, unfortunately - did the change actually work for you?
msg252428 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015年10月06日 20:23
New changeset 4e7697ccceeb by Zachary Ware in branch '3.4':
Issue #25097: fix Windows error number access
https://hg.python.org/cpython/rev/4e7697ccceeb
New changeset 440d4da352fa by Zachary Ware in branch '3.5':
Issue #25097: Merge with 3.4
https://hg.python.org/cpython/rev/440d4da352fa
New changeset d91f9fc7b85d by Zachary Ware in branch 'default':
Issue #25097: Merge with 3.5
https://hg.python.org/cpython/rev/d91f9fc7b85d 
msg252430 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015年10月06日 20:29
New changeset 03a569eb0e0e by Zachary Ware in branch '3.4':
Issue #25097: Re-raise any other pywin32 error
https://hg.python.org/cpython/rev/03a569eb0e0e
New changeset 95a26798819b by Zachary Ware in branch '3.5':
Issue #25097: Merge with 3.4
https://hg.python.org/cpython/rev/95a26798819b
New changeset db782c81bba9 by Zachary Ware in branch 'default':
Issue #25097: Merge with 3.5
https://hg.python.org/cpython/rev/db782c81bba9 
msg252431 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2015年10月06日 20:33
Turned out that your change didn't quite do it, but it was just the method you used to try to access the errno (which looks like it ought to work from the formatting of the error message).
Mere moments after pushing the fix for that, I realized that the new try/except was silently swallowing any other win32 errors that weren't permission errors, so that's the second batch of commits from me.
History
Date User Action Args
2022年04月11日 14:58:20adminsetgithub: 69284
2015年10月06日 20:33:41zach.waresetmessages: + msg252431
2015年10月06日 20:29:19python-devsetmessages: + msg252430
2015年10月06日 20:23:30python-devsetmessages: + msg252428
2015年10月02日 16:24:06vinay.sajipsetmessages: + msg252140
2015年10月01日 20:15:45zach.waresetstage: needs patch -> resolved
messages: + msg252056
versions: + Python 3.5, Python 3.6
2015年10月01日 20:12:12vinay.sajipsetstatus: open -> closed
resolution: fixed
2015年10月01日 19:39:52python-devsetnosy: + python-dev
messages: + msg252046
2015年09月14日 04:21:07zach.warecreate

AltStyle によって変換されたページ (->オリジナル) /