[issue27635] pickle documentation says that unpickling may not call __new__

2020-10-11 Thread Alexandre Vassalotti


Change by Alexandre Vassalotti :


--
stage: patch review -> resolved
status: open -> closed

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



[issue38876] pickle is raising KeyError insteat of pickle.UnpicklingError under certain conditions

2019-11-24 Thread Alexandre Vassalotti


Change by Alexandre Vassalotti :


--
assignee:  -> alexandre.vassalotti
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.7, Python 3.8

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



[issue34973] Crash in bytes constructor with mutating list

2018-10-18 Thread Alexandre Vassalotti


Alexandre Vassalotti  added the comment:

PR 9841 looks good to me. I wouldn't worry about the performance hit.

--

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



[issue17720] pickle.py's load_appends should call append() on objects other than lists

2017-01-24 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

I don't recall where I picked up the referred spec. Looking at PEP 307 and 
pickle docs [1], it does look like that objects which provides the listitems 
field of the reduce tuple should support extend() too.

It might best to try both in the implementation to avoid breaking existing code 
that relies on the previous behavior.

[1]: https://docs.python.org/3/library/pickle.html#object.__reduce__

--

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



[issue23096] Implementation-depended pickling floats with protocol 0

2014-12-22 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

The repr for floats was changed some time ago to use a shorter decimal strings 
when possible. Both representations should yield the same float value once 
decoded. If we want to make the C and Python implementations of pickle 
consistent, then we should pick on what the Python version does currently: 
i.e., call repr on the float.

--

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



[issue20428] _Py_open does not work with O_CREAT

2014-01-28 Thread Alexandre Vassalotti

New submission from Alexandre Vassalotti:

The _Py_open function in Python/fileutils.c cannot be given correctly the flag 
O_CREAT. According to the POSIX spec, open(2) _must_ be given an additional 
mode argument when O_CREAT is used.

_Py_open should be fixed to either to use a reasonable default value for the 
mode argument (e.g., O666) or to refuse the O_CREAT flag.

--
components: Interpreter Core
messages: 209600
nosy: alexandre.vassalotti, haypo
priority: normal
severity: normal
stage: needs patch
status: open
title: _Py_open does not work with O_CREAT
type: behavior
versions: Python 3.4

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



[issue20428] _Py_open does not work with O_CREAT

2014-01-28 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

 What is the current behaviour?

I don't think the behaviour is defined. At least, I know it causes recent 
GCC/glibc combination to throw a compilation error when _FORTIFY_SOURCE is 
defined:
 
http://www.eglibc.org/cgi-bin/viewvc.cgi/trunk/libc/io/open_2.c?view=markup

For example, this is the error I got when I tried to compile Python with LTO:

gcc-4.6 -pthread -flto -fuse-linker-plugin  -Xlinker -export-dynamic -o python 
Modules/python.o libpython3.4m.a -lpthread -ldl -lutil -lm  
bytesobject.o (symbol from plugin): warning: memset used with constant zero 
length parameter; this could be due to transposed parameters
In file included from ./Modules/_localemodule.c:404:0,
 from :459:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h: In function ‘_Py_open’:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:51:24: error: call to 
‘__open_missing_mode’ declared with attribute error: open with O_CREAT in 
second argument needs 3 arguments
lto-wrapper: gcc-4.6 returned 1 exit status
/usr/bin/ld: lto-wrapper failed
collect2: ld returned 1 exit status

--

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



[issue20395] Extract generated clinic code in Modules/_pickle.c to separate file

2014-01-26 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

+1 from me as well for a separate file.

--

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



[issue19972] Leak in pickle (?)

2013-12-13 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

The patch is good. I am not sure if you need the freefunc cast though.

The example in the PEP 3121 should updated if freefunc is actually required. I 
didn't define freefunc because of this example.

--

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



[issue11299] Allow deepcopying paused generators

2013-12-08 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

The issue here is copy.deepcopy will raise an exception whenever it encounters 
a generator. We would like to do better here. Unfortunately, using 
itertools.tee is not a solution here because it does not preserve the type of 
the object.

