[issue2389] Array pickling exposes internal memory representation of elements

2009-06-26 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Here's a patch that implements the solution I described in msg85298. Please give it a good review: http://codereview.appspot.com/87072 -- Added file: http://bugs.python.org/file14369/portable_array_pickling.diff

[issue6290] cPickle can misread data type

2009-06-22 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Thanks for the test case. I will take a look. -- assignee: georg.brandl - alexandre.vassalotti components: +Library (Lib) -Documentation, Extension Modules, Windows ___ Python tracker rep

[issue6290] cPickle can misread data type

2009-06-22 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Could you give me the output of this? import cPickle print repr(cPickle.dumps([float('+inf'), float('-inf'), float('nan')])) print [float('+inf'), float('-inf'), float('nan')] By the way, are you sure this bug occurs on Python

[issue6290] cPickle can misread data type

2009-06-15 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Could you provide a test case? The behaviour you are describing sounds like a bug in cPickle. -- nosy: +alexandre.vassalotti ___ Python tracker rep...@bugs.python.org http

[issue5596] memory leaks in 3.1

2009-06-12 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: These tests are leaking on my build of r73393: test_docxmlrpc leaked [0, 0, 85, 0, 0, -85, 0, 0, 0, 0] references, sum=0 test_popen leaked [0, 23, -23, 0, 23, 0, -23, 23, -23, 23] references, sum=23 test_urllib leaked [4, 4, 4, 4, 6

[issue6215] Backport the IO lib to trunk

2009-06-12 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Could simply merge the changes in r71185 to the PC/ and PCbuild/ directories? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6215

[issue6127] Unexpected universal newline behavior (newline duplication) in Windows

2009-06-12 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Patch backported in r73399. Thanks! -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6127

[issue6242] Fix reference leak in io.StringIO

2009-06-09 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Why do you need all this? Isn't it enough to take a weakref and check the callback is triggered? No, because you would need a weak reference to the instance's __dict__, which is unavailable for io.StringIO. Anyway, here's

[issue6215] Backport the IO lib to trunk

2009-06-09 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: I think the build configuration for _io on Windows is missing. Modules/Setup.dist probably needs to be updated too. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue6215] Backport the IO lib to trunk

2009-06-09 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Not sure, I don't think any of these modules are built-in. Ah true. Although there are built-in in py3k, you are right that it doesn't make sense to make the trunk versions built

[issue2919] Merge profile/cProfile in 3.0

2009-06-09 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Jean Brouwers wrote: All tests passed after regenerating the expected results The tests for profile are output test. If you regenerate them, they pass for sure. Merging cProfile/profile will require a lot more work than just

[issue1032] Improve the hackish runtime_library_dirs support for gcc

2009-06-09 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: -- resolution: - duplicate status: open - closed superseder: - GCC detection for runtime_library_dirs when ccache is used ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue5437] Singleton MemoryError can hold traceback data and locals indefinitely

2009-06-09 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Honestly, I don't think it is a big issue. MemoryErrors are rare and typically cause the interpreter to shutdown. By the way, do you think the static PyExc_RecursionErrorInst object is affected by this bug? -- nosy

[issue1944] Documentation for PyUnicode_AsString (et al.) missing.

2009-06-08 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: The patch looks alright. I don't like the documentation for PyUnicode_FromFormatV, however. Here's my attempt to document it: .. cfunction:: PyObject* PyUnicode_FromFormatV(const char *format, va_list vargs) Equivalent

[issue6241] Better type checking for the arguments of io.StringIO

2009-06-08 Thread Alexandre Vassalotti
New submission from Alexandre Vassalotti alexan...@peadrop.com: The included patch makes type checking of the arguments of StringIO consistent between pyio and io. import io io.StringIO(bhello) Traceback (most recent call last): ... ValueError: initial_value must be str or None, not bytes

[issue6242] Fix reference leak in io.StringIO

2009-06-08 Thread Alexandre Vassalotti
New submission from Alexandre Vassalotti alexan...@peadrop.com: io.StringIO does not clear its reference to its attributes dictionary when deleted. This causes a leak when io.StringIO has attributes. def leak(): ...for _ in range(100): ... f = io.StringIO() ... f.foo = 1

