Issue1667
Created on 2010-10-22.03:12:42 by kellyc2702, last changed 2011-01-21.01:19:40 by pjenvey.
msg6197 (view) |
Author: Kelly Campbell (kellyc2702) |
Date: 2010-10-22.03:12:40 |
|
Attached test case passes on python, fails with exception on jython 2.5.2rc1:
Exception in thread Thread:Traceback (most recent call last):
File "/opt/jython/jython2.5.2rc1/Lib/threading.py", line 179, in _Thread__bootstrap
self.run()
File "thread_local_test.py", line 16, in run
self.stuff.stuff = self.name
TypeError: __init__() takes at least 2 arguments (1 given)
It doesn't have the exception if you remove the call to local.__init__(self) on line 5. So the args within PyLocal are getting reset to empty during that call.
|
msg6198 (view) |
Author: Kelly Campbell (kellyc2702) |
Date: 2010-10-22.16:26:35 |
|
Here's a patch. This patch also removes the unnecessary synchronization.
|
msg6199 (view) |
Author: Kelly Campbell (kellyc2702) |
Date: 2010-10-22.16:27:26 |
|
And here's an improved test case.
|
msg6200 (view) |
Author: Kelly Campbell (kellyc2702) |
Date: 2010-10-22.16:43:40 |
|
Sorry, found an issue. Ignore the patch. The test case wasn't complete enough and I didn't fully understand how python thread locals differ from java's. New test case which fails with my patch attached.
|
msg6201 (view) |
Author: Kelly Campbell (kellyc2702) |
Date: 2010-10-22.19:52:15 |
|
I think this new patch handles the issue correctly now.
|
msg6312 (view) |
Author: Kelly Campbell (kellyc2702) |
Date: 2011-01-05.20:01:43 |
|
ping? this is a simple bug with test case and patch.
|
msg6328 (view) |
Author: Oti Humbel (otmarhumbel) |
Date: 2011-01-20.21:45:54 |
|
1667-patch.txt contains Kelly's fix and test (transformed into a unit test)
|
msg6330 (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2011-01-21.01:19:39 |
|
I committed a different fix for this in r7186
the orig. patch still caused this.keywords to be overwritten with bad values. oddly enough that didn't break the tests but I think it could have broken something at some point
Instead I moved the __init__ code into __new__ which is what CPython does
|
|
Date |
User |
Action |
Args |
2011-01-21 01:19:40 | pjenvey | set | status: open -> closed nosy:
+ pjenvey, zyasoft resolution: fixed messages:
+ msg6330 |
2011-01-20 21:45:55 | otmarhumbel | set | files:
+ 1667-patch.txt nosy:
+ otmarhumbel messages:
+ msg6328 |
2011-01-05 20:01:43 | kellyc2702 | set | messages:
+ msg6312 |
2010-10-22 19:52:16 | kellyc2702 | set | files:
+ issue1667.patch messages:
+ msg6201 |
2010-10-22 16:43:40 | kellyc2702 | set | files:
+ thread_local_test.py messages:
+ msg6200 |
2010-10-22 16:27:26 | kellyc2702 | set | files:
+ thread_local_test.py messages:
+ msg6199 |
2010-10-22 16:26:36 | kellyc2702 | set | files:
+ issue1667.patch keywords:
+ patch messages:
+ msg6198 |
2010-10-22 03:12:42 | kellyc2702 | create | |
|