[issue22961] ctypes.WinError & OSError

2021-02-23 Thread Eryk Sun


Change by Eryk Sun :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22961] ctypes.WinError OSError

2014-11-28 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22961
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22961] ctypes.WinError OSError

2014-11-28 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

No, OSError.errno is converted from the Windows error code.

There is a translation map (see PC/errmap.h, built with the _dosmaperr() 
function) and the default value is EINVAL.

It's working as intended. What was the winerror code? do you think it should be 
mapped to another errno?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22961
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22961] ctypes.WinError OSError

2014-11-28 Thread Simon Zack

Simon Zack added the comment:

Ok, my bad, I was creating my own OSErrors so I was just testing it out. I just 
found the default to be rather confusing as I thought None would not be mapped 
to anything.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22961
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22961] ctypes.WinError OSError

2014-11-28 Thread eryksun

eryksun added the comment:

 the default value is EINVAL.

Should that be specified in the docs? Currently it states that [t]he errno 
attribute is then an approximate translation, in POSIX terms, of that native 
error code.

https://docs.python.org/3/library/exceptions.html#OSError

--
nosy: +eryksun

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22961
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22961] ctypes.WinError OSError

2014-11-27 Thread Simon Zack

Changes by Simon Zack simonz...@gmail.com:


--
components: +ctypes
versions: +Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22961
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22961] ctypes.WinError OSError

2014-11-27 Thread Simon Zack

New submission from Simon Zack:

The ctypes.WinError function returns:

OSError(None, descr, None, code)

However OSError does not appear to allow None as a first argument, and converts 
it to 22 which is the EINVAL Invalid Argument error. This is rather confusing 
as there was no invalid argument errors in the code.

I think the behaviour for one of WinError and OSError should be modified so 
that the handling of errno is more compatible.

--
messages: 231796
nosy: simonzack
priority: normal
severity: normal
status: open
title: ctypes.WinError  OSError

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22961
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com