Re: List of WindowsError error codes and meanings

2011-05-27 Thread Andrew Berg
On 2011.05.26 10:02 AM, Thomas Heller wrote: On Windows, you can use ctypes.FormatError(code) to map error codes to strings: import ctypes ctypes.FormatError(32) 'Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird.' For HRESULT codes,

Re: List of WindowsError error codes and meanings

2011-05-26 Thread Thomas Heller
Am 20.05.2011 19:56, schrieb Andrew Berg: This is probably somewhat off-topic, but where would I find a list of what each error code in WindowsError means? WindowsError is so broad that it could be difficult to decide what to do in an except clause. Fortunately, sys.exc_info()[1][0] holds the

Re: List of WindowsError error codes and meanings

2011-05-22 Thread Andrew Berg
On 2011.05.21 06:46 AM, John J Lee wrote: Since Python 2.5, the errno attribute maps the Windows error to error codes that match the attributes of module errno. I was able to whip up a nifty little function that takes the output of sys.exc_info() after a WindowsError and return the error code. I

Re: List of WindowsError error codes and meanings

2011-05-22 Thread John Lee
Genstein genstein at invalid.invalid writes: Andrew Bergbahamutzero8825 at gmail.com writes: Since Python 2.5, the errno attribute maps the Windows error to error codes that match the attributes of module errno. Good point, I completely misread that. At least the Windows error code

Re: List of WindowsError error codes and meanings

2011-05-21 Thread John J Lee
Andrew Berg bahamutzero8...@gmail.com writes: This is probably somewhat off-topic, but where would I find a list of what each error code in WindowsError means? WindowsError is so broad that it could be difficult to decide what to do in an except clause. Fortunately, sys.exc_info()[1][0] holds

Re: List of WindowsError error codes and meanings

2011-05-21 Thread Genstein
Andrew Bergbahamutzero8...@gmail.com writes: Since Python 2.5, the errno attribute maps the Windows error to error codes that match the attributes of module errno. Good point, I completely misread that. At least the Windows error code is still available as the winerror attribute. As an

List of WindowsError error codes and meanings

2011-05-20 Thread Andrew Berg
This is probably somewhat off-topic, but where would I find a list of what each error code in WindowsError means? WindowsError is so broad that it could be difficult to decide what to do in an except clause. Fortunately, sys.exc_info()[1][0] holds the specific error code, so I could put in an

Re: List of WindowsError error codes and meanings

2011-05-20 Thread Genstein
On 20/05/2011 18:56, Andrew Berg wrote: This is probably somewhat off-topic, but where would I find a list of what each error code in WindowsError means? Assuming it's a Win32 error code, winerror.h from the Platform SDK holds the answer. One version is linked below, it's in theory out of

Re: List of WindowsError error codes and meanings

2011-05-20 Thread Tim Golden
On 20/05/2011 18:56, Andrew Berg wrote: This is probably somewhat off-topic, but where would I find a list of what each error code in WindowsError means? WindowsError is so broad that it could be difficult to decide what to do in an except clause. Fortunately, sys.exc_info()[1][0] holds the

Re: List of WindowsError error codes and meanings

2011-05-20 Thread Andrew Berg
On 2011.05.20 02:47 PM, Genstein wrote: On 20/05/2011 18:56, Andrew Berg wrote: This is probably somewhat off-topic, but where would I find a list of what each error code in WindowsError means? Assuming it's a Win32 error code, winerror.h from the Platform SDK holds the answer. One