classification
Title: A few errnos from OSX
Type: enhancement Stage: resolved
Components: Library (Lib), Macintosh Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ronaldoussoren Nosy List: ned.deily, pcarrier, python-dev, ronaldoussoren
Priority: normal Keywords:

Created on 2011-04-24 21:57 by pcarrier, last changed 2011-05-07 07:59 by python-dev. This issue is now closed.

Messages (4)
msg134351 - (view) Author: Pierre Carrier (pcarrier) Date: 2011-04-24 21:57
A few errnos from OSX are missing in the eponymous module.

--- 8< ---
#ifdef EAUTH
    inscode(d, ds, de, "EAUTH", EAUTH, "Authentication error");
#endif
#ifdef EBADARCH
    inscode(d, ds, de, "EBADARCH", EBADARCH, "Bad CPU type in executable");
#endif
#ifdef EBADEXEC
    inscode(d, ds, de, "EBADEXEC", EBADEXEC, "Bad executable (or shared library)");
#endif
#ifdef EBADMACHO
    inscode(d, ds, de, "EBADMACHO", EBADMACHO, "Malformed Mach-o file");
#endif
#ifdef EBADRPC
    inscode(d, ds, de, "EBADRPC", EBADRPC, "RPC struct is bad");
#endif
#ifdef ECANCELED
    inscode(d, ds, de, "ECANCELED", ECANCELED, "Operation canceled");
#endif
#ifdef EDEVERR
    inscode(d, ds, de, "EDEVERR", EDEVERR, "Device error");
#endif
#ifdef EFTYPE
    inscode(d, ds, de, "EFTYPE", EFTYPE, "Inappropriate file type or format");
#endif
#ifdef ENEEDAUTH
    inscode(d, ds, de, "ENEEDAUTH", ENEEDAUTH, "Need authenticator");
#endif
#ifdef ENOATTR
    inscode(d, ds, de, "ENOATTR", ENOATTR, "Attribute not found");
#endif
#ifdef ENOPOLICY
    inscode(d, ds, de, "ENOPOLICY", ENOPOLICY, "Policy not found");
#endif
#ifdef ENOTSUP
    inscode(d, ds, de, "ENOTSUP", ENOTSUP, "Operation not supported");
#endif
#ifdef EPROCLIM
    inscode(d, ds, de, "EPROCLIM", EPROCLIM, "Too many processes");
#endif
#ifdef EPROCUNAVAIL
    inscode(d, ds, de, "EPROCUNAVAIL", EPROCUNAVAIL, "Bad procedure for program");
#endif
#ifdef EPROGMISMATCH
    inscode(d, ds, de, "EPROGMISMATCH", EPROGMISMATCH, "Program version wrong");
#endif
#ifdef EPROGUNAVAIL
    inscode(d, ds, de, "EPROGUNAVAIL", EPROGUNAVAIL, "RPC prog. not avail");
#endif
#ifdef EPWROFF
    inscode(d, ds, de, "EPWROFF", EPWROFF, "Device power is off");
#endif
#ifdef ERPCMISMATCH
    inscode(d, ds, de, "ERPCMISMATCH", ERPCMISMATCH, "RPC version wrong");
#endif
#ifdef ESHLIBVERS
    inscode(d, ds, de, "ESHLIBVERS", ESHLIBVERS, "Shared library version mismatch");
#endif
--- >8 ---

(PS: catched by scripting around https://github.com/pcarrier/stuff/blob/master/sys/errnos.c if someone wants to play with other "exotic" architectures)
msg135408 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2011-05-07 07:37
This shell-fragment lists which names in /usr/include/sys/errno don't exist in errnomodule.h:

$ grep '#define[      ]*E' /usr/include/sys/errno.h  | 
    awk '{ print $2 }' | grep -v '^ELAST$' | 
    while read name; do 
        grep -q $name Modules/errnomodule.c || echo $name; 
    done | sort

The following names in your list are already part in errnomodule.h:

* ECANCELED
* ENOTSUP

The patch looks fine otherwise. I'm currently rebuilding python3.3 and will commit the patch if everything works properly.
msg135409 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2011-05-07 07:41
And the patch works properly, with the patch applied (except for the two names I mentioned earlier):


$ DYLD_FRAMEWORK_PATH=$PWD ./python.exe
Python 3.3a0 (default:5fa92a47016c+, May  7 2011, 09:36:44) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import errno
>>> errno.EAUTH
80
>>> errno.ECANCELED
89
>>> errno.ENOTSUP
45
>>> errno.EPROGMISMATCH
75
>>>
msg135412 - (view) Author: Roundup Robot (python-dev) Date: 2011-05-07 07:59
New changeset 2f978b4c02ad by Ronald Oussoren in branch 'default':
Closes Issue 11916: Add a number of MacOSX specific definitions to the errno module.
http://hg.python.org/cpython/rev/2f978b4c02ad
History
Date User Action Args
2011-05-07 07:59:12python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg135412

resolution: fixed
stage: patch review -> resolved
2011-05-07 07:41:01ronaldoussorensetmessages: + msg135409
2011-05-07 07:37:18ronaldoussorensetmessages: + msg135408
2011-04-24 23:49:59pitrousetversions: - Python 3.4
nosy: + ronaldoussoren, ned.deily

assignee: ronaldoussoren
components: + Library (Lib), Macintosh, - Extension Modules
stage: patch review
2011-04-24 22:43:04loewissetversions: - Python 2.6, Python 2.5, Python 3.1, Python 2.7, Python 3.2
2011-04-24 21:57:53pcarriercreate