Alexandre Vassalotti added the comment:
> This begs a question, however: why not use regular python bytecode in pickles?
Unlike pickle protocols, the bytecode is not required to be compatible across
Python versions. Furthermore, Python bytecode is designed has a general purpose
obj
Alexandre Vassalotti added the comment:
> It works for pickle/_pickle and heapq/_heapq, but won't work for io/_io/_pyio.
You can make the dictionary values as lists for the 'blocked' argument for
import_fresh_module(). That would work.
And, can you add
Alexandre Vassalotti added the comment:
Now, that 2.7 is out we won't able to commit this anymore. It is sad to abandon
a good patch like this.
--
resolution: -> wont fix
stage: patch review -> committed/rejected
status: open -> closed
Alexandre Vassalotti added the comment:
Closing this since Python 2.7 is out now.
--
nosy: +alexandre.vassalotti
resolution: -> wont fix
stage: needs patch -> committed/rejected
status: open -> closed
___
Python tracker
<http://bug
Alexandre Vassalotti added the comment:
Actually, you are right. This could be added as bug fix.
--
resolution: wont fix ->
stage: committed/rejected -> needs patch
status: closed -> open
___
Python tracker
<http://bugs.python.o
Alexandre Vassalotti added the comment:
I have fixed some style nits in your patch. It would be nice to have tests for
the different control paths in instantiate(). But, I realize that would be a
bit annoying.
Apart from that, the patch looks good.
--
Added file: http
Alexandre Vassalotti added the comment:
LGTM
--
___
Python tracker
<http://bugs.python.org/issue9268>
___
___
Python-bugs-list mailing list
Unsubscribe:
Alexandre Vassalotti added the comment:
The args argument is always a tuple created with Pdata_poptuple(). You can add
an explicit type check. If this check fails a RuntimeError should be raised,
because this would indicate a programming error in pickle
Alexandre Vassalotti added the comment:
Victor, have you tried using peek() instead of seek()? I mentioned this
previously in msg85780.
--
___
Python tracker
<http://bugs.python.org/issue3
Alexandre Vassalotti added the comment:
The patch look great. Can you update your patch to make it work against the
version of 2to3 in the sandbox (http://svn.python.org/sandbox/trunk/2to3)?
--
___
Python tracker
<http://bugs.python.org/issue5
New submission from Alexandre Vassalotti :
This is a big patch. Please review at http://codereview.appspot.com/1694050/show
This patch adds the most interesting optimizations from Unladen Swallow to
Python 3's pickle.
The core of the patch already been reviewed by Antoine and me
Alexandre Vassalotti added the comment:
The security issue mentioned previously has been known for years. And, it is
easy to protect against. See
http://docs.python.org/py3k/library/pickle.html#restricting-globals
Also I am against adding pickling support to code objects. Code objects have
Alexandre Vassalotti added the comment:
Patch committed in r83740. I will make the documentation update in a separate
commit.
Thanks!
--
resolution: -> accepted
stage: patch review -> committed/rejected
status: open -> closed
versions: -Python 2.6, Python 2.7, Python 3.
Alexandre Vassalotti added the comment:
Documentation added in r83741.
--
___
Python tracker
<http://bugs.python.org/issue5077>
___
___
Python-bugs-list mailin
Alexandre Vassalotti added the comment:
Although it is tempting to fix this, it feels to much like a feature. I am
closing as won't fix because we don't add new features to 2.x.
--
resolution: -> wont fix
stage: needs patch -> committed/rejected
status: open -&
Alexandre Vassalotti added the comment:
It is too late for 2.6.6 now that it is released.
--
resolution: -> wont fix
stage: -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.o
Alexandre Vassalotti added the comment:
It is too late now for the 2.x version. And, the huge patch in issue 9410
includes an updated version of this patch for 3.x.
--
resolution: -> duplicate
stage: -> committed/rejected
status: open -> closed
superseder: -> Add Unlad
Alexandre Vassalotti added the comment:
OK I am convinced, the current behavior is fine. Let's close this one.
--
resolution: -> wont fix
stage: needs patch -> committed/rejected
status: open -> closed
___
Python tracker
<http:
Alexandre Vassalotti added the comment:
Ah, that's right Skip. You did fixed it in Unladen Swallow's trunk. I will take
a look at your solution.
http://code.google.com/p/unladen-swallow/source/diff?spec=svn1167&r=1038&format=side&path=/trunk/Modules/cPickle.c&old_pat
Alexandre Vassalotti added the comment:
Too late to make this change in 2.x. And the patch in issue 9410 includes the
optimization for 3.x.
--
resolution: -> duplicate
stage: patch review -> committed/rejected
status: open -> closed
superseder: -> Add Unladen Swallow
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 i
Alexandre Vassalotti added the comment:
My point is I would prefer that we keep all optimizations to only the _pickle C
module and keep the Python implementation as simple as possible.
Also, I doubt the slight speedup shown by your microbenchmark will actually
result in any significant
New submission from Alexandre Vassalotti:
In pickle.py, load_appends is currently defined as
def load_appends(self):
stack = self.stack
mark = self.marker()
list = stack[mark - 1]
list.extend(stack[mark + 1:])
del stack[mark:]
However, according to
Alexandre Vassalotti added the comment:
In protocol 0, the persistent ID is restricted to alphanumeric strings because
of the problems that arise when the persistent ID contains newline characters.
_pickle likely should be changed to use the ASCII decoded. And perhaps, we
should check for
Alexandre Vassalotti added the comment:
I also wrote a patch for this. I took I slightly different approach though. I
fixed the C implementation to be more strict on the quoting. Currently, it
strips trailing non-printable characters, something pickle.py doesn't do.
I also cleaned u
Alexandre Vassalotti added the comment:
I was targeting head, not the release branches. It is fine to change the
exception there as we don't make any guarantee about the exceptions raised
during the unpickling process. It is easy enough to fix patch use ValueError
for the release branch.
Changes by Alexandre Vassalotti :
Removed file: http://bugs.python.org/file29824/fix_quoted_string_python3.patch
___
Python tracker
<http://bugs.python.org/issue17
Alexandre Vassalotti added the comment:
Here's a patch that fix the bug.
--
assignee: -> alexandre.vassalotti
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file29842/fix_bad_persid.patch
___
Pyt
Alexandre Vassalotti added the comment:
The mutating __getstate__ is very likely the problem here. I've attached a
small test case which shows the described behavior.
We could fix this by always making a copy of any mutable container we want to
iterate over to save its items. Perfor
Alexandre Vassalotti added the comment:
Alright alright! Here's a less bogus patch. :)
--
stage: needs patch -> patch review
Added file: http://bugs.python.org/file29846/fix_loads_appends.patch
___
Python tracker
<http://bugs.python.org
New submission from Alexandre Vassalotti:
Pickle fast mode is currently a deprecated feature of the Pickler class used to
disable its memoization mechanism. It was used mainly to create smaller output
by not emitting a PUT opcode for each object saved. Unfortunately, this mode
only worked
New submission from Alexandre Vassalotti:
As noted previously, TinyURL URL shortening API is rather slow and not always
available. Each requests takes between 0.5 and 1.5 seconds.
We should change it to use Google URL Shortener which returns a response within
10 milliseconds and is much more
Alexandre Vassalotti added the comment:
In addition, we could bring back the switch dispatch based on the first letter
of the type name. It does seem to speed up things as well but as much as the
type cache optimization.
--
nosy: +pitrou, serhiy.storchaka
title: Optimize pickling
Alexandre Vassalotti added the comment:
Here's a patch to fix the exception.
--
keywords: +patch
Added file: http://bugs.python.org/file29949/fix_array_err_msg.patch
___
Python tracker
<http://bugs.python.org/i
Changes by Alexandre Vassalotti :
--
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Changes by Alexandre Vassalotti :
--
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Alexandre Vassalotti added the comment:
Are you asking why do we need to call both PyMemoTable_Get and memo_get? Or,
why do we fetching the memo was moved to the save functions? For the former,
there is no real reason. The extra call could be removed though profiling
doesn't show this ca
New submission from Alexandre Vassalotti:
I have restarted the work on PEP 3154. Stefan Mihaila had begun an
implementation as part of the Google Summer of Code 2012. Unfortunately, he hit
multiple roadblocks which prevented him to finish his work by the end of the
summer. He previously shown
Alexandre Vassalotti added the comment:
I have started a new implementation of PEP 3154 since Stefan hasn't been active
on his. Moving the discussion to Issue #17810.
--
dependencies: -Unbinding of methods
resolution: -> out of date
stage: patch review -> committed/reje
Changes by Alexandre Vassalotti :
--
dependencies: +Unbinding of methods
___
Python tracker
<http://bugs.python.org/issue17810>
___
___
Python-bugs-list mailin
Alexandre Vassalotti added the comment:
I think it should be fixed though it is not a high-priority issue.
--
___
Python tracker
<http://bugs.python.org/issue16
Alexandre Vassalotti added the comment:
Antoine, I removed STACK_GLOBAL when I found performance issues with the
implementation. The changeset that added it had some unrelated changes that
made it harder to debug than necessary. I am planning to re-add it when I
worked out the kinks
New submission from Alexandre Vassalotti:
The changeset 2dd046be2c88 introduced _PyObject_CallMethodObjIdArgs. This API
should have been named _PyObject_CallMethodIdObjArgs since it is the variant of
_PyObject_CallMethodId which takes object arguments instead of building
arguments from a
New submission from Alexandre Vassalotti:
I have tried to clean up a bit of the implementation of the reduce protocol in
typeobject.c in preparation for PEP 3154's support of classes with __new__
using keyword-only arguments. I am not quite done yet with the refactorings,
but I
Changes by Alexandre Vassalotti :
--
dependencies: +Refactor reduce protocol implementation
___
Python tracker
<http://bugs.python.org/issue17810>
___
___
Pytho
Alexandre Vassalotti added the comment:
The latest framing patch looks pretty nice overall. One concern is we need to
make sure the C implementation call _Pickler_OpcodeBoundary often enough to
keep the frames around the sizes. For example, batch_save_list and
batch_save_dict can currently
Alexandre Vassalotti added the comment:
> I don't understand how that can happen. batch_list() and batch_dict()
> both call save() for each item, and save() calls
> _Pickler_OpcodeBoundary() at the end. Have I missed something?
Ah, you're right. I was thinking in terms of my
Changes by Alexandre Vassalotti :
--
dependencies: +Implement PEP 3154 (pickle protocol 4)
___
Python tracker
<http://bugs.python.org/issue4727>
___
___
Python-bug
Alexandre Vassalotti added the comment:
It is an integer overflow issue. It is easy to reproduce without numpy:
$ python2.7 -c "import cPickle; cPickle.dumps('\x00' * 2**31)"
Traceback (most recent call last):
File "", line 1, in
SystemError: error return withou
Changes by Alexandre Vassalotti :
--
dependencies: +Implement PEP 3154 (pickle protocol 4)
___
Python tracker
<http://bugs.python.org/issue9276>
___
___
Python-bug
Alexandre Vassalotti added the comment:
If you are pickling large objects, you're likely hitting issue #11872. We fixed
most 64-bit issues in Python 3, so upgrading might be solution if possible.
Since the particular bug you are hitting cannot be reproduced with your test
case, I am cl
Alexandre Vassalotti added the comment:
Without a test case, we cannot tell if this is a bug in pickle or not. Anyhow,
Floris's explanation is pretty much on the dot as why you might see this error.
--
nosy: +alexandre.vassalotti
resolution: -> works for me
stage: ->
Alexandre Vassalotti added the comment:
There is no guarantee the binary representation of pickled data will be same
between different runs. We try to make it mostly consistent when we can, but
there are cases, like this one, where we cannot ensure consistency without
hurting performance
Alexandre Vassalotti added the comment:
I fixed this while working on PEP 3154
[http://hg.python.org/features/pep-3154-alexandre/rev/eed9142d664f]. The
relevant piece is
@@ -420,7 +424,13 @@ class _Pickler:
write(REDUCE)
if obj is not None:
-self.memoize
Alexandre Vassalotti added the comment:
I am currently fleshing out an improved implementation for the reduce protocol
version 4. One thing I am curious about is whether we should keep the special
cases we currently have there for dict and list subclasses.
I recall Raymond expressed
Alexandre Vassalotti added the comment:
Those methods wouldn't be much more a maintenance burden than the special cases
already present in the implementation of __reduce__. These methods would only
need to be provided by classes that wishes to support efficient in-place
pickling provid
Alexandre Vassalotti added the comment:
The framing patch seems to have a significant negative effect on performance.
Report on Linux avassalotti 3.2.5-gg1130 #1 SMP Mon Feb 4 02:25:47 PST 2013
x86_64 x86_64
Total CPU cores: 12
### fastpickle ###
Min: 0.447194 -> 0.505841: 1.13x slower
Alexandre Vassalotti added the comment:
Do you have benchmark results to show the code with the patch is faster?
--
___
Python tracker
<http://bugs.python.org/issue17
Alexandre Vassalotti added the comment:
Antoine, can you share the code for your benchmarks which show performance
improvements when framing is enabled? I am seeing the same 10-15% slowdown even
when pickling stuff to pure Python objects:
### Without the patch
./python -m timeit -r 50 -s
Alexandre Vassalotti added the comment:
Our hands are pretty much tied here. The pickle bytearray as unicode hack is
likely the best we can do without pickling compatibility between Python 2 and
3. I can't think of a solution that could work here. For example.
1. Pickling bytearrays
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
featur
Changes by Alexandre Vassalotti :
Removed file: http://bugs.python.org/file30229/pickle4+methods.patch
___
Python tracker
<http://bugs.python.org/issue17810>
___
___
Pytho
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
Alexandre Vassalotti added the comment:
The patch looks good to me. So go ahead and submit it. :)
--
___
Python tracker
<http://bugs.python.org/issue17
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
New submission from Alexandre Badez:
Hi,
Here is a sample of what I do:
>>> import argparse
>>> main_parser = argparse.ArgumentParser()
>>> group_ex = main_parser.add_mutually_exclusive_group()
>>> group_ex1 = group_ex.add_argument_group()
>>> group
Alexandre Badez added the comment:
@paul: thanks, I'm very surprised because the parsing work well.
It's just the display that do not.
Moreover it's not said in the documentation that you cannot nest groups.
So maybe we should update the documentation and/or imp
Changes by Alexandre Conrad :
--
nosy: +aconrad
___
Python tracker
<http://bugs.python.org/issue23517>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Alexandre Macabies:
https://docs.python.org/3.5/library/traceback.html#traceback-examples
See second code sample and its sample output. According to the docs, the call:
print(repr(traceback.extract_tb(exc_traceback)))
is supposed to print something that looks like an
Change by claude-alexandre cabana :
--
components: Build
nosy: claudealexcabana
priority: normal
severity: normal
status: open
title: AxelRacer
type: performance
versions: Python 3.11
___
Python tracker
<https://bugs.python.org/issue46
601 - 670 of 670 matches
Mail list logo