[issue12011] The signal module should raise OSError for OS-related exceptions, not RuntimeError

2011-05-10 Thread Antoine Pitrou

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

 Patch: signal.signal() and signal.siginterrupt() raise an OSError,
 instead of a RuntimeError: OSError has an errno attribute.
 
 --
 keywords: +patch
 Added file: http://bugs.python.org/file21939/signal_oserror.patch

Looks good to me.

--

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



[issue12011] The signal module should raise OSError for OS-related exceptions, not RuntimeError

2011-05-10 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset b86b39211ef1 by Victor Stinner in branch 'default':
Issue #12011: signal.signal() and signal.siginterrupt() raise an OSError,
http://hg.python.org/cpython/rev/b86b39211ef1

--
nosy: +python-dev

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



[issue12011] The signal module should raise OSError for OS-related exceptions, not RuntimeError

2011-05-10 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
resolution:  - fixed
status: open - closed

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



[issue12011] The signal module should raise OSError for OS-related exceptions, not RuntimeError

2011-05-08 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Patch: signal.signal() and signal.siginterrupt() raise an OSError, instead of a 
RuntimeError: OSError has an errno attribute.

--
keywords: +patch
Added file: http://bugs.python.org/file21939/signal_oserror.patch

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



[issue12011] The signal module should raise OSError for OS-related exceptions, not RuntimeError

2011-05-05 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

Treating RuntimeError as if it could take an errno is no good:

 try: signal.siginterrupt(32, 12345)
... except RuntimeError as e: print(e.errno)
... 
Traceback (most recent call last):
  File stdin, line 1, in module
RuntimeError: (22, 'Invalid argument')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File stdin, line 2, in module
AttributeError: 'RuntimeError' object has no attribute 'errno'


Changing it breaks compatibility a bit but I think it's worth it.

--
components: Library (Lib)
messages: 135243
nosy: haypo, ncoghlan, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: The signal module should raise OSError for OS-related exceptions, not 
RuntimeError
type: behavior
versions: Python 3.3

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



[issue12011] The signal module should raise OSError for OS-related exceptions, not RuntimeError

2011-05-05 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

I asked if I should use RuntimeError or OSError for the new signal functions 
(#8407) on python-dev. Georg Brandl answered:

If it has an errno, it should be a subclass of EnvironmentError.

--

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



[issue12011] The signal module should raise OSError for OS-related exceptions, not RuntimeError

2011-05-05 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
nosy: +georg.brandl

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