[issue9120] Reduce pickle size for an empty set

2010-06-30 Thread Alexandre Vassalotti
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

[issue9104] test_exceptions does not test pickling with pickle.py

2010-06-30 Thread Alexandre Vassalotti
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

[issue1745] Backport of PEP 3102 "keyword-only arguments" to 2.6

2010-07-06 Thread Alexandre Vassalotti
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

[issue2570] backport 3.0-style \u/\U processing in raw strings when unicode_literals is imported from __future__

2010-07-06 Thread Alexandre Vassalotti
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

[issue2570] backport 3.0-style \u/\U processing in raw strings when unicode_literals is imported from __future__

2010-07-06 Thread Alexandre Vassalotti
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

[issue5180] 3.1 cannot unpickle 2.7-created pickle

2010-07-17 Thread Alexandre Vassalotti
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

[issue9268] Add annotation option to pickletools.dis

2010-07-17 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: LGTM -- ___ Python tracker <http://bugs.python.org/issue9268> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5180] 3.1 cannot unpickle 2.7-created pickle

2010-07-17 Thread Alexandre Vassalotti
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

[issue3873] Unpickling is really slow

2010-07-28 Thread Alexandre Vassalotti
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

[issue5077] 2to3 fixer for the removal of operator functions

2010-07-28 Thread Alexandre Vassalotti
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

[issue9410] Add Unladden Swallow's optimizations to Python 3's pickle.

2010-07-28 Thread Alexandre Vassalotti
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

[issue9276] pickle should support methods

2010-08-02 Thread Alexandre Vassalotti
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

[issue5077] 2to3 fixer for the removal of operator functions

2010-08-05 Thread Alexandre Vassalotti
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.

[issue5077] 2to3 fixer for the removal of operator functions

2010-08-05 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: Documentation added in r83741. -- ___ Python tracker <http://bugs.python.org/issue5077> ___ ___ Python-bugs-list mailin

[issue1474680] pickling files works with protocol=2.

2010-08-05 Thread Alexandre Vassalotti
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 -&

[issue6290] cPickle can misread data type

2010-08-05 Thread Alexandre Vassalotti
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

[issue5671] Speed up pickling of lists in cPickle

2010-08-05 Thread Alexandre Vassalotti
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

[issue6361] I/O object wrappers shouldn't close their underlying file when deleted.

2010-08-05 Thread Alexandre Vassalotti
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:

[issue9410] Add Unladen Swallow's optimizations to Python 3's pickle.

2010-08-05 Thread Alexandre Vassalotti
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

[issue5683] Speed up cPickle's pickling generally

2010-08-05 Thread Alexandre Vassalotti
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

