[issue5261] with lock fails on multiprocessing
Jesse Noller jnol...@gmail.com added the comment: Reviewed, applied in python-trunk r70783 -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5261 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5261] with lock fails on multiprocessing
Changes by Jesse Noller jnol...@gmail.com: -- priority: - high ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5261 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5261] with lock fails on multiprocessing
Tim Golden m...@timgolden.me.uk added the comment: Can I nudge this one a bit? It causes an interpreter crash and the patch seems good (subject to someone else's review). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5261 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5261] with lock fails on multiprocessing
Jesse Noller jnol...@gmail.com added the comment: I will be addressing all of the MP bugs during the pycon sprints starting sunday -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5261 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5261] with lock fails on multiprocessing
Changes by Tim Golden m...@timgolden.me.uk: -- type: - crash ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5261 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5261] with lock fails on multiprocessing
New submission from Stephen Lynch stepheng.ly...@gmail.com: the following code gives a system error under python 2.6.1 import multiprocessing with multiprocessing.Lock(): pass SystemError: ..\Python\getargs.c:1413: bad argument to internal function -- components: Library (Lib) messages: 82106 nosy: stepheng.lynch severity: normal status: open title: with lock fails on multiprocessing versions: Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5261 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5261] with lock fails on multiprocessing
Changes by Benjamin Peterson benja...@python.org: -- assignee: - jnoller nosy: +jnoller ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5261 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5261] with lock fails on multiprocessing
Tim Golden m...@timgolden.me.uk added the comment: Problem seems to be in Modules/_multiprocessing/semaphore.c line 549 where __enter__ is defined as an alias for semlock_acquire, as is acquire a few lines above. However, while acquire specifies METH_VARARGS | METH_KEYWORDS, __enter__ has only METH_VARARGS. semlock_acquire at line 60 has the signature: SemLockObject *self, PyObject *args, PyObject *kwds When it is called via __enter__ kwds aren't passed in and it gets a NULL pointer. Suggested patch attached, defining __enter__ in the same way as acquire. Test included. -- keywords: +patch Added file: http://bugs.python.org/file13090/multiprocessing.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5261 ___Index: Lib/test/test_multiprocessing.py === --- Lib/test/test_multiprocessing.py(revision 69621) +++ Lib/test/test_multiprocessing.py(working copy) @@ -547,6 +547,10 @@ self.assertEqual(lock.release(), None) self.assertEqual(lock.release(), None) self.assertRaises((AssertionError, RuntimeError), lock.release) + +def test_lock_context(self): +with self.Lock(): +pass class _TestSemaphore(BaseTestCase): Index: Modules/_multiprocessing/semaphore.c === --- Modules/_multiprocessing/semaphore.c(revision 69621) +++ Modules/_multiprocessing/semaphore.c(working copy) @@ -546,7 +546,7 @@ acquire the semaphore/lock}, {release, (PyCFunction)semlock_release, METH_NOARGS, release the semaphore/lock}, - {__enter__, (PyCFunction)semlock_acquire, METH_VARARGS, + {__enter__, (PyCFunction)semlock_acquire, METH_VARARGS | METH_KEYWORDS, enter the semaphore/lock}, {__exit__, (PyCFunction)semlock_release, METH_VARARGS, exit the semaphore/lock}, ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com