--

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



[issue6784] byte/unicode pickle incompatibilities between python2 and python3

2013-12-07 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

I fixed up the last few review comments and submitted the patch. Thank you for 
the help!

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue6673] Uncaught comprehension SyntaxError eats up all memory

2013-12-07 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
nosy:  -alexandre.vassalotti

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



[issue12290] __setstate__ is called for false values

2013-12-07 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
assignee:  - docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
stage:  - patch review
versions: +Python 3.4 -Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 
3.3

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



[issue12290] __setstate__ is called for false values

2013-12-07 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
versions: +Python 2.7, Python 3.3

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



[issue13566] Array objects pickled in 3.x with protocol =2 are unpickled incorrectly in 2.x

2013-12-07 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Adding a special type is not a bad idea. We have to keep the code for loading 
BINSTRING opcodes anyway, so we might as well use it. It could be helpful for 
unit-testing our Python 2 compatibility support for pickle.

We should still fix array in 2.7 to accept unicode object for the typecode 
though.

--
stage:  - needs patch
versions: +Python 2.7, Python 3.4 -Python 3.2

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



[issue6784] byte/unicode pickle incompatibilities between python2 and python3

2013-12-06 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

I cleaned up the patch. I will submit it tonight if there is no major 
objections.

--
Added file: http://bugs.python.org/file33019/pickle_python2_str_as_bytes.diff

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



[issue19881] Fix bigmem pickle tests

2013-12-05 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


Added file: http://bugs.python.org/file32982/fix_bigmem_pickle_2.patch

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



[issue19881] Fix bigmem pickle tests

2013-12-05 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


Added file: http://bugs.python.org/file33001/fix_bigmem_pickle_3.patch

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



[issue19881] Fix bigmem pickle tests

2013-12-05 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue6784] byte/unicode pickle incompatibilities between python2 and python3

2013-12-05 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Could you provide a single patch with the implementation and the tests 
together? I will try to find some time this week to review this.

--
assignee: docs@python - alexandre.vassalotti
priority: normal - high
stage:  - patch review
versions: +Python 3.4 -Python 2.7, Python 3.2, Python 3.3

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



[issue19858] Make pickletools.optimize aware of the MEMOIZE opcode.

2013-12-05 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Ah, I almost forgot! I did implement the verification in pickletools.dis() for 
MEMOIZE:

http://hg.python.org/cpython/file/2612ea573ff7/Lib/pickletools.py#l2420

--

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



[issue19900] improve pickle intro

2013-12-05 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Looks good to me!

--

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



[issue18015] python 2.7.5 fails to unpickle namedtuple pickled by 2.7.3 or 2.7.4

2013-12-05 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue10701] Error pickling objects with mutating __getstate__

2013-12-05 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
title: Error pickling a dict - Error pickling objects with mutating 
__getstate__

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



[issue18400] Minor increase to Pickle test coverage

2013-12-05 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
nosy: +alexandre.vassalotti
stage:  - patch review
type:  - enhancement

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



[issue19881] Fix bigmem pickle tests

2013-12-03 Thread Alexandre Vassalotti

New submission from Alexandre Vassalotti:

The bigmem tests for pickle are currently failing for protocol 4. The tests are 
broken because of an assumption rendered invalid by the frame header. Fixing 
the tests caught a legitimate bug in the save_bytes function of cpickle.

--
assignee: alexandre.vassalotti
components: Library (Lib)
files: fix_bigmem_pickle.patch
keywords: patch
messages: 205196
nosy: alexandre.vassalotti, pitrou, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Fix bigmem pickle tests
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file32966/fix_bigmem_pickle.patch

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



[issue19858] Make pickletools.optimize aware of the MEMOIZE opcode.

2013-12-02 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Well, that can only happen if MEMOIZE and PUT are both used together, which 
won't happen with the Pickler classes we support. The easiest thing to do here 
is to disable pickletools.optimize on protocol 4.

--

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



[issue19858] Make pickletools.optimize aware of the MEMOIZE opcode.

