[issue19615] ImportError: dynamic module does not define init function when deleting and recreating .so files from different machines over NFS

2013-11-15 Thread Edward Catmur
New submission from Edward Catmur: foo.c: #include Python.h static PyMethodDef mth[] = { {NULL, NULL, 0, NULL} }; static struct PyModuleDef mod = { PyModuleDef_HEAD_INIT, foo, NULL, -1, mth }; PyMODINIT_FUNC PyInit_foo(void) { return PyModule_Create(mod); } bar.c: #include Python.h static

[issue19615] ImportError: dynamic module does not define init function when deleting and recreating .so files from different machines over NFS

2013-11-15 Thread Edward Catmur
Edward Catmur added the comment: Report dlerror() if dlsym() fails. The error output is now something like: ImportError: /.../foo.cpython-34dm.so: undefined symbol: PyInit_bar -- keywords: +patch Added file: http://bugs.python.org/file32643/dynload_report_dlerror.patch

[issue19096] multiprocessing.Pool._terminate_pool restarts workers during shutdown

2013-09-26 Thread Edward Catmur
New submission from Edward Catmur: There is a race condition in multiprocessing.Pool._terminate_pool that can result in workers being restarted during shutdown (process shutdown or pool.terminate()). worker_handler._state = TERMINATE# race from here task_handler

[issue19096] multiprocessing.Pool._terminate_pool restarts workers during shutdown

2013-09-26 Thread Edward Catmur
Edward Catmur added the comment: Suggested patch: https://bitbucket.org/ecatmur/cpython/compare/19096-multiprocessing-race..#diff Move the worker_handler.join() to immediately after setting the worker handler thread state to TERMINATE. This is a safe change as nothing in the moved-over code

[issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering

2013-06-19 Thread Edward Catmur
Edward Catmur added the comment: Ɓukasz, thanks. When the most-derived class virtual-inherits two related ABCs U, V: object / | \ A W V | .` .` B` U` | .` C` The secondary `for` loop is necessary to ensure U and V are ordered correctly

[issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering

2013-06-17 Thread Edward Catmur
New submission from Edward Catmur: Suppose we have a class C with MRO (C, B, A, object). C virtual-inherits an ABC V, while B virtual-inherits an unrelated ABC W: object / | \ A W | | .` / B` V | .` C` Recalling that per PEP 443

[issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering

2013-06-17 Thread Edward Catmur
Edward Catmur added the comment: Apologies, the linked repository is for the 2.x backport of singledispatch. I'll replace it with a proper Python repo. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18244

[issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering

2013-06-17 Thread Edward Catmur
Changes by Edward Catmur e...@catmur.co.uk: -- keywords: +patch Added file: http://bugs.python.org/file30623/singledispatch-mro-18244.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18244

[issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering

2013-06-17 Thread Edward Catmur
Changes by Edward Catmur e...@catmur.co.uk: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18244 ___ ___ Python-bugs-list

[issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering

2013-06-17 Thread Edward Catmur
Edward Catmur added the comment: See attachment for patch and test. Note that reproducing the issue without access to singledispatch internals depends on iteration order of a dict of types and is thus intermittent/environment dependent