[issue5261] with lock fails on multiprocessing
Tim Golden
report at bugs.python.org
Sat Feb 14 21:52:35 CET 2009
Tim Golden <mail at 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 <report at bugs.python.org>
<http://bugs.python.org/issue5261>
_______________________________________
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: multiprocessing.patch
URL: <http://mail.python.org/pipermail/python-bugs-list/attachments/20090214/161e6627/attachment.txt>
More information about the Python-bugs-list
mailing list