From 5c1190bada8fdff2200f0aeae2773ec141ce6aa5 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 15 Jul 2011 19:09:49 +0200 Subject: [PATCH 1/3] Remove duplicate "numbered" options for toctrees. --- Doc/distutils/index.rst | 1 - Doc/library/packaging.rst | 3 --- 2 files changed, 4 deletions(-) diff --git a/Doc/distutils/index.rst b/Doc/distutils/index.rst index b3a52317699..c8dd9f46a8c 100644 --- a/Doc/distutils/index.rst +++ b/Doc/distutils/index.rst @@ -20,7 +20,6 @@ very little overhead for build/release/install mechanics. .. toctree:: :maxdepth: 2 - :numbered: introduction.rst setupscript.rst diff --git a/Doc/library/packaging.rst b/Doc/library/packaging.rst index 5bf2c06ad9d..c6bff47015e 100644 --- a/Doc/library/packaging.rst +++ b/Doc/library/packaging.rst @@ -23,7 +23,6 @@ Building blocks .. toctree:: :maxdepth: 2 - :numbered: packaging-misc packaging.version @@ -42,7 +41,6 @@ The command machinery .. toctree:: :maxdepth: 2 - :numbered: packaging.dist packaging.command @@ -55,7 +53,6 @@ Other utilities .. toctree:: :maxdepth: 2 - :numbered: packaging.util packaging.tests.pypi_server From 9470ab43a9804928275b0a2a0860a2028af854db Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Fri, 15 Jul 2011 20:25:20 +0200 Subject: [PATCH 2/3] Make sure to reap worker threads and processes at the end of test_concurrent_futures --- Lib/test/test_concurrent_futures.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Lib/test/test_concurrent_futures.py b/Lib/test/test_concurrent_futures.py index 2662af76cff..6cc57f85d0b 100644 --- a/Lib/test/test_concurrent_futures.py +++ b/Lib/test/test_concurrent_futures.py @@ -598,16 +598,20 @@ class FutureTests(unittest.TestCase): self.assertTrue(isinstance(f1.exception(timeout=5), IOError)) +@test.support.reap_threads def test_main(): - test.support.run_unittest(ProcessPoolExecutorTest, - ThreadPoolExecutorTest, - ProcessPoolWaitTests, - ThreadPoolWaitTests, - ProcessPoolAsCompletedTests, - ThreadPoolAsCompletedTests, - FutureTests, - ProcessPoolShutdownTest, - ThreadPoolShutdownTest) + try: + test.support.run_unittest(ProcessPoolExecutorTest, + ThreadPoolExecutorTest, + ProcessPoolWaitTests, + ThreadPoolWaitTests, + ProcessPoolAsCompletedTests, + ThreadPoolAsCompletedTests, + FutureTests, + ProcessPoolShutdownTest, + ThreadPoolShutdownTest) + finally: + test.support.reap_children() if __name__ == "__main__": test_main() From 8391cf4e1d73683795e51ac5ce8ee9e61eea389d Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Fri, 15 Jul 2011 21:01:21 +0200 Subject: [PATCH 3/3] =?UTF-8?q?Issue=20#11321:=20Fix=20a=20crash=20with=20?= =?UTF-8?q?multiple=20imports=20of=20the=20=5Fpickle=20module=20when=20emb?= =?UTF-8?q?edding=20Python.=20=20Patch=20by=20Andreas=20St=C3=BChrk.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Misc/NEWS | 3 +++ Modules/_pickle.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/Misc/NEWS b/Misc/NEWS index 18ee9d30b2f..21543937760 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -27,6 +27,9 @@ Core and Builtins Library ------- +- Issue #11321: Fix a crash with multiple imports of the _pickle module when + embedding Python. Patch by Andreas Stührk. + - Issue #12502: asyncore: fix polling loop with AF_UNIX sockets. - Issue #4376: ctypes now supports nested structures in a endian different than diff --git a/Modules/_pickle.c b/Modules/_pickle.c index e13d8742ca1..287f0a3c15a 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -6321,8 +6321,10 @@ PyInit__pickle(void) if (m == NULL) return NULL; + Py_INCREF(&Pickler_Type); if (PyModule_AddObject(m, "Pickler", (PyObject *)&Pickler_Type) < 0) return NULL; + Py_INCREF(&Unpickler_Type); if (PyModule_AddObject(m, "Unpickler", (PyObject *)&Unpickler_Type) < 0) return NULL;