[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 i

[issue16551] Cleanup the pure Python pickle implementation

2013-04-07 Thread Alexandre Vassalotti
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

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

2013-04-13 Thread Alexandre Vassalotti
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

[issue17711] Persistent id in pickle with protocol version 0

2013-04-13 Thread Alexandre Vassalotti
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

[issue17710] SystemError in cPickle for incorrect input

2013-04-13 Thread Alexandre Vassalotti
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

[issue17710] SystemError in cPickle for incorrect input

2013-04-13 Thread Alexandre Vassalotti
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.

[issue17710] SystemError in cPickle for incorrect input

2013-04-13 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti : Removed file: http://bugs.python.org/file29824/fix_quoted_string_python3.patch ___ Python tracker <http://bugs.python.org/issue17

[issue17711] Persistent id in pickle with protocol version 0

2013-04-13 Thread Alexandre Vassalotti
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

[issue10701] Error pickling a dict

2013-04-13 Thread Alexandre Vassalotti
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

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

2013-04-13 Thread Alexandre Vassalotti
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

[issue17747] Deprecate pickle fast mode

2013-04-16 Thread Alexandre Vassalotti
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

[issue17785] Use faster URL shortener for perf.py

2013-04-17 Thread Alexandre Vassalotti
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

[issue17787] Optimize pickling function dispatch in hot loops.

2013-04-18 Thread Alexandre Vassalotti
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

[issue3693] Obscure array.array error message

2013-04-19 Thread Alexandre Vassalotti
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

[issue17785] Use faster URL shortener for perf.py

2013-04-20 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

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

2013-04-20 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

[issue17787] Optimize pickling function dispatch in hot loops.

2013-04-20 Thread Alexandre Vassalotti
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

[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-04-20 Thread Alexandre Vassalotti
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

[issue15642] Integrate pickle protocol version 4 GSoC work by Stefan Mihaila

2013-04-20 Thread Alexandre Vassalotti
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

[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-04-20 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti : -- dependencies: +Unbinding of methods ___ Python tracker <http://bugs.python.org/issue17810> ___ ___ Python-bugs-list mailin

[issue16231] pickle persistent_id return value

2013-04-23 Thread Alexandre Vassalotti
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

[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-04-29 Thread Alexandre Vassalotti
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

[issue17892] Fix the name of _PyObject_CallMethodObjIdArgs

2013-05-02 Thread Alexandre Vassalotti
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

[issue17893] Refactor reduce protocol implementation

2013-05-02 Thread Alexandre Vassalotti
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

[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-05-02 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti : -- dependencies: +Refactor reduce protocol implementation ___ Python tracker <http://bugs.python.org/issue17810> ___ ___ Pytho

[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-05-02 Thread Alexandre Vassalotti
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

[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-05-02 Thread Alexandre Vassalotti
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

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

2013-05-02 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti : -- dependencies: +Implement PEP 3154 (pickle protocol 4) ___ Python tracker <http://bugs.python.org/issue4727> ___ ___ Python-bug

[issue11872] cPickle gives strange error for large objects.

2013-05-02 Thread Alexandre Vassalotti
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

[issue9276] pickle should support methods

2013-05-02 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti : -- dependencies: +Implement PEP 3154 (pickle protocol 4) ___ Python tracker <http://bugs.python.org/issue9276> ___ ___ Python-bug

[issue17565] segfaults during serialization

2013-05-02 Thread Alexandre Vassalotti
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

[issue14290] Importing script as module causes ImportError with pickle.load

2013-05-02 Thread Alexandre Vassalotti
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: ->

[issue12596] cPickle - stored data differ for same dictionary

2013-05-02 Thread Alexandre Vassalotti
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

[issue892902] problem with pickling newstyle class instances

2013-05-02 Thread Alexandre Vassalotti
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

[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-05-03 Thread Alexandre Vassalotti
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

[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-05-03 Thread Alexandre Vassalotti
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

[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-05-03 Thread Alexandre Vassalotti
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

[issue17897] Optimize unpickle prefetching

2013-05-03 Thread Alexandre Vassalotti
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

[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-05-03 Thread Alexandre Vassalotti
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

[issue13503] improved efficiency of bytearray pickling by using bytes type instead of str

2013-05-06 Thread Alexandre Vassalotti
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

[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 featur

[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-05-11 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti : Removed file: http://bugs.python.org/file30229/pickle4+methods.patch ___ Python tracker <http://bugs.python.org/issue17810> ___ ___ Pytho

[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

[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 <http://bugs.python.org/issue17

[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

[issue24736] argparse add_mutually_exclusive_group do not print help

2015-07-27 Thread Alexandre Badez
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

[issue24736] argparse add_mutually_exclusive_group do not print help

2015-08-19 Thread Alexandre Badez
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

[issue23517] datetime.utcfromtimestamp parses timestamps incorrectly

2015-08-27 Thread Alexandre Conrad
Changes by Alexandre Conrad : -- nosy: +aconrad ___ Python tracker <http://bugs.python.org/issue23517> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25573] traceback documentation example is lying about FrameSummary repr()

2015-11-06 Thread Alexandre Macabies
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

[issue46706] AxelRacer

2022-02-09 Thread claude-alexandre cabana
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

<    2   3   4   5   6   7