[ python-Bugs-1171023 ] Thread.join() fails to release Lock on KeyboardInterrupt
Bugs item #1171023, was opened at 2005-03-26 06:40 Message generated for change (Comment added) made by marvinalone You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1171023&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Threads Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Peter Hansen (phansen) Assigned to: Nobody/Anonymous (nobody) Summary: Thread.join() fails to release Lock on KeyboardInterrupt Initial Comment: In threading.Thread.join(), the Condition/Lock object called self.__block is acquired upon entry, and released on exit without an enclosing try/finally to ensure that the release really occurs. If the join() call has no timeout, the wait() call that occurs inside can never be interrupted so there is no problem. If the join() call has a timeout, however, the wait() occurs in a loop which can be interrupted by a Ctrl-C, raising a KeyboardInterrupt which skips the self.__block.release() call and leaves the Lock acquired. This is a problem if the main thread (which is the only one that will see a KeyboardInterrupt) is the one calling join() and only if the other thread on which the join() is being called is a non-daemon thread or, in the case of a daemon thread, if the main thread subsequently attempts to wait for the other thread to terminate (for example, by monitoring isAlive() on the other thread). In any event, the lack of a try/finally means the joined thread will never really finish because any attempt by it to call its __stop() method will block forever. -- Comment By: Dirk Groeneveld (marvinalone) Date: 2005-07-22 00:08 Message: Logged In: YES user_id=146647 I submitted a (tested) patch for this, the id is 1240614, the link is http://www.python.org/sf/1240614. -- Comment By: Peter Hansen (phansen) Date: 2005-03-28 04:40 Message: Logged In: YES user_id=567267 I confirmed with Brett offline that this bug is indeed distinct from #1167930 and should be reopened. -- Comment By: Brett Cannon (bcannon) Date: 2005-03-27 16:46 Message: Logged In: YES user_id=357491 That was supposed to be bug #1167930, not this bug itself. =) -- Comment By: Brett Cannon (bcannon) Date: 2005-03-27 11:02 Message: Logged In: YES user_id=357491 Duplicate of bug #1171023. -- Comment By: Peter Hansen (phansen) Date: 2005-03-26 07:19 Message: Logged In: YES user_id=567267 A workaround (tested) is to subclass Thread and ensure that the lock is released. I'm not certain this is completely safe as written, but I'm assuming that you can safely attempt to release a lock that you don't own and the worst that can happen is you'll get an exception (which the workaround code catches and ignores). -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1171023&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1243192 ] Incorrect documentation of re.UNICODE
Bugs item #1243192, was opened at 2005-07-22 18:20 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1243192&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Documentation Group: Python 2.5 Status: Open Resolution: None Priority: 5 Submitted By: nhaldimann (nhaldimann) Assigned to: Nobody/Anonymous (nobody) Summary: Incorrect documentation of re.UNICODE Initial Comment: The effects of the re.UNICODE flag are incorrectly documented in the library reference. Currently it says (Section 4.2.3): U UNICODE Make \w, \W, \b, and \B dependent on the Unicode character properties database. New in version 2.0. But this flag in fact also affects \d, \D, \s, and \S at least since Python 2.1 (I have checked 2.1.3 on Linux, 2.2.3, 2.3.5 and 2.4 on OS X and the source of _sre.c makes this obvious). Proof: Python 2.4 (#1, Feb 13 2005, 18:29:12) [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> not re.match(r"\d", u"\u0966") True >>> re.match(r"\d", u"\u0966", re.UNICODE) <_sre.SRE_Match object at 0x36ee20> >>> not re.match(r"\s", u"\u2001") True >>> re.match(r"\s", u"\u2001", re.UNICODE) <_sre.SRE_Match object at 0x36ee20> \u0966 is some Indian digit, \u2001 is an em space. I propose to change the docs to: U UNICODE Make \w, \W, \b, \B, \d, \D, \s, and \S dependent on the Unicode character properties database. New in version 2.0. Maybe the documentation of \d, \D, \s, and \S in section 2.4.1 of the library reference should also be adapted. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1243192&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1243288 ] Misuse of "it's"
Bugs item #1243288, was opened at 2005-07-22 12:19 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1243288&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Documentation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Joanne Bogart (jrbogart) Assigned to: Nobody/Anonymous (nobody) Summary: Misuse of "it's" Initial Comment: In section 2.3.2 of the Python online reference manual (http://docs.python.org/ref/id-classes.html) the text These names are defined by the interpreter and it's implementation should read These names are defined by the interpreter and its implementation. General rule: if you can't replace "it's" by "it is" and preserve meaning, then "it's" is wrong. This is so trivial I hesitate to submit it. On the other hand, it's a shame that such generally excellent documentation should be marred by this kind of thing. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1243288&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1243288 ] Misuse of "it's"
Bugs item #1243288, was opened at 2005-07-22 21:19 Message generated for change (Comment added) made by birkenfeld You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1243288&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Documentation Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Joanne Bogart (jrbogart) >Assigned to: Reinhold Birkenfeld (birkenfeld) Summary: Misuse of "it's" Initial Comment: In section 2.3.2 of the Python online reference manual (http://docs.python.org/ref/id-classes.html) the text These names are defined by the interpreter and it's implementation should read These names are defined by the interpreter and its implementation. General rule: if you can't replace "it's" by "it is" and preserve meaning, then "it's" is wrong. This is so trivial I hesitate to submit it. On the other hand, it's a shame that such generally excellent documentation should be marred by this kind of thing. -- >Comment By: Reinhold Birkenfeld (birkenfeld) Date: 2005-07-22 21:48 Message: Logged In: YES user_id=1188172 This was already corrected in CVS HEAD. Committed to r24-maint as ref2.tex r1.56.2.2. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1243288&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com