[issue29517] "Can't pickle local object" when uses functools.partial with method and args...

2017-03-13 Thread DAVID ALEJANDRO Pineda

DAVID ALEJANDRO Pineda added the comment:

Hello Again.

The problem can be replicated in the same structure when call the 
'functools.partial' feature

I wrote a simple example. It uses the asyncio and multiprocessing structure.

https://github.com/dpineiden/async_multiprocessing

With this dependences:

https://gitlab.com/pineiden/tasktools
https://gitlab.com/pineiden/networktools

In python 3.5.1 works fine even if in the mprocess file uncomment the 
'functools.partial'. But when i use a larger version, like 3.6, fails with the 
'weakref'

--

___
Python tracker 
<http://bugs.python.org/issue29517>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29517] "Can't pickle local object" when uses functools.partial with method and args...

2017-02-15 Thread DAVID ALEJANDRO Pineda

DAVID ALEJANDRO Pineda added the comment:

Now
I try again with different ways to run a method with args, without args works 
fine to insert in the executor.
I find there are big differences with file functools betwen versions 3.5.1 to 
3.6.0.
 Here a more simple example for test the functools:
https://github.com/dpineiden/async_multiprocessing

--

___
Python tracker 
<http://bugs.python.org/issue29517>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29517] "Can't pickle local object" when uses functools.partial with method and args...

2017-02-09 Thread DAVID ALEJANDRO Pineda

New submission from DAVID ALEJANDRO Pineda:

Hello.

I'm working in a real time data collector project. I'm using asyncio and 
multiprocessing (run_in_executor).
In python 3.5 worked fine but in python 3.6 not, gave to me this error:
 "Traceback (most recent call last):
  File "/usr/local/lib/python3.6/multiprocessing/queues.py", line 241, in _feed
obj = _ForkingPickler.dumps(obj)
  File "/usr/local/lib/python3.6/multiprocessing/reduction.py", line 51, in 
dumps
cls(buf, protocol).dump(obj)
AttributeError: Can't pickle local object 'WeakSet.__init__.._remove'
"

I tracked and the problem is when i run some method in run_in_executor with the 
functools.partial.

Before this version the system works fine.

The main file is local.py (to run with local administration using a socket)
And the engine is in engine.py

The project (in development):
https://gitlab.com/pineiden/collector

--
components: asyncio
files: code_with_bug.png
messages: 287459
nosy: DAVID ALEJANDRO Pineda, gvanrossum, yselivanov
priority: normal
severity: normal
status: open
title: "Can't pickle local object" when uses functools.partial with method and 
args...
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file46614/code_with_bug.png

___
Python tracker 
<http://bugs.python.org/issue29517>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com