You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows/amd64, I get loads of pickling errors in test_multiprocessing.
Type 1 error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\stefan\svn\trunk\lib\multiprocessing\forking.py", line 347, in mainself= load(from_parent)
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 1378, in loadreturn Unpickler(file).load()
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 858, in load
dispatch[key](self)
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 880, in load_eofraiseEOFError
EOFError
Traceback (most recent call last):
File "..\..\Lib\test\test_multiprocessing.py", line 485, in test_fork
p.start()
File "C:\Users\stefan\svn\trunk\lib\multiprocessing\process.py", line 104, in startself._popen = Popen(self)
File "C:\Users\stefan\svn\trunk\lib\multiprocessing\forking.py", line 244, in __init__
dump(process_obj, to_child, HIGHEST_PROTOCOL)
File "C:\Users\stefan\svn\trunk\lib\multiprocessing\forking.py", line 167, in dump
ForkingPickler(file, protocol).dump(obj)
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 224, in dumpself.save(obj)
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 331, in saveself.save_reduce(obj=obj, *rv)
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 419, in save_reduce
save(state)
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 649, in save_dictself._batch_setitems(obj.iteritems())
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 681, in _batch_setitems
save(v)
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "C:\Users\stefan\svn\trunk\lib\multiprocessing\forking.py", line 40, in dispatcherself.save_reduce(obj=obj, *rv)
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 401, in save_reduce
save(args)
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 548, in save_tuple
save(element)
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 331, in saveself.save_reduce(obj=obj, *rv)
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 419, in save_reduce
save(state)
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 649, in save_dictself._batch_setitems(obj.iteritems())
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 681, in _batch_setitems
save(v)
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 331, in saveself.save_reduce(obj=obj, *rv)
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 419, in save_reduce
save(state)
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 649, in save_dictself._batch_setitems(obj.iteritems())
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 681, in _batch_setitems
save(v)
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 331, in saveself.save_reduce(obj=obj, *rv)
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 396, in save_reduce
save(cls)
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 748, in save_global
(obj, module, name))
PicklingError: Can't pickle <type 'cStringIO.StringO'>: it's not found as cStringIO.StringO
On 07/04/2010 14:34, Stefan Krah wrote:
>
> New submission from Stefan Krah<[email protected]>:
>
> On Windows/amd64, I get loads of pickling errors in test_multiprocessing.
>
> Type 1 error:
>
> Traceback (most recent call last):
> File "<string>", line 1, in<module>
> File "C:\Users\stefan\svn\trunk\lib\multiprocessing\forking.py", line 347, in main
> self = load(from_parent)
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 1378, in load
> return Unpickler(file).load()
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 858, in load
> dispatch[key](self)
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 880, in load_eof
> raise EOFError
> EOFError
>
>
> Type 2 error:
>
>
> Traceback (most recent call last):
> File "..\..\Lib\test\test_multiprocessing.py", line 485, in test_fork
> p.start()
> File "C:\Users\stefan\svn\trunk\lib\multiprocessing\process.py", line 104, in start
> self._popen = Popen(self)
> File "C:\Users\stefan\svn\trunk\lib\multiprocessing\forking.py", line 244, in __init__
> dump(process_obj, to_child, HIGHEST_PROTOCOL)
> File "C:\Users\stefan\svn\trunk\lib\multiprocessing\forking.py", line 167, in dump
> ForkingPickler(file, protocol).dump(obj)
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 224, in dump
> self.save(obj)
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 331, in save
> self.save_reduce(obj=obj, *rv)
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 419, in save_reduce
> save(state)
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 286, in save
> f(self, obj) # Call unbound method with explicit self
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 649, in save_dict
> self._batch_setitems(obj.iteritems())
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 681, in _batch_setitems
> save(v)
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 286, in save
> f(self, obj) # Call unbound method with explicit self
> File "C:\Users\stefan\svn\trunk\lib\multiprocessing\forking.py", line 40, in dispatcher
> self.save_reduce(obj=obj, *rv)
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 401, in save_reduce
> save(args)
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 286, in save
> f(self, obj) # Call unbound method with explicit self
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 548, in save_tuple
> save(element)
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 331, in save
> self.save_reduce(obj=obj, *rv)
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 419, in save_reduce
> save(state)
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 286, in save
> f(self, obj) # Call unbound method with explicit self
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 649, in save_dict
> self._batch_setitems(obj.iteritems())
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 681, in _batch_setitems
> save(v)
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 331, in save
> self.save_reduce(obj=obj, *rv)
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 419, in save_reduce
> save(state)
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 286, in save
> f(self, obj) # Call unbound method with explicit self
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 649, in save_dict
> self._batch_setitems(obj.iteritems())
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 681, in _batch_setitems
> save(v)
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 331, in save
> self.save_reduce(obj=obj, *rv)
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 396, in save_reduce
> save(cls)
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 286, in save
> f(self, obj) # Call unbound method with explicit self
> File "C:\Users\stefan\svn\trunk\lib\pickle.py", line 748, in save_global
> (obj, module, name))
> PicklingError: Can't pickle<type 'cStringIO.StringO'>: it's not found as cStringIO.StringO
>
>
components: Library (Lib)
messages: 102539
nosy: skrah
priority: high
severity: normal
stage: needs patch
status: open
title: test_multiprocessing: pickling failures
type: behavior
versions: Python 2.7
It was introduced in r79623, and the attached patch makes the problem
go away. I would be happy to apply it, but I perhaps you and Michael
could analyze if there are unwanted dependencies between multiprocessing
and unittest.
I expect the unittest tests will fail with that patch applied however... No problem with switching to just using StringIO in unittest though - preferably with a comment as to why.
loewis commented on Apr 7, 2010
loewismannequin
Mannequin
More actions
Perhaps we could run the multiprocessing tests unbuffered?
loewis commented on Apr 7, 2010
loewismannequin
Mannequin
More actions
BTW, this is also causing all Windows buildbots to fail.
TestResult creates its StringIO buffers even if they aren't use. I can create them on first use and use StringIO.StringIO rather than cStringIO. Will fix now.
Although merely switching to StringIO may not be enough. TestResult objects keep a reference to sys.stdout when they are instantiated and you can't pickle that either.
It is preferable for the reference to be taken at instantiation time rather than stored as a module level reference to be compatible with test runners (like regrtest) that *themselves* replace sys.stdout...
Activity
skrah commentedon Apr 7, 2010
On Windows/amd64, I get loads of pickling errors in test_multiprocessing.
Type 1 error:
Type 2 error:
======================================================================
ERROR: test_fork (main.WithManagerTestQueue)
----------------------------------------------------------------------
tjguk commentedon Apr 7, 2010
Seeing the same thing on 32-bit WinXP on x86
======================================================================
jnoller commentedon Apr 7, 2010
When did this problem start?
skrah commentedon Apr 7, 2010
It was introduced in r79623, and the attached patch makes the problem
go away. I would be happy to apply it, but I perhaps you and Michael
could analyze if there are unwanted dependencies between multiprocessing
and unittest.
voidspace commentedon Apr 7, 2010
I expect the unittest tests will fail with that patch applied however... No problem with switching to just using StringIO in unittest though - preferably with a comment as to why.
loewis commentedon Apr 7, 2010
Perhaps we could run the multiprocessing tests unbuffered?
loewis commentedon Apr 7, 2010
BTW, this is also causing all Windows buildbots to fail.
voidspace commentedon Apr 7, 2010
TestResult creates its StringIO buffers even if they aren't use. I can create them on first use and use StringIO.StringIO rather than cStringIO. Will fix now.
voidspace commentedon Apr 7, 2010
Although merely switching to StringIO may not be enough. TestResult objects keep a reference to sys.stdout when they are instantiated and you can't pickle that either.
It is preferable for the reference to be taken at instantiation time rather than stored as a module level reference to be compatible with test runners (like regrtest) that *themselves* replace sys.stdout...
voidspace commentedon Apr 7, 2010
Changing unittest.TestResult to use StringIO instead of cStringIO isn't sufficient. regrtest.py also needs to use StringIO...
voidspace commentedon Apr 8, 2010
I believe this issue to now be fixed on trunk. We can close this when the buildbots are passing again.
voidspace commentedon Apr 8, 2010
Green build on Windows XP, trunk.
http://www.python.org/dev/buildbot/all/builders/x86%20XP-5%20trunk/builds/282