2013-12-02 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

MEMOIZE and PUT can be used together. They just need to not step on each other 
toes when they write to the memo table. As specified by PEP 3154, the memo 
index used by MEMOIZE is the number of elements currently in the memo table. 
This obviously means functions like, pickletools.optimize, have to be more 
careful when they rewrite pickles.

--

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



[issue6477] Pickling of NoneType raises PicklingError

2013-12-01 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

I thought it over. I don't think the fix is appropriate for 2.x, as it seems 
closer to being an extra feature than a bug fix.

Thanks Antoine for calling me out on this one.

--
resolution:  - wont fix
stage: patch review - committed/rejected
status: open - closed

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



[issue3657] pickle can pickle the wrong function

2013-12-01 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

This was fixed in 3.4 with the introduction of method pickling. I don't think 
it would be appropriate to backport this to 2.7. Thus, I am closing this as a 
won't fix for 2.x.

--
assignee:  - alexandre.vassalotti
resolution:  - wont fix
stage: needs patch - committed/rejected
status: open - closed
versions:  -Python 3.1, Python 3.2

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



[issue5885] uuid.uuid1() is too slow

2013-12-01 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

I agree that there is a maintenance cost associated with C extension modules. 
However, I would certainly be glad if it allowed us to eliminate uses of ctypes 
in this module because ctypes is quite unsafe and doesn't work well across 
platforms (though it is admittedly very convenient).

--

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



[issue11480] Cannot copy a class with a metaclass other than type

2013-12-01 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Thank you for the patch!

--
assignee:  - alexandre.vassalotti
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed
versions: +Python 3.4 -Python 3.1, Python 3.2

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



[issue18473] some objects pickled by Python 3.x are not unpicklable in Python 2.x because of incorrect REVERSE_IMPORT_MAPPING

2013-12-01 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
assignee:  - alexandre.vassalotti
priority: normal - high
stage:  - needs patch
type:  - behavior
versions: +Python 3.4

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



[issue11299] Allow deepcopying paused generators

2013-12-01 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Allowing generators to be deepcopied via their code object should be fine.

--
stage: test needed - needs patch
title: Allow deepcopying and pickling paused generators - Allow deepcopying 
paused generators
versions: +Python 3.5 -Python 3.3

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



[issue3208] function annotation for builtin and C function

2013-12-01 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
nosy:  -alexandre.vassalotti
stage:  - needs patch
versions: +Python 3.5 -Python 3.0

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



[issue2295] cPickle corner case - docs or bug?

2013-12-01 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

We can't fix this without a working test case. Feel free to re-open if you find 
one.

--
assignee: docs@python - alexandre.vassalotti
components:  -Documentation
resolution:  - works for me
status: open - closed
versions: +Python 2.7 -Python 2.6, Python 3.1

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



[issue11349] _pickle should implement the module finalisation protocol

2013-12-01 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

I have implemented PEP 3121 module finalization for _pickle in 64c6d52793be.

--
assignee:  - alexandre.vassalotti
nosy: +alexandre.vassalotti
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

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



[issue15667] PEP 3121, 384 refactoring applied to pickle module

2013-12-01 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

I have implemented PEP 3121 module finalization for _pickle in 64c6d52793be. I 
don't see the use case for implementing PEP 384 stable ABI, since _pickle is 
only distributed with Python.

--
assignee:  - alexandre.vassalotti
nosy: +alexandre.vassalotti
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue4727] copyreg doesn't support keyword only arguments in __new__

2013-12-01 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

PEP 3154 implemented support for pickling classes taking keyword-only arguments.

The copy module should be updated to use __getnewargs_ex__ when available 
through object.__reduce__(4).

--
nosy: +alexandre.vassalotti
superseder:  - Implement PEP 3154 (pickle protocol 4)
title: pickle/copyreg doesn't support keyword only arguments in __new__ - 
copyreg doesn't support keyword only arguments in __new__
versions: +Python 3.4 -Python 3.2

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



[issue4727] copyreg doesn't support keyword only arguments in __new__

