[issue2920] Patch to print symbolic value of errno in OSError.__str__()

2021-03-22 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10 -Python 3.9

___
Python tracker 

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



[issue2920] Patch to print symbolic value of errno in OSError.__str__()

2019-08-06 Thread Zackery Spytz


Zackery Spytz  added the comment:

Eryk, I'm not sure if something similar should be done for winerror. I think 
it's best to keep OSError_str() as simple as possible.

--

___
Python tracker 

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



[issue2920] Patch to print symbolic value of errno in OSError.__str__()

2019-07-31 Thread Eryk Sun


Eryk Sun  added the comment:

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

--
nosy: +ZackerySpytz, eryksun

___
Python tracker 

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



[issue2920] Patch to print symbolic value of errno in OSError.__str__()

2019-07-28 Thread Zackery Spytz


Change by Zackery Spytz :


--
title: Patch to print symbolic value or errno in EnvironmentError.__str__() -> 
Patch to print symbolic value of errno in OSError.__str__()
versions: +Python 3.9 -Python 3.3

___
Python tracker 

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