#1531 closed defect

use ctypes.get_last_error instead of GetLastError to access Windows error code — at Version 3

Reported by: davidsarah Owned by: davidsarah
Priority: normal Milestone: 1.11.0
Component: code Version: 1.9.0a1
Keywords: windows error GetLastError magic-folder Cc:
Launchpad Bug:

Description (last modified by zooko)

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.)

Change History (3)

comment:1 Changed at 2011-09-07T23:21:29Z by davidsarah

  • Milestone changed from undecided to eventually
  • Owner changed from somebody to davidsarah
  • Status changed from new to assigned

comment:2 Changed at 2014-04-30T02:12:53Z by daira

  • Description modified (diff)

Actually fixups.py never calls GetLastError (although perhaps it should).

comment:3 Changed at 2014-04-30T14:53:47Z by zooko

  • Description modified (diff)
Note: See TracTickets for help on using tickets.