2013-12-01 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
superseder: Implement PEP 3154 (pickle protocol 4) - 

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



[issue10717] Multiprocessing module Pickling unPickling issues

2013-12-01 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Without a reproducible test case, I am afraid there is nothing we can do here.

--
assignee:  - alexandre.vassalotti
components: +Library (Lib) -None
nosy: +alexandre.vassalotti
resolution:  - works for me
stage:  - test needed
status: open - closed
versions:  -Python 3.1, Python 3.2

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



[issue10717] Multiprocessing module Pickling unPickling issues

2013-12-01 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Look like I isolated the problem. It seems multiprocessing is using cPickle 
which cannot be extended with ForkingPickler, unlike the Python version of the 
pickle module.

15:09:29 [ ~/pythondev/python2.7 ]$ ./python.exe issue10717.py
Traceback (most recent call last):
  File issue10717.py, line 8, in module
p.apply(Test().hello, (jimbo,))
  File /Users/avassalotti/PythonDev/python2.7/Lib/multiprocessing/pool.py, 
line 244, in apply
return self.apply_async(func, args, kwds).get()
  File /Users/avassalotti/PythonDev/python2.7/Lib/multiprocessing/pool.py, 
line 558, in get
raise self._value
cPickle.PicklingError: Can't pickle type 'instancemethod': attribute lookup 
__builtin__.instancemethod failed

--
assignee: alexandre.vassalotti - 
resolution: works for me - 
stage: test needed - needs patch
status: closed - open
Added file: http://bugs.python.org/file32933/issue10717.py

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



[issue10717] Multiprocessing module cannot call instance methods across processes

2013-12-01 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
title: Multiprocessing module Pickling unPickling issues - Multiprocessing 
module cannot call instance methods across processes

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



[issue19754] pickletools.optimize doesn't reframe correctly

2013-12-01 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Now, pickletools.optimize doesn't do anything on protocol 4. :)

--
assignee:  - alexandre.vassalotti
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue19780] Pickle 4 frame headers optimization

2013-12-01 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Yeah, let's close this. It is much simpler to just double the frame size target 
if the extra reads ever become a performance issue.

--
status: pending - closed

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



[issue19858] Make pickletools.optimize aware of the MEMOIZE opcode.

2013-12-01 Thread Alexandre Vassalotti

New submission from Alexandre Vassalotti:

PEP 3154 introduced the MEMOIZE opcode which lowered the overhead of 
memoization compared to the PUT opcodes which were previously used.

We should update pickletools.optimize to remove superfluous uses of this new 
opcode.

--
components: Library (Lib)
messages: 204985
nosy: alexandre.vassalotti
priority: normal
severity: normal
stage: needs patch
status: open
title: Make pickletools.optimize aware of the MEMOIZE opcode.
type: behavior
versions: Python 3.5

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



[issue19834] Unpickling exceptions pickled by Python 2

2013-12-01 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Feel free to commit once you have addressed the remaining comments.

--
assignee:  - doerwalter

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



[issue18073] pickle.Unpickler may read too many bytes, causing hangs with blocking input stream

2013-12-01 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
assignee:  - alexandre.vassalotti
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue19835] Add a MemoryError singleton to fix an unlimited loop when the memory is exhausted

2013-12-01 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
nosy:  -alexandre.vassalotti

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



[issue19726] BaseProtocol is not an ABC

2013-11-30 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
Removed message: http://bugs.python.org/msg204785

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



[issue19088] TypeError with pickle in embedded python3.3 when starting multiple Interpreters.

2013-11-30 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
assignee:  - alexandre.vassalotti
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

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



[issue19834] Unpickling exceptions pickled by Python 2

2013-11-30 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

I have reviewed the patch in the review tool. Please take a look!

--

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



[issue6673] Uncaught comprehension SyntaxError eats up all memory

2013-11-30 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
assignee:  - docs@python
components: +Documentation -Interpreter Core
keywords:  -64bit
nosy: +docs@python
stage:  - needs patch
type: resource usage - enhancement
versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3

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



