This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients ZackerySpytz, alexandre.vassalotti, amaury.forgeotdarc, belopolsky, eryksun, lukasz.langa, pitrou, ygingras
Date 2019-07-31.18:33:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1564598022.81.0.780149341957.issue2920@roundup.psfhosted.org>
In-reply-to
Content
How about doing something similar for Windows when winerror is set? This is a common case since many os functions use the Windows API directly. Showing the symbolic error name will help to disambiguate exceptions, such as 

    FileNotFoundError (ENOENT) from:

        ERROR_FILE_NOT_FOUND
        ERROR_PATH_NOT_FOUND
        ERROR_FILENAME_EXCED_RANGE
        ERROR_BAD_PATHNAME
        ERROR_BAD_NET_NAME

    PermissionError (EACCES) from:

        ERROR_ACCESS_DENIED
        ERROR_SHARING_VIOLATION
        ERROR_LOCK_VIOLATION
        ERROR_NETWORK_ACCESS_DENIED
        ERROR_NOT_READY

It could also support additional error codes that are common or used internally, such as 

    ERROR_NOT_SUPPORTED
    ERROR_INVALID_NAME
    ERROR_MOD_NOT_FOUND
    ERROR_PRIVILEGE_NOT_HELD
    ERROR_CANT_RESOLVE_FILENAME
    ERROR_INVALID_REPARSE_DATA

Modules/_winapi.c:

    ERROR_NETNAME_DELETED
    ERROR_SEM_TIMEOUT
    ERROR_PIPE_BUSY
    ERROR_MORE_DATA
    ERROR_PIPE_CONNECTED
    ERROR_OPERATION_ABORTED
    ERROR_IO_PENDING
    ERROR_NO_SYSTEM_RESOURCES
History
Date User Action Args
2019-07-31 18:33:42eryksunsetrecipients: + eryksun, amaury.forgeotdarc, belopolsky, pitrou, alexandre.vassalotti, ygingras, lukasz.langa, ZackerySpytz
2019-07-31 18:33:42eryksunsetmessageid: <1564598022.81.0.780149341957.issue2920@roundup.psfhosted.org>
2019-07-31 18:33:42eryksunlinkissue2920 messages
2019-07-31 18:33:42eryksuncreate