[issue6218] Make io.BytesIO and io.StringIO picklable.

2009-06-08 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: I split the bug fixes in the patch into two separate issues. It looks like pickling support for io.StringIO and io.BytesIO will have to wait for 3.2. -- dependencies: +Better type checking for the arguments of io.StringIO

[issue3816] __newobj__ pickle feature is not documented

2009-06-08 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Closing as the feature is documented in the section The __newobj__ unpickling function of PEP 307. -- assignee: georg.brandl - resolution: - invalid status: open - closed ___ Python

[issue6218] Make io.BytesIO and io.StringIO picklable.

2009-06-05 Thread Alexandre Vassalotti
New submission from Alexandre Vassalotti alexan...@peadrop.com: Here is a patch to add pickling support to io.BytesIO and io.StringIO. Although they are non-trivial, the additions were made with a fair amount of care (and love!) and thus I believe they could be included in 3.1. Furthermore

[issue6137] Make pickle generated by Python 3.x compatible with 2.x and vice-versa.

2009-06-04 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Oops. Here is a new patch with _compat_pickle.py. -- Added file: http://bugs.python.org/file14186/compat_pickle7.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue6127] Unexpected universal newline behavior (newline duplication) in Windows

2009-06-04 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Can you check if the patch in issue #5645 fix the bug? -- nosy: +alexandre.vassalotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6127

[issue5373] TypeError when '\x00' in docstring

2009-06-03 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Patch committed in r73195. -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5373

[issue6137] Make pickle generated by Python 3.x compatible with 2.x and vice-versa.

2009-06-03 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Here is an updated patch based on Antoine's latest patch. Summary of changes: * Updated docstrings of Pickler and Unpickler in the pickle module. * Fixed pickle._Pickler to consider fix_imports only for protocol 3 * Made module

[issue3675] Python 2.6 can't read sets pickled with Python 3.0

2009-06-03 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Superseded by issue #6137. -- resolution: - duplicate status: open - closed superseder: - Make pickle generated by Python 3.x compatible with 2.x and vice-versa. ___ Python tracker rep

[issue6151] Make PyDescr_COMMON conform to standard C

2009-05-30 Thread Alexandre Vassalotti
New submission from Alexandre Vassalotti alexan...@peadrop.com: PyDescrObject make use of the some undefined behavior noted in PEP 3123 for PyObject in Python 2.x. Although fixing this requires breaking backward-compatibility, this shouldn't be much a problem since PyDescrObject is only used

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-05-30 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: If I understood correctly, #3675 is about making pickle data generated by Python 3 readable by Python 2. However, this issue is about compatibility in the other direction—i.e., making Python 2 pickles readable by Python 3, which

[issue956303] Update pickle docs to describe format of persistent IDs

2009-05-30 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: The updated documentation for pickle for Python 3 describes the requirement that persistent IDs should be alphanumeric strings when protocol 0 is used. http://docs.python.org/3.0/library/pickle.html#persistence-of-external-objects

[issue5794] pickle/cPickle of recursive tuples create pickles that cPickle can't load

2009-05-25 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Looks good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5794

[issue1761028] pickle - cannot unpickle circular deps with custom __hash__

2009-05-25 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Checked this out more throughly and I came to the conclusion this cannot be fixed without a considerable amount of work. The problem is pickle adds an Node instance stub in the next_nodes set before its attributes are ready. Since

[issue6066] POP_MARK was not in pickle protocol 0

2009-05-19 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: SHORT_BINBYTES needs to be corrected as well; pickletools lists it as part of protocol 0 instead of protocol 3. I doubt backporting this patch to 2.6 will cause any trouble. So, you can go forward

[issue5265] StringIO can duplicate newlines in universal newlines mode