[issue15513] Correct __sizeof__ support for pickle

2013-11-30 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


Removed file: http://bugs.python.org/file26617/pickle_sizeof-2.7.patch

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



[issue15513] Correct __sizeof__ support for pickle

2013-11-30 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


Removed file: http://bugs.python.org/file26616/pickle_sizeof-3.2.patch

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



[issue15490] Correct __sizeof__ support for StringIO

2013-11-30 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


Removed file: http://bugs.python.org/file26588/stringio_sizeof-2.7.patch

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



[issue15490] Correct __sizeof__ support for StringIO

2013-11-30 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


Removed file: http://bugs.python.org/file26587/stringio_sizeof-3.2.patch

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



[issue15490] Correct __sizeof__ support for StringIO

2013-11-30 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


Removed file: http://bugs.python.org/file26810/stringio_sizeof-3.3_2.patch

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



[issue15490] Correct __sizeof__ support for StringIO

2013-11-30 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


Removed file: http://bugs.python.org/file26586/stringio_sizeof-3.3.patch

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



[issue15490] Correct __sizeof__ support for StringIO

2013-11-30 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


Removed file: http://bugs.python.org/file26811/stringio_sizeof-3.2_2.patch

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



[issue15490] Correct __sizeof__ support for StringIO

2013-11-30 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


Removed file: http://bugs.python.org/file26812/stringio_sizeof-2.7_2.patch

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



[issue15490] Correct __sizeof__ support for StringIO

2013-11-30 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


Removed file: http://bugs.python.org/file27241/stringio_sizeof-3.2_3.patch

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



[issue17897] Optimize unpickle prefetching

2013-11-30 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Looks good to me! Feel free to commit.

--

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



[issue16231] pickle persistent_id return value

2013-11-30 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
assignee:  - alexandre.vassalotti
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue5885] uuid.uuid1() is too slow

2013-11-30 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
priority: low - normal
stage: needs patch - patch review
versions: +Python 3.5 -Python 2.7, Python 3.2

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



[issue2281] Enhanced cPython profiler with high-resolution timer

2013-11-30 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
priority: normal - low
versions: +Python 3.5 -Python 3.2

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



[issue2281] Enhanced cPython profiler with high-resolution timer

2013-11-30 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
priority: normal - low
versions: +Python 3.5 -Python 3.2

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



[issue2281] Enhanced cPython profiler with high-resolution timer

2013-11-30 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
priority: normal - low
versions: +Python 3.5 -Python 3.2

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



[issue2799] Remove _PyUnicode_AsString(), rework _PyUnicode_AsStringAndSize(), add PyUnicode_AsChar()

2013-11-30 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

With PEP 393 implemented, there doesn't seem to anything left to be done here. 
Closing as fixed.

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

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



[issue6477] Pickling of NoneType raises PicklingError

2013-11-30 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
assignee: docs@python - alexandre.vassalotti
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

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



[issue6477] Pickling of NoneType raises PicklingError

2013-11-30 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Would you be okay with removing the static declaration of PyNotImplemented_Type 
and PyNone_Type if we prefix their name with an underscore? There isn't any 
other way to fix this without making the types linkable.

I might revert the 2.7 change anyway as it broke test_xpickle and it doesn't 
look easy to fix.

--

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



[issue6477] Pickling of NoneType raises PicklingError

2013-11-30 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Antoine, are you okay with applying this fix to 2.7? Or should we just mark 
this as a won't fix?

--
keywords: +patch
priority: low - normal
resolution: fixed - 
stage: committed/rejected - patch review
versions:  -Python 3.2, Python 3.3, Python 3.4
Added file: 
http://bugs.python.org/file32915/backport_pickle_singleton_types_fix.diff

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



[issue9276] pickle should support methods

2013-11-29 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

As part of the implementation of PEP 3154 (Pickle protocol 4), I've introduced 
support for pickling methods for all pickle protocols (and not just for the new 
protocol 4). This was implemented by adding the appropriate __reduce__ method 
on built-in functions and methods. In addition, pickling methods in nested 
classes is now supported by protocol 4 through the use of the __qualname__ 
attribute.

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
versions: +Python 3.4 -Python 3.3

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



