[issue2920] Patch to print symbolic value or errno in EnvironmentError.__str__()

2019-07-27 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +14755
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/14988

___
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 or errno in EnvironmentError.__str__()

2012-05-16 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

This would still be a helpful improvement.

--
stage: patch review - needs patch
versions: +Python 3.3 -Python 3.2

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



[issue2920] Patch to print symbolic value or errno in EnvironmentError.__str__()

2010-08-08 Thread Łukasz Langa

Łukasz Langa luk...@langa.pl added the comment:

Alexander is right that this should be considered as part of PEP 3151. Plus, 
changes to interpreter core are subject to the moratorium.

I am -1 on this. I would propose to create a superseding issue for implementing 
PEP 3151 and gathering dependant issues like this one. For a similar case see 
#2651.

--
nosy: +lukasz.langa

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



[issue2920] Patch to print symbolic value or errno in EnvironmentError.__str__()

2010-08-08 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

PEP 3151 is already large enough and I don't want to add orthogonal changes to 
it. Furthermore, this change is only about the string representation of 
exceptions, and may be accepted for 3.2 even despite the moratorium.

--

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



[issue2920] Patch to print symbolic value or errno in EnvironmentError.__str__()

2010-08-07 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
versions:  -Python 2.6, Python 2.7, Python 3.1

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



[issue2920] Patch to print symbolic value or errno in EnvironmentError.__str__()

2010-07-22 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

This looks like something that can become part of PEP 3151.

--
assignee: belopolsky - 
nosy:  -Alexander.Belopolsky
stage:  - patch review

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



[issue2920] Patch to print symbolic value or errno in EnvironmentError.__str__()

2010-05-28 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

I don't like the import errno while printing an exception...
It would be much more robust to store errorcode_dict in a static variable when 
python starts, and reuse it directly.

--
nosy: +amaury.forgeotdarc

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



[issue2920] Patch to print symbolic value or errno in EnvironmentError.__str__()

2010-05-28 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Agreed with Amaury. Module import could fail for various reasons (perhaps the 
same ones which led to the exception being raised!), or could deadlock if the 
import lock is being held. Also, having __str__ fail is usually very annoying 
for users (especially when it's the __str__ of an exception object).

If it's too hard to import errno at startup (because of bootstrapping), I would 
suggest using PyImport_ImportModuleNoBlock() instead, and silence errors (just 
print the numeric value of errno instead).

--
nosy: +pitrou
versions: +Python 2.7, Python 3.1, Python 3.2

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



[issue2920] Patch to print symbolic value or errno in EnvironmentError.__str__()

2010-05-28 Thread Alexander Belopolsky

Alexander Belopolsky alexander.belopol...@gmail.com added the comment:

The patch already checks for failed import and falls back to printing  
numerical error code. However, I don't like the import either. I will  
think about the alternatives.

On May 28, 2010, at 8:27 AM, Antoine Pitrou rep...@bugs.python.org  
wrote:


 Antoine Pitrou pit...@free.fr added the comment:

 Agreed with Amaury. Module import could fail for various reasons  
 (perhaps the same ones which led to the exception being raised!), or  
 could deadlock if the import lock is being held. Also, having  
 __str__ fail is usually very annoying for users (especially when  
 it's the __str__ of an exception object).

 If it's too hard to import errno at startup (because of  
 bootstrapping), I would suggest using PyImport_ImportModuleNoBlock()  
 instead, and silence errors (just print the numeric value of errno  
 instead).

 --
 nosy: +pitrou
 versions: +Python 2.7, Python 3.1, Python 3.2

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue2920
 ___

--
nosy: +Alexander.Belopolsky

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



[issue2920] Patch to print symbolic value or errno in EnvironmentError.__str__()

2010-05-27 Thread Alexander Belopolsky

Changes by Alexander Belopolsky belopol...@users.sourceforge.net:


--
assignee:  - belopolsky
nosy: +belopolsky

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



[issue2920] Patch to print symbolic value or errno in EnvironmentError.__str__()

2008-05-19 Thread Yannick Gingras

New submission from Yannick Gingras [EMAIL PROTECTED]:

EnvironmentError and its subclass OSError add the value of errno in 
their error message.  This value is an integer but the specific value 
in an implementation detail and the C runtime recommends that 
programmers use the symbolic values instead.  Ex: one should use 
ENODATA instead of 61.  For the same reason, the Python interpreter 
should try to return the symbolic value or errno when possible.

The attached patch replaces errno in EnvironmentError.__str__() by its 
symbolic value when possible.

--
components: Interpreter Core
files: python-26-sympolic-errno.diff
keywords: patch
messages: 67074
nosy: ygingras
severity: normal
status: open
title: Patch to print symbolic value or errno in EnvironmentError.__str__()
versions: Python 2.6
Added file: http://bugs.python.org/file10377/python-26-sympolic-errno.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2920
__
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2920] Patch to print symbolic value or errno in EnvironmentError.__str__()

2008-05-19 Thread Alexandre Vassalotti

Alexandre Vassalotti [EMAIL PROTECTED] added the comment:

Overall, the patch looks good. I made a couple of fixes to make the
changes more robust.

--
nosy: +alexandre.vassalotti
priority:  - normal
type:  - feature request
Added file: http://bugs.python.org/file10378/symbolic-errno.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2920
__
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com