Opened at 2011-09-07T23:20:34Z
Last modified at 2016-03-22T05:03:36Z
#1531 closed defect
use ctypes.get_last_error instead of GetLastError to access Windows error code — at Initial Version
Reported by: | davidsarah | Owned by: | somebody |
---|---|---|---|
Priority: | normal | Milestone: | 1.11.0 |
Component: | code | Version: | 1.9.0a1 |
Keywords: | windows error GetLastError magic-folder | Cc: | |
Launchpad Bug: |
Description
We have some code in src/allmydata/windows/fixups.py and src/allmydata/util/fileutil.py that calls Windows API functions, and then calls GetLastError? if the API function fails. In theory, the Python interpreter could run code in-between on the same thread that changes the error code. See http://bugs.python.org/issue1798.
(We don't have any code in Tahoe proper that calls C runtime library functions, so this issue only affects us for GetLastError?, not errno. It is somewhat less likely to happen with GetLastError? than with errno, at least in CPython, but still possible.)