[issue19780] Pickle 4 frame headers optimization

2013-11-29 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

 Test data are too small, they all less than frame size.

Ah, good point! It seems your patch helps when the reads are *very* slow and 
buffering is disabled.

### unpickle_file ###
Min: 1.125320 - 0.663367: 1.70x faster
Avg: 1.237206 - 0.701303: 1.76x faster
Significant (t=30.77)
Stddev: 0.12031 - 0.02634: 4.5682x smaller

That certainly is a nice improvement though that seems to be fairly narrow use 
case. With more normal read times, the improvement diminishes greatly:

### unpickle_file ###
Min: 0.494841 - 0.466837: 1.06x faster
Avg: 0.540923 - 0.511165: 1.06x faster
Significant (t=4.10)
Stddev: 0.03740 - 0.03510: 1.0657x smaller

--
Added file: http://bugs.python.org/file32900/unpickle_file_bench_2.diff

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



[issue3693] Obscure array.array error message

2013-11-29 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
assignee:  - alexandre.vassalotti
resolution:  - fixed
stage: commit review - committed/rejected
status: open - closed

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



[issue13520] Patch to make pickle aware of __qualname__

2013-11-29 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
assignee:  - alexandre.vassalotti
resolution:  - duplicate
stage: patch review - committed/rejected
status: open - closed
superseder:  - Implement PEP 3154 (pickle protocol 4)
versions: +Python 3.4 -Python 3.3

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



[issue9269] Cannot pickle self-referencing sets

2013-11-29 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
assignee:  - alexandre.vassalotti
resolution:  - duplicate
stage: patch review - committed/rejected
status: open - closed
superseder:  - Implement PEP 3154 (pickle protocol 4)

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



[issue19780] Pickle 4 frame headers optimization

2013-11-26 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Serhiy, I am not able to reproduce your results. I don't get any significant 
performance improvements with your patch.

22:34:03 [ ~/PythonDev/cpython-baseline ]$ ./python.exe -m timeit import 
pickle with open('test.pickle4', 'rb', buffering=0) as f: pickle.load(f)
100 loops, best of 3: 9.26 msec per loop

22:36:13 [ ~/PythonDev/cpython ]$ ./python.exe -m timeit import pickle with 
open('test.pickle4', 'rb', buffering=0) as f: pickle.load(f)
100 loops, best of 3: 9.28 msec per loop

I wrote a benchmark to simulate slow reads. But again, there is no performance 
difference with the patch.

22:24:56 [ ~/PythonDev/benchmarks ]$ ./perf.py -v -b unpickle_file 
../cpython-baseline/python.exe ../cpython/python.exe
### unpickle_file ###
Min: 1.103715 - 1.103666: 1.00x faster
Avg: 1.158279 - 1.146820: 1.01x faster
Not significant
Stddev: 0.04127 - 0.03273: 1.2608x smaller

--
Added file: http://bugs.python.org/file32864/unpickle_file_bench.diff

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-11-25 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Optimizing the output of the pickler class should be fine during the feature 
freeze as long the semantics of the current opcodes stay unchanged.

--

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



[issue19739] Legit compiler warnings in new pickle code on 32-bit Windows

2013-11-25 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Thanks Zachary for the notice! Look like my change fixed the warnings on the 
Windows x86 build.

http://buildbot.python.org/all/builders/x86%20Windows%20Server%202008%20%5BSB%5D%203.x/builds/1801

--
resolution:  - fixed
status: open - closed

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



[issue17787] Optimize pickling function dispatch in hot loops.

2013-11-24 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

The patch is too complicated for too little.

--
resolution:  - rejected
stage: patch review - committed/rejected
status: open - closed

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



[issue17747] Deprecate pickle fast mode

2013-11-24 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
resolution:  - wont fix
stage: needs patch - committed/rejected
status: open - closed

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



[issue15397] Unbinding of methods

2013-11-23 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


