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

2017-12-20 Thread Yury Selivanov

Yury Selivanov  added the comment:

Closing this one.

Quoting my other comment from this issue:

> Well, I don't think we can do something about it. Just re-pack your arguments 
> from WeakSet to a regular set.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
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-12-20 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

asyncio objects are not pickable and shouldn't be -- they are ephemeral.

Like pickling open socket object doesn't make sense -- there is no possibility 
to restore connection to peer on unpickling.

Not sure if we can do anything here.

I suggest closing the issue.

--
nosy: +asvetlov

___
Python tracker 

___
___
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-06-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Since WeakSet never was pickleable, the difference perhaps in the use of 
WeakSet in asyncio. BaseEventLoop contains a WeakSet attribute since 3.6, this 
makes it non-pickleable.

I'm not sure this is a cause of the failure.

--
components: +Library (Lib)

___
Python tracker 

___
___
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-03-14 Thread STINNER Victor

STINNER Victor added the comment:

Can you write a short Python script producing the bug?

--

___
Python tracker 

___
___
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-03-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If the example worked on old versions of Python, perhaps this is a regression. 
Either WeakSet was pickleable or it was not used in that 
asyncio/multiprocessing use. If this is a regression in the stdlib it should be 
fixed.

--
nosy: +fdrake, giampaolo.rodola, haypo

___
Python tracker 

___
___
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-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 

___
___
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-03-13 Thread Yury Selivanov

Yury Selivanov added the comment:

> AttributeError: Can't pickle local object 'WeakSet.__init__.._remove'

Well, I don't think we can do something about it. Just re-pack your arguments 
from WeakSet to a regular set.

--

___
Python tracker 

___
___
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-03-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Please provide your code as a text, not a picture.

--

___
Python tracker 

___
___
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 Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

___
___
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 

___
___
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 R. David Murray

Changes by R. David Murray :


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
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 

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