This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年08月31日 09:55 by mikehoy, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| 15829-thread-errror3.3.diff | mikehoy, 2012年08月31日 12:22 | review | ||
| 15829-thread-errror2.7.diff | mikehoy, 2012年08月31日 12:23 | review | ||
| Messages (12) | |||
|---|---|---|---|
| msg169513 - (view) | Author: Mike Hoy (mikehoy) * | Date: 2012年08月31日 09:55 | |
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 |
|||
| msg169514 - (view) | Author: Mike Hoy (mikehoy) * | Date: 2012年08月31日 09:56 | |
Working on a patch now unless there are objections to the OP. |
|||
| msg169516 - (view) | Author: Andrew Svetlov (asvetlov) * (Python committer) | Date: 2012年08月31日 10:22 | |
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. |
|||
| msg169517 - (view) | Author: Mike Hoy (mikehoy) * | Date: 2012年08月31日 10:27 | |
>>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. |
|||
| msg169519 - (view) | Author: Andrew Svetlov (asvetlov) * (Python committer) | Date: 2012年08月31日 10:38 | |
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. |
|||
| msg169524 - (view) | Author: Mike Hoy (mikehoy) * | Date: 2012年08月31日 11:36 | |
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 |
|||
| msg169525 - (view) | Author: Andrew Svetlov (asvetlov) * (Python committer) | Date: 2012年08月31日 11:39 | |
Sounds good. |
|||
| msg169526 - (view) | Author: Mike Hoy (mikehoy) * | Date: 2012年08月31日 12:22 | |
3.3 patch |
|||
| msg169527 - (view) | Author: Mike Hoy (mikehoy) * | Date: 2012年08月31日 12:23 | |
2.7 patch. |
|||
| msg169532 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年08月31日 13:07 | |
Please see Issue 14502. The docs probably do need clarification, but it must be done carefully. |
|||
| msg199670 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2013年10月13日 08:23 | |
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 |
|||
| msg199671 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2013年10月13日 08:23 | |
3.3 didn't need to be updated; it's RuntimeError there everywhere. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:35 | admin | set | github: 60033 |
| 2013年10月13日 08:23:54 | georg.brandl | set | nosy:
+ georg.brandl messages: + msg199671 |
| 2013年10月13日 08:23:06 | python-dev | set | status: open -> closed nosy: + python-dev messages: + msg199670 resolution: fixed stage: resolved |
| 2012年08月31日 13:07:09 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg169532 |
| 2012年08月31日 12:23:11 | mikehoy | set | files:
+ 15829-thread-errror2.7.diff messages: + msg169527 |
| 2012年08月31日 12:22:25 | mikehoy | set | files:
+ 15829-thread-errror3.3.diff keywords: + patch messages: + msg169526 |
| 2012年08月31日 11:39:51 | asvetlov | set | messages: + msg169525 |
| 2012年08月31日 11:36:20 | mikehoy | set | messages: + msg169524 |
| 2012年08月31日 10:38:47 | asvetlov | set | messages: + msg169519 |
| 2012年08月31日 10:32:49 | asvetlov | set | messages: - msg169518 |
| 2012年08月31日 10:27:21 | mikehoy | set | messages: + msg169518 |
| 2012年08月31日 10:27:19 | mikehoy | set | type: enhancement -> messages: + msg169517 |
| 2012年08月31日 10:22:40 | asvetlov | set | nosy:
+ asvetlov messages: + msg169516 components: + Library (Lib) type: enhancement |
| 2012年08月31日 09:56:26 | mikehoy | set | nosy:
+ docs@python messages: + msg169514 |
| 2012年08月31日 09:55:34 | mikehoy | create | |