[tahoe-lafs-trac-stream] [Tahoe-LAFS] #1531: use ctypes.get_last_error instead of GetLastError to access Windows error code
Tahoe-LAFS
trac at tahoe-lafs.org
Wed Apr 30 02:12:53 UTC 2014
#1531: use ctypes.get_last_error instead of GetLastError to access Windows error
code
----------------------------+----------------------------------------
Reporter: davidsarah | Owner: davidsarah
Type: defect | Status: assigned
Priority: major | Milestone: eventually
Component: code | Version: 1.9.0a1
Resolution: | Keywords: windows error GetLastError
Launchpad Bug: |
----------------------------+----------------------------------------
Old description:
> We have some code in [source:src/allmydata/windows/fixups.py] and
> [source: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.)
New description:
We have some code in [source:src/allmydata/windows/fixups.py] and
[source: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.)
--
Comment (by daira):
Actually `fixups.py` never calls `GetLastError` (although perhaps it
should).
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1531#comment:2>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list