2009-05-12 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Should this issue go under a new ticket? Yes, it would be preferable as the issue is probably not specific to io.StringIO. Also, make sure that you include the result of this test-case: open(testnl.txt, wb).write(foo\r\nbar\r\n

[issue5265] StringIO can duplicate newlines in universal newlines mode

2009-05-11 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: The bug shouldn't affect 2.6 and 2.7 unless you backported the now obsolete _stringio module from 3.0. I tested 2.6 and 2.7 and as expected I didn't see the bug: Python 2.6.2+ (release26-maint:72576, May 11 2009, 23:16:48) [GCC

[issue4753] Faster opcode dispatch on gcc

2009-04-11 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: -- nosy: -alexandre.vassalotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4753

[issue3873] Unpickling is really slow

2009-04-08 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Victor, Unpickler shouldn't raise an error if the given file object does support seek(); it should gracefully fall back to using only read() and readline(). Also, I think you could get a greater performance improvement by using peek

[issue5682] Move io-in-c modules into a subdirectory of Modules/

2009-04-04 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Committed in r71185. Thanks Antoine for the review! -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5682

[issue5596] memory leaks in 3.1

2009-04-04 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: I have the following tests leaking on my Linux build of py3k: test_structmembers leaked [102, 102, 102] references, sum=306 test_structmembers leaked [102, 102, 102] references, sum=306 test_structmembers leaked [102, 102, 102, 102

[issue5596] memory leaks in 3.1

2009-04-04 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Dismiss my last comment. These are the tests actually leaking for my build: test_docxmlrpc leaked [85, -6, 0, 39] references, sum=118 test_httpservers leaked [-195, 195, 0, 64] references, sum=64 test_os leaked [23, -23, 0, 23

[issue5345] cStringIO class name typo

2009-04-03 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: This is not a typo. cStringIO.StringIO is a factory function that returns either a cStringO object (for writing) or cStringI (for reading). If this behavior causes a problem to you, then consider using StringIO.StringIO

[issue2389] Array pickling exposes internal memory representation of elements

2009-04-03 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Ah, I just remembered the smart way I had devised some time ago to handle this issue without changing the constructor of array.array. The trick would be to add a __reduce__ method to array.array. This method would return a special

[issue3675] Python 2.6 can't read sets pickled with Python 3.0

2009-04-03 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Would it would be sufficient to add a function in the pickletools capable of converting old Python 2 pickles to the new format in Python 3? Alternatively, we could add a compatibility Unpickler class that would override the find_class

[issue5670] Speed up pickling of dicts in cPickle

2009-04-03 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Silly me, I had changed the PyDict_Size call in outer loop for Py_SIZE and this is of course totally wrong. Here's a good patch (I am pretty sure now! ;-) I ran the whole test suite and I saw no failures. Collin, you can go ahead

[issue5670] Speed up pickling of dicts in cPickle

2009-04-03 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Sigh... silly me again. There is some other junk in my last patch. -- Added file: http://bugs.python.org/file13598/pickle_batch_dict_exact_py3k-5.diff ___ Python tracker rep

[issue5670] Speed up pickling of dicts in cPickle

2009-04-03 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: Removed file: http://bugs.python.org/file13596/pickle_batch_dict_exact_py3k-3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5670

[issue5670] Speed up pickling of dicts in cPickle

2009-04-03 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: Removed file: http://bugs.python.org/file13597/pickle_batch_dict_exact_py3k-4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5670

[issue5682] Move io-in-c modules into a subdirectory of Modules/

2009-04-03 Thread Alexandre Vassalotti
New submission from Alexandre Vassalotti alexan...@peadrop.com: Here is a patch that moves the source files of the _io module (and closely related modules) into subdirectory of Modules. The new file hierarchy proposed is the following: Modules/ _io/ _iomodule.h _iomodule.c

[issue5682] Move io-in-c modules into a subdirectory of Modules/

2009-04-03 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: Added file: http://bugs.python.org/file13602/move-iomodule-in-subdir.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5682

[issue5682] Move io-in-c modules into a subdirectory of Modules/

2009-04-03 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Antoine, you're too quick. :-) By the way, the patch is fairly large due to the renaming. So, here's quick-and-dirty summary of the important changes. PCbuild/pythoncore.vcproj: Renamed the paths and added a Filter/ tag

[issue5682] Move io-in-c modules into a subdirectory of Modules/

2009-04-03 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Antoine wrote: - in Makefile.pre.in, it seems the IO_OBJS definition might need updating I updated the patch to also fix IO_OBJS. Also, I added stringio.c to IO_OBJS. Please note, when committing, it would be good to use svn mv

[issue5682] Move io-in-c modules into a subdirectory of Modules/

2009-04-03 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: Removed file: http://bugs.python.org/file13602/move-iomodule-in-subdir.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5682

[issue5682] Move io-in-c modules into a subdirectory of Modules/

2009-04-03 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: Removed file: http://bugs.python.org/file13604/move-iomodule-in-subdir-2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5682

[issue5682] Move io-in-c modules into a subdirectory of Modules/

2009-04-03 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Have you tested PCbuild changes? As, this is the part I am the most unsure about. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5682

[issue5682] Move io-in-c modules into a subdirectory of Modules/

2009-04-03 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Thanks! Here is the updated patch. -- Added file: http://bugs.python.org/file13607/move-iomodule-in-subdir-4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5682

[issue5665] Add more pickling tests

2009-04-02 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Overall, the patch looks good. I haven't reviewed the patch thoroughly yet, but there is a few things I am not sure about. First, why do you bother supporting 2.4 (i.e. with a copy of run_with_locale) in a patch aimed at 2.7

[issue5670] Speed up pickling of dicts in cPickle

2009-04-02 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: I ported the patch to py3k. In addition, I added a special-case when the dict contains only one item; you probably want this special-case in the trunk version as well. -- nosy: +alexandre.vassalotti Added file: http

[issue5670] Speed up pickling of dicts in cPickle

2009-04-02 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Oops, I forgot to add the comment on top of batch_dict_exact in the patch. Here is a better patch. -- Added file: http://bugs.python.org/file13594/pickle_batch_dict_exact_py3k-2.diff

[issue5671] Speed up pickling of lists in cPickle

2009-04-02 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Here's a patch for py3k. I also added a special-case for 1-item lists. -- nosy: +alexandre.vassalotti Added file: http://bugs.python.org/file13595/pickle_batch_list_exact_py3k.diff

[issue5671] Speed up pickling of lists in cPickle

2009-04-02 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: -- versions: +Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5671 ___ ___ Python

[issue5670] Speed up pickling of dicts in cPickle

2009-04-02 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Oops again, I just remarked that the comment for batch_dict_exact refers to batch_dict as being above, but I copied batch_dict_exact before batch_dict. Here's a good patch (hopefully) that puts batch_dict_exact at the right place

[issue5670] Speed up pickling of dicts in cPickle

2009-04-02 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: Removed file: http://bugs.python.org/file13593/pickle_batch_dict_exact_py3k.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5670

[issue5670] Speed up pickling of dicts in cPickle

2009-04-02 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: Removed file: http://bugs.python.org/file13594/pickle_batch_dict_exact_py3k-2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5670

[issue5373] TypeError when '\x00' in docstring

2009-02-28 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: The motivation behind the restriction was to prevent the tp_doc member to get truncated. Since tp_doc is a C string, it cannot contains embeded null bytes. However, it seems tp_doc is not used at all for heap types. So, I don't mind

[issue5373] TypeError when '\x00' in docstring

2009-02-28 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: Added file: http://bugs.python.org/file13214/remove_null_restriction_on_classdoc.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5373

[issue5373] TypeError when '\x00' in docstring

2009-02-28 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: Removed file: http://bugs.python.org/file13213/remove_null_restriction_on_classdoc.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5373

[issue5084] unpickling does not intern attribute names

2009-01-27 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: The patch for cPickle doesn't do the same thing as the pickle one. In the cPickle one, you are only interning slot attributes, which, I believe, is not what you intended. :-) -- assignee: - alexandre.vassalotti nosy

[issue5084] unpickling does not intern attribute names

2009-01-27 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Oh, you are right. I was looking at py3k's version of pickle, which uses PyDict_Update instead of a while loop; that is why I got confused. ___ Python tracker rep...@bugs.python.org http

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

2009-01-26 Thread Alexandre Vassalotti
New submission from Alexandre Vassalotti alexan...@peadrop.com: This is a 2to3 fixer for the removal of obsolete functions in r68962. -- components: 2to3 (2.x to 3.0 conversion tool) files: fix_operator.py messages: 80624 nosy: alexandre.vassalotti severity: normal stage: patch review

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

2009-01-26 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: Added file: http://bugs.python.org/file12875/fix_operator.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5077

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

2009-01-26 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: Removed file: http://bugs.python.org/file12874/fix_operator.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5077

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

2009-01-26 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: -- title: 2to3 fixers for the removal of operator functions - 2to3 fixer for the removal of operator functions ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5077

[issue4753] Faster opcode dispatch on gcc

2009-01-04 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Removing the switch won't be possible unless we change the semantic EXTENDED_ARG. In addition, I doubt the improvement, if any, would worth the increased complexity. Nevermind what I have said. I managed to remove switch pretty

[issue4753] Faster opcode dispatch on gcc

2009-01-04 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: I managed to remove switch pretty easily by moving opcode fetching in the FAST_DISPATCH macro and abstracting the control flow of the switch. Here is the diff against threadceval5.patch. Added file: http://bugs.python.org

[issue4753] Faster opcode dispatch on gcc

2009-01-03 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Paolo wrote: So, can you try dropping the switch altogether, using always computed goto and seeing how does the resulting code get compiled? Removing the switch won't be possible unless we change the semantic EXTENDED_ARG

[issue4753] Faster opcode dispatch on gcc

2009-01-02 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: The patch make a huge difference on 64-bit Linux. I get a 20% speed-up and the lowest run time so far. That is quite impressive! At first glance, it seems the extra registers of the x86-64 architecture permit GCC to avoid spilling

[issue4753] Faster opcode dispatch on gcc

2009-01-02 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: One more thing, the patch causes the following warnings to be emited by GCC when USE_COMPUTED_GOTOS is undefined. Python/ceval.c: In function ‘PyEval_EvalFrameEx’: Python/ceval.c:2420: warning: label ‘_make_function’ defined

[issue4753] Faster opcode dispatch on gcc

2009-01-01 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Antoine Pitrou wrote: [...] count the number of indirect jump instructions in ceval.c: grep -E jmp[[:space:]]\*% ceval.s There should be 85 to 90 of them, roughly. If there are many less, then the compiler has tried to optimize

[issue4753] Faster opcode dispatch on gcc

2009-01-01 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: Added file: http://bugs.python.org/file12522/amd-athlon64-x2-gcc-sunos-pybench.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4753

[issue4753] Faster opcode dispatch on gcc

2009-01-01 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Attached new patch for fixes suggested by Alexandre (rename opcode_targets.c to opcode_targets.h, replace USE_THREADED_CODE with USE_COMPUTED_GOTOS). You forgot to update your script to use the new name

[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: You may want to check out issue1408710 in which a similar patch was provided, but failed to deliver the desired results. I didn't get the advertised ~15% speed-up, but only 4% on my Intel Core2 laptop and 8% on my AMD Athlon64 X2

[issue4753] Faster opcode dispatch on gcc

2008-12-31 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: Added file: http://bugs.python.org/file12513/intel-core2-mobile-pybench.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4753

[issue4730] cPickle corrupts high-unicode strings

2008-12-27 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Fixed in r67934. Backported to 2.6 in r67936. Thanks! -- nosy: +alexandre.vassalotti resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http

[issue4374] Pickle tests fail w/o _pickle extension

2008-12-27 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Committed in r67940. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4374 ___ ___ Python-bugs

[issue4374] Pickle tests fail w/o _pickle extension

2008-12-27 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4374

[issue4664] fix_imports does not refactor import urlparse, cStringIO correctly

2008-12-14 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Sorry, I still cannot reproduce it. Could you attach your test file? Maybe it is some weird encoding bug. a...@helios:~$ 2to3 -f imports test.py --- test.py (original) +++ test.py (refactored) @@ -1,2 +1,2 @@ -import urlparse

[issue4664] fix_imports does not refactor import urlparse, cStringIO correctly

2008-12-14 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Benjamin, your example fails for a different reason--i.e. the fixer for HTMLParser is missing. Sorry Lennart, I still cannot reproduce it. ___ Python tracker rep...@bugs.python.org http

[issue4664] Regression fix_imports does not refactor multiple imports correctly

2008-12-14 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: I got it. It is a regression from a previous version of 2to3's fix_imports. I was able to reproduce your problem using the sandbox's 2to3. And to answer your question, I still running an older RC release of Python 3.0. That explains

[issue4374] Pickle tests fail w/o _pickle extension

2008-11-21 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: I think the best way to fix this is to add sanity checks similar to the ones in _pickle. The checks are obviously useless in pickle.py, but I think it is simpler than to try to skip tests, and it gives a nicer error message to people who

[issue4176] segfault with pickle if 4th or 5th item of tuple returned by __reduce__ is not an iterator

2008-10-31 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: Iterators only need to provide a __next__() method. So, you don't have to check __iter__. Other than that, the patch looks good. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4176

[issue4176] segfault with pickle if 4th or 5th item of tuple returned by __reduce__ is not an iterator

2008-10-31 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: Amaury Forgeot d'Arc wrote: Regarding the consistency between python and C, I don't think it is necessary to be so strict. If the python version can allow a weaker version of the iterator concept, let be it. I guess you're right

[issue4176] segfault with pickle if 4th or 5th item of tuple returned by __reduce__ is not an iterator

2008-10-30 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: Thank you, Amaury, for fixing this. However, you forgot to also patch the Python implementation of pickle, which makes the following test fail: == FAIL

[issue3816] __newobj__ pickle feature is not documented

2008-10-29 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: Could explain me how this feature could be used, other than for providing the efficient and backward-compatible pickling mechanism for new-style classes? -- nosy: +alexandre.vassalotti

[issue3816] __newobj__ pickle feature is not documented

2008-10-29 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: Without the __reduce__ method the information in __dict__ and the class would be lost. Are you sure about that? Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 class mydict(dict

[issue3664] Pickler.dump from a badly initialized Pickler segfaults

2008-10-16 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: Oops. I must have been quite tired when I submitted that. Here's the patch for the fix and the test case. -- keywords: +patch Added file: http://bugs.python.org/file11814/issue3664_fix.diff

[issue3873] Unpickling is really slow

2008-10-07 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: The solution is to add a read buffer to Unpickler (Pickler already has a write buffer, so that why it is unaffected). I believe this would mitigate much of the (quite large) Python function call overhead. cPickle has a performance hack

[issue2744] Fix test_cProfile

2008-10-06 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: Have you verified the numbers? They don't look right to me. The problem is the 2nd argument of cProfile's constructor has a different semantic meaning than the one for profile.py. For profile.py, it is used to set the bias (I presume

[issue2744] Fix test_cProfile

2008-10-06 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: Unassigning myself as I don't have the time to fix this properly. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2744

[issue2744] Fix test_cProfile

2008-10-06 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti [EMAIL PROTECTED]: -- assignee: alexandre.vassalotti - ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2744

[issue3623] _json: fix raise_errmsg(), py_encode_basestring_ascii() and linecol()

2008-10-06 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: The patch looks good to me. You may want to fix the refleak in the PyList_Append() calls (I counted 4) too: if (PyList_Append(chunks, chunk)) { goto bail; } should

[issue3664] Pickler.dump from a badly initialized Pickler segfaults

2008-10-04 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: Here's the fix. The added check in Pickler_dump should prevent any segfaults due to __init__() errors. I also added the check proposed by Christian as a safe-guard in case a core developer adds a new method that doesn't check

[issue3675] Python 2.6 can't read sets pickled with Python 3.0

2008-10-04 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: I agree with Antoine, protocols = 2 should remain compatible with Python 2.x or be deprecated. Keeping compatibility will require a hack, in addition to the proposed patch, in Pickler.save_global to map Python 3's module names to the ones

[issue3664] Pickler.dump from a badly initialized Pickler segfaults

2008-10-02 Thread Alexandre Vassalotti
Alexandre Vassalotti [EMAIL PROTECTED] added the comment: I will try to time next weekend to fix this (and other pickle blockers). ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3664

<    1   2   3   4   5   6   >