Bugs item #1083177, was opened at 2004-12-10 15:58 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1083177&group_id=5470
Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Gary H. Loechelt (loechelt) >Assigned to: A.M. Kuchling (akuchling) Summary: Change in signal function in the signal module Initial Comment: The signal function of the signal module handles arguments differently in Python 2.4 than in Python 2.3. I am running on an HP-UX 11 workstation. If I set a handler for a signal that cannot be trapped, like KILL (signal 9), the signal function accepts the argument in Python 2.3 but ignores the operation. However, if I do the same thing in Python 2.4, the signal function rejects the argument and raises a RuntimeError. I am not sure if this change in behavior is intentional or not. It makes sense in one way to complain about an invalid argument (as in Python 2.4) rather than just ignore the operation (as in Python 2.3). However, I did not find this change in either the documentation or the release notes, and it caught me by surprise. Granted, the stricter argument checking probably caught a sloppy line of coding. Still, some kind of user warning would have been nice if this was an intentional change. I am enclosing a simple Python script which illustrates the problem. It finishes normally when using Python 2.3 and raises a RuntimeError when using Python 2.4: Traceback (most recent call last): File "set_signals.py", line 7, in ? signal.signal(signal.SIGKILL, dummy) RuntimeError: (22, 'Invalid argument') Gary H. Loechelt ---------------------------------------------------------------------- Comment By: Anthony Baxter (anthonybaxter) Date: 2004-12-13 08:16 Message: Logged In: YES user_id=29957 This is a deliberate change - "errors should not pass silently". I agree that it should get better visibility. Perhaps an entry in amk's what's new document in the section on Porting to 2.4 <http://www.python.org/doc/2.4/whatsnew/node15.html> would be appropriate. AMK? (I've added a comment to the document as a reminder) ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-12-10 22:32 Message: Logged In: YES user_id=80475 On WinME, I appropriately get an AttributeError consistently for Py2.2, Py2.3, and Py2.4. Anthony, you've made the most recent updates to the signalmodule. What do you think? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1083177&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com