Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PicklingError when using cotyledon on win64 #11

Closed
jdandrea opened this issue May 16, 2017 · 6 comments
Closed

PicklingError when using cotyledon on win64 #11

jdandrea opened this issue May 16, 2017 · 6 comments

Comments

@jdandrea
Copy link

jdandrea commented May 16, 2017

Unsure how to proceed/mitigate this one. I normally run on Ubuntu or macOS. First time we're trying on win64 (developer workstation).

It seems to originate with a call from cotyledon, but I don't see any reference to identity in the cotyledon source, nor in my own project. Thoughts welcomed!

File "C:\...path-to-venv...\lib\site-packages\cotyledon\_utils.py", line 69, in spawn_process
  p.start()
File "C:\Python27\Lib\multiprocessing\process.py", line 130, in start
  self._popen = Popen(self)
File "C:\Python27\Lib\multiprocessing\forking.py", line 277, in __init__
  dump(process_obj, to_child, HIGHEST_PROTOCOL)
File "C:\Python27\Lib\multiprocessing\forking.py", line 199, in dump
  ForkingPickler(file, protocol).dump(obj)
File "C:\Python27\Lib\pickle.py", line 224, in dump
  self.save(obj)
File "C:\Python27\Lib\pickle.py", line 331, in save
  self.save_reduce(obj=obj, *rv)
File "C:\Python27\Lib\pickle.py", line 425, in save_reduce
  save(state)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 655, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\Lib\pickle.py", line 687, in _batch_setitems
  save(v)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 568, in save_tuple
  save(element)
File "C:\Python27\Lib\pickle.py", line 331, in save
  self.save_reduce(obj=obj, *rv)
File "C:\Python27\Lib\pickle.py", line 425, in save_reduce
  save(state)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 655, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\Lib\pickle.py", line 687, in _batch_setitems
  save(v)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 554, in save_tuple
  save(element)
File "C:\Python27\Lib\pickle.py", line 331, in save
  self.save_reduce(obj=obj, *rv)
File "C:\Python27\Lib\pickle.py", line 425, in save_reduce
  save(state)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 655, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\Lib\pickle.py", line 687, in _batch_setitems
  save(v)
File "C:\Python27\Lib\pickle.py", line 331, in save
  self.save_reduce(obj=obj, *rv)
File "C:\Python27\Lib\pickle.py", line 425, in save_reduce
  save(state)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 655, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\Lib\pickle.py", line 687, in _batch_setitems
  save(v)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 655, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\Lib\pickle.py", line 687, in _batch_setitems
  save(v)
File "C:\Python27\Lib\pickle.py", line 331, in save
  self.save_reduce(obj=obj, *rv)
File "C:\Python27\Lib\pickle.py", line 425, in save_reduce
  save(state)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 655, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\Lib\pickle.py", line 687, in _batch_setitems
  save(v)
File "C:\Python27\Lib\pickle.py", line 331, in save
  self.save_reduce(obj=obj, *rv)
File "C:\Python27\Lib\pickle.py", line 425, in save_reduce
  save(state)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 655, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\Lib\pickle.py", line 687, in _batch_setitems
  save(v)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 655, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\Lib\pickle.py", line 687, in _batch_setitems
  save(v)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 655, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\Lib\pickle.py", line 692, in _batch_setitems
  save(v)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 754, in save_global
  (obj, module, name))

PicklingError: Can't pickle <function identity at 0x03F9B230>: it's not found as argparse.identity
@sileht
Copy link
Owner

sileht commented May 16, 2017

To support windows all objects passed to children process must support Pickle. Your application seems the pass some argparse objects to children. More generally master process should do a very minimal works.

@sileht
Copy link
Owner

sileht commented May 16, 2017

I 'm guessing identity is this one: https://github.com/python/cpython/blob/master/Lib/argparse.py#L1638

@jdandrea
Copy link
Author

Thank you! I did a search for argparse in my project and only one component uses it: pbr. I think I will ask them about it or see if anyone has filed an issue.

@jacobluo
Copy link

@jdandrea how to solve this problem on win64?

@jdandrea
Copy link
Author

Whoops, I'm now at a loss as to how the case was cracked (and why on earth nothing was mentioned herein). I will go ISO answers and, hopefully, report back.

@jdandrea
Copy link
Author

jdandrea commented Oct 4, 2017

@jacobluo A patch has merged for pbr that I hope resolves this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants