[issue15829] Threading Lock - Wrong Exception Name
Roundup Robot added the comment: New changeset d7e9c0a6dbcf by Georg Brandl in branch '2.7': Closes #15829: document ThreadError and fix exception raised for releasing unlocked locks. http://hg.python.org/cpython/rev/d7e9c0a6dbcf -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15829 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15829] Threading Lock - Wrong Exception Name
Georg Brandl added the comment: 3.3 didn't need to be updated; it's RuntimeError there everywhere. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15829 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15829] Threading Lock - Wrong Exception Name
New submission from Mike Hoy: From the Docs mailing list: Hi I found a bug in python docs which can be accessed at links: http://docs.python.org/library/threading.html#lock-objects http://docs.python.org/py3k/library/threading.html#lock-objects Bug is in second paragraph describing threading.Lock. I found that statement: If an attempt is made to release an unlocked lock, a RuntimeError will be raised. Which is not true, name of exception is wrong it should be (and it relay is) ThreadError (from threading module) Could someone fix it? -- Br, Slawomir Kuszczynski -- messages: 169513 nosy: mikehoy priority: normal severity: normal status: open title: Threading Lock - Wrong Exception Name versions: Python 2.7, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15829 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15829] Threading Lock - Wrong Exception Name
Mike Hoy added the comment: Working on a patch now unless there are objections to the OP. -- nosy: +docs@python ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15829 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15829] Threading Lock - Wrong Exception Name
Andrew Svetlov added the comment: The problem is: threading.Lock raises ThreadingError (which is subclass of RuntimeError for 3.3 but not for 3.2), but threading.Condition raises RuntimeError for the same reason. RLock behavior is even worse: it raises ThreadingError if C accelerator is available in _thread and RuntimeError otherwise. I think RuntimeError should be replaced by ThreadingError for _RLock and Condition implementations as well as docs need to be updated. Also I think this patch should be applied to 3.4 only, it is enchacement, not bugfix. About fixing docs for 2.7-3.3: I see nothing wrong if current inconsistency will be documented, perhaps as *warning* or *note* block. -- components: +Library (Lib) nosy: +asvetlov type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15829 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15829] Threading Lock - Wrong Exception Name
Mike Hoy added the comment: I think RuntimeError should be replaced by ThreadingError for _RLock and Condition implementations as well as docs need to be updated. Also I think this patch should be applied to 3.4 only, it is enchacement, not bugfix. About fixing docs for 2.7-3.3: I see nothing wrong if current inconsistency will be documented, perhaps as *warning* or *note* block. I should warn that ThreadError or `ThreadError` has no link. I've tried to find a place in the docs I could link to but haven't yet. `ValueError` does have a link. -- type: enhancement - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15829 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15829] Threading Lock - Wrong Exception Name
Mike Hoy added the comment: I think RuntimeError should be replaced by ThreadingError for _RLock and Condition implementations as well as docs need to be updated. Also I think this patch should be applied to 3.4 only, it is enchacement, not bugfix. About fixing docs for 2.7-3.3: I see nothing wrong if current inconsistency will be documented, perhaps as *warning* or *note* block. I should warn that ThreadError or `ThreadError` has no link. I've tried to find a place in the docs I could link to but haven't yet. `ValueError` does have a link. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15829 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15829] Threading Lock - Wrong Exception Name
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- Removed message: http://bugs.python.org/msg169518 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15829 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15829] Threading Lock - Wrong Exception Name
Andrew Svetlov added the comment: ValueError can be referenced by :exc:`ValueError`. For ThreadError you can add section for describing this exception type like: .. exception:: ThreadError Raised when lock object cannot be acquired or released. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15829 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15829] Threading Lock - Wrong Exception Name
Mike Hoy added the comment: I discussed this in IRC and got the following information from Ezio: Taggnostr the doc fix can go in 2.7/3.3, the code fix in 3.4 Plan is to put the definition for ThreadError in threading.rst for both 2.7 and 3.3 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15829 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15829] Threading Lock - Wrong Exception Name
Andrew Svetlov added the comment: Sounds good. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15829 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15829] Threading Lock - Wrong Exception Name
Mike Hoy added the comment: 3.3 patch -- keywords: +patch Added file: http://bugs.python.org/file27071/15829-thread-errror3.3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15829 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15829] Threading Lock - Wrong Exception Name
Mike Hoy added the comment: 2.7 patch. -- Added file: http://bugs.python.org/file27072/15829-thread-errror2.7.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15829 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15829] Threading Lock - Wrong Exception Name
R. David Murray added the comment: Please see Issue 14502. The docs probably do need clarification, but it must be done carefully. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15829 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com