--
resolution:  - duplicate
status: open - closed
superseder:  - Implement PEP 3154 (pickle protocol 4)

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-11-23 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

I've finalized the framing implementation in de9bda43d552.

There will be more improvements to come until 3.4 final. However, feature-wise 
we are done. Thank you everyone for the help!

--
status: open - closed

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-11-18 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

I have been looking again at Stefan's previous proposal of making memoization 
implicit in the new pickle protocol. While I liked the smaller pickles it 
produced, I didn't the invasiveness of the implementation, which requires a 
change for almost every opcode processed by the Unpickler. This led me to, what 
I think is, a reasonable compromise between what we have right now and Stefan's 
proposal. That is we can make the argument of the PUT opcodes implicit, without 
making the whole opcode implicit.

I've implemented this by introducing a new opcode MEMOIZE, which stores the top 
of the pickle stack using the size of the memo as the index. Using the memo 
size as the index avoids us some extra bookkeeping variables and handles nicely 
situations where Pickler.memo.clear() or Unpickler.memo.clear() are used.

Size-wise, this brings some good improvements for pickles containing a lot of 
dicts and lists.

# Before
$ ./python.exe -c import pickle; print(len(pickle.dumps([[] for _ in 
range(1000)], 4)))
5251

# After with new MEMOIZE opcode
./python.exe -c import pickle; print(len(pickle.dumps([[] for _ in 
range(1000)], 4)))
2015

Time-wise, the change is mostly neutral. It makes pickling dicts and lists 
slightly faster because it simplifies the code for memo_put() in _pickle.

Report on Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; 
root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64 i386
Total CPU cores: 4

### pickle4_dict ###
Min: 0.714912 - 0.667203: 1.07x faster
Avg: 0.741616 - 0.685567: 1.08x faster
Significant (t=16.25)
Stddev: 0.02033 - 0.01346: 1.5102x smaller
Timeline: http://goo.gl/iHqCfB

### pickle4_list ###
Min: 0.414151 - 0.398913: 1.04x faster
Avg: 0.432094 - 0.409058: 1.06x faster
Significant (t=11.83)
Stddev: 0.01049 - 0.00893: 1.1749x smaller
Timeline: http://goo.gl/wfQzgL

Anyhow, I have committed this improvement in my pep-3154 branch 
(http://hg.python.org/features/pep-3154-alexandre/rev/8a2861aaef82) for now, 
though I will happily revert it if people oppose to the change.

--

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



[issue17893] Refactor reduce protocol implementation

2013-11-17 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Merged with issue #17810

--
resolution:  - duplicate
status: open - closed
superseder:  - Implement PEP 3154 (pickle protocol 4)

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-11-15 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


Added file: http://bugs.python.org/file32639/f87b455af573.diff

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-11-15 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


Added file: http://bugs.python.org/file32640/8434af450da0.diff

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-11-15 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


Removed file: http://bugs.python.org/file32639/f87b455af573.diff

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-11-15 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Hi folks,

I consider my implementation of PEP-3154 mostly feature complete at this point. 
I still have a few things left to do. For example, I need to update the 
documentation about the new protocol. However, these can mostly be done along 
the review process. Plus, I definitely prefer getting feedback sooner. :-) 

Please review at:

http://bugs.python.org/review/17810/

Thanks!

--
stage: needs patch - patch review

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



[issue19301] Globals declared in function scope have wrong __qualname__

2013-10-20 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

It seems that we are missing support for nested globals:

 def f():
...   global C
...   class C:
... class D:
...   pass
...
 f()
 C.D.__qualname__
'f.locals.C.D'

--
status: closed - open

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



[issue19301] Globals declared in function scope have wrong __qualname__

2013-10-19 Thread Alexandre Vassalotti

New submission from Alexandre Vassalotti:

The value of __qualname__ for globals declared in function scope doesn't seems 
right to me:

 def f():
...global C
...class C: pass
...return C.__qualname__
...
 f()
'f.locals.C'

It would be much more useful to return 'C' in this case. In my case, fixing 
this would help me write cleaner unit tests for pickle, since it would allow me 
to keep test classes with their test code.

