[issue18359] pickle fail to handle some class with __new__

2013-07-04 Thread yoch

New submission from yoch:

Hi,

If some class objects have extra arguments in the __new__ constructor , pickle 
fail to serialize it.

Here the output of provided test-case :

Traceback (most recent call last):
  File /home/yoch/bug.py, line 19, in module
y = pickle.load(fp)
TypeError: __new__() missing 1 required positional argument: 'arg'

Best regards

--
components: Library (Lib)
files: bug.py
messages: 192290
nosy: yoch.melka
priority: normal
severity: normal
status: open
title: pickle fail to handle some class with __new__
versions: Python 3.3
Added file: http://bugs.python.org/file30774/bug.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18359
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18359] pickle fail to handle some class with __new__

2013-07-04 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

This is expected, your class must say how this __new__ constructor can be 
called.
http://docs.python.org/2/library/pickle.html#object.__getnewargs__

--
nosy: +amaury.forgeotdarc
resolution:  - works for me
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18359
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com