--
assignee: alexandre.vassalotti
messages: 200453
nosy: alexandre.vassalotti, pitrou
priority: high
severity: normal
stage: needs patch
status: open
title: Globals declared in function scope have wrong __qualname__
type: behavior
versions: Python 3.4

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



[issue19301] Globals declared in function scope have wrong __qualname__

2013-10-19 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Supporting nonlocal variables would be nice. However, unless it is easy to 
implement, I don't think it is worth the effort since these variables can't be 
accessed outside the enclosing function's scope.

--

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



[issue2919] Merge profile/cProfile in 3.n+1

2013-10-14 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Let's close this. There is no point keeping this languishing any further.

The profile and cProfile modules are different enough that we can't merge them 
without breaking compatibility. They should treated as two separate profilers.

Maybe in the future we should include a drop-in module written in Python for 
cProfile to be used for another Python implementation. But for now, I don't see 
the benefit, since the profile module is good enough and alternate 
implementations should be able to re-do the _lsprof accelerator in their target 
language without too much trouble if desired.

--
assignee:  - alexandre.vassalotti
resolution:  - wont fix
status: open - closed

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-08-18 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

I am still working on it. I am implemented support for nested globals last week 
(http://hg.python.org/features/pep-3154-alexandre/rev/c8991b32a47e). At this 
point, the only big piece remaining is the support for method descriptors. 
There are other minor things left but we can worry about those later.

Nick, thanks for the pointer! I didn't know about PEP 451. I will look how we 
can use it in pickle.

--

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-06-03 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Stefan, could you address my review comments soon? The improved support for 
globals is the only big piece missing from the implementation of PEP, which I 
would like to get done and submitted by the end of the month.

--

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



[issue17900] Recursive OrderedDict pickling

2013-05-20 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

The patch looks good to me. So go ahead and submit it. :)

--

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-05-12 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Stefan, I took a quick look at your patch. There is a couple things that stands 
out.

First, I think the implementation of BINGLOBAL and BINGLOBAL_BIG should be 
moved to another patch. Adding a binary version opcode for GLOBAL is a separate 
feature and it should be reviewed independently. Personally, I prefer the 
STACK_GLOBAL opcode I proposed as it much simpler to implement, but I am biased.

Next, the patch's formatting should be fixed to conform to PEP 7 and PEP 8. 
Make sure the formatting is consistent with the surrounding code. In 
particular, comments should be full sentences that explains why we need this 
code. Avoid adding comments that merely say what the code does, unless the code 
is complex.

In addition, please replace the uses of PyUnicode_InternFromString with the 
_Py_IDENTIFIER as needed. The latter allow the static strings to be garbage 
collected when the module is deleted, which is friendlier to embedded 
interpreters. It is also lead to cleaner code.

Finally, the class method check hack looks like a bug to me. There are multiple 
solutions here. For example, we could fix class methods to be cached so they 
always have the same ID once they are created. Or, we could remove the 'is' 
check completely if it is unnecessary.

--

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-05-11 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Thanks Stefan for the patch. It's very much appreciated. I will try to review 
it soon.

Of the features you proposed, the twos I would like to take a look again is 
implicit memoization and the BAIL_OUT opcode. For the implicit memoization 
feature, we will need to have some performance results in hand to justify the 
major changes it needs. If you can you work out a quick patch, I can run it 
through the benchmarks suite for pickle and measure the impact. Hopefully, we 
will see a good improvement though we can't be sure until we measure.

And as for the BAIL_OUT opcode, it would be interesting to revisit its use now 
that we support binary framing. It could be helpful to add it to prevent the 
Unpickler from hanging if the other end forgot to close the stream. I am still 
not totally convinced. However if you make a good case for it, I would support 
to see it included.

--
Added file: http://bugs.python.org/file30229/pickle4+methods.patch

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



[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-05-11 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti alexan...@peadrop.com:


Removed file: http://bugs.python.org/file30229/pickle4+methods.patch

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



  1   2   3   4   5   6   >