[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I tested brute.py for all supported in Python encodings: No character for encoding cp1006:surrogateescape :-( No character for encoding cp720:surrogateescape :-( No character for encoding cp864:surrogateescape :-( No character for encoding

[issue6715] xz compressor support

2012-11-06 Thread Peter
Peter added the comment: Apologies for noise, but since a backport was discussed, I'm mentioning this here. I've started implementing a backport, currently working and tested on Mac OS X and Linux, back to Python 3.0 - supporting Python 2 would be nice but probably significantly more work

[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-06 Thread STINNER Victor
STINNER Victor added the comment: I tested brute.py for all supported in Python encodings: Oh thanks, interesting result. I completed the encoding list and the character list: see brute2.py. I added joker characters: U+00A0 and U+20AC which match requierements for most locale encodings.

[issue16353] add function to os module for getting path to default shell

2012-11-06 Thread Christian Heimes
Christian Heimes added the comment: Meh, Python 2.6 from SL4A (scripting languages for Android) doesn't have os.confstr(). I just tried it in a Android 2.3.3 emulator. Python 2.6 on Linux has the function. I propose we fall back to PATH env and use /bin as last resort. try:

[issue9584] Allow curly brace expansion

2012-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset dafca4714298 by Tim Golden in branch 'default': issue9584: Add {} list expansion to glob. Original patch by Mathieu Bridon http://hg.python.org/cpython/rev/dafca4714298 -- nosy: +python-dev ___ Python

[issue16420] PEP 249 (DB-API 2.0) converted to reStructuredText

2012-11-06 Thread Daniele Varrazzo
New submission from Daniele Varrazzo: I've converted the DBAPI to reST, mostly to allow linking from external documentation. It would be great to replace the current text only version with it. File attached. -- assignee: docs@python components: Documentation files: pep-0249.txt

[issue16392] import crashes on circular imports in ext modules

2012-11-06 Thread Brett Cannon
Brett Cannon added the comment: I was thinking somewhere in http://docs.python.org/3/c-api/import.html since this only comes up when you try to execute an import during extension module initialization that involves a circular import. -- ___ Python

[issue16421] importlib.machinery.ExtensionFileLoader cannot load several modules from the same shared object

2012-11-06 Thread Václav Šmilauer
New submission from Václav Šmilauer: This issue was split off issue16194 (I am not copying the whole discussion here). It was suggested a new issue is opened for Python3, where a proper fix can be done. Python internally caches dynamically loaded modules, but the cache is based on the

[issue16417] Integer converted in tuple without request

2012-11-06 Thread Rosa Maria
Rosa Maria added the comment: Thanks Thanks Thanks Thanks Thanks Thanks Thanks you very much, You are going to go to heaven with your shoes included. Best regards and have a nice year end. Rosa María   Cuídate de la Ciencia que no Llora, de la Filosofía que no Ríe y de la Grandeza que no se

[issue16421] importlib.machinery.ExtensionFileLoader cannot load several modules from the same shared object

2012-11-06 Thread Andrew Svetlov
Andrew Svetlov added the comment: Storing several modules in single so/pyd file is crazy idea from my perspective. The test is definitely required. BTW, Why version is set to 3.5? Should component be set to Interpreter code? -- nosy: +asvetlov ___

[issue16421] importlib.machinery.ExtensionFileLoader cannot load several modules from the same shared object

2012-11-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: It's not that crazy, if you consider that all builtin modules are stored in python33.dll. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16421 ___

[issue16421] importlib.machinery.ExtensionFileLoader cannot load several modules from the same shared object

2012-11-06 Thread Václav Šmilauer
Václav Šmilauer added the comment: Storing several modules in one .so file offloads some issues which have to be dealt with manually (like one module needing symbols from other module, or even cross-dependencies) to the linker. In any case, unless forbidden and signalled, it should be

[issue14621] Hash function is not randomized properly

2012-11-06 Thread Benjamin Peterson
Benjamin Peterson added the comment: Here's the message that helped convince us to go against collision counting originally: http://mail.python.org/pipermail/python-dev/2012-January/115726.html -- ___ Python tracker rep...@bugs.python.org

[issue9584] Allow curly brace expansion

2012-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: glob.glob('*.ac') ['configure.ac'] glob.glob('*.sub') ['config.sub'] glob.glob('*.{sub,ac}') ['config.sub'] And since these changes are backward incompatible (and moreover, now it is impossible to glob for paths that contain braces), I would prefer a

[issue16421] importlib.machinery.ExtensionFileLoader cannot load several modules from the same shared object

2012-11-06 Thread Václav Šmilauer
Changes by Václav Šmilauer e...@doxos.eu: -- components: +Interpreter Core -Extension Modules versions: +Python 3.4 -Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16421 ___

[issue16421] importlib.machinery.ExtensionFileLoader cannot load several modules from the same shared object

2012-11-06 Thread Andrew Svetlov
Andrew Svetlov added the comment: Amaury, I'm ok with pushing several modules into python33.dll or embedding it directly into executable. For standard so/dll files you have to use different file names for modules to make regular import statement work. It can be done via symlink/hardlink, but

[issue16421] importlib.machinery.ExtensionFileLoader cannot load several modules from the same shared object

2012-11-06 Thread Václav Šmilauer
Václav Šmilauer added the comment: @Andrew: I was using symlinks to achieve this, until I found recently that some exotic systems (read: windows) have still troubles there, like not letting non-admins create symlinks. -- type: enhancement - behavior versions: +Python 3.5 -Python 3.4

[issue9584] Allow curly brace expansion

2012-11-06 Thread Mathieu Bridon
Mathieu Bridon added the comment: glob.glob('*.{sub,ac}') ['config.sub'] I'm surprised this broke, this is one of the behaviour I thought I had implemented in my original patch. :-/ (and moreover, now it is impossible to glob for paths that contain braces) I am absolutely sure this was

[issue16421] importlib.machinery.ExtensionFileLoader cannot load several modules from the same shared object

2012-11-06 Thread R. David Murray
R. David Murray added the comment: There is an example in the test suite somewhere. Probably in the distutils tests. Search for xxmodule...but you'll need to create your own source. I'd see if you can write it out from the test rather than checking in another data file, but a data file is

[issue9584] Allow curly brace expansion

2012-11-06 Thread Tim Golden
Tim Golden added the comment: Must have been something I did. I'll revert the commit and re-test. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9584 ___

[issue16194] imp.load_dynamic imports wrong module when called several times on a multi-module .so

2012-11-06 Thread Václav Šmilauer
Václav Šmilauer added the comment: issue16421 was opened for py3k. Just for the sport of writing, I fixed that in python 2.7 (tip) as well, though other seemed to defend the view it was not a bug, hence not fixable in 2.7. -- keywords: +patch versions: -Python 3.2, Python 3.3 Added

[issue16421] importlib.machinery.ExtensionFileLoader cannot load several modules from the same shared object

2012-11-06 Thread R. David Murray
R. David Murray added the comment: Sorry, didn't mean to change the component back. -- components: +Interpreter Core -Extension Modules type: behavior - enhancement versions: +Python 3.4 -Python 3.5 ___ Python tracker rep...@bugs.python.org

[issue16381] Introduce option to force the interpreter to exit upon MemoryErrors

2012-11-06 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16381 ___ ___ Python-bugs-list mailing list

[issue16420] PEP 249 (DB-API 2.0) converted to reStructuredText

2012-11-06 Thread Andrew Svetlov
Andrew Svetlov added the comment: Original file has been changed just now. Also it would be nice to get diff, not just new file (to check correctness of transition). -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org

[issue16420] PEP 249 (DB-API 2.0) converted to reStructuredText

2012-11-06 Thread Daniele Varrazzo
Daniele Varrazzo added the comment: Andrew, I've probably changed every single line (as almost all the original was indented), so diff wouldn't show anything useful. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16420

[issue9584] Allow curly brace expansion

2012-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset ec897bb38708 by Tim Golden in branch 'default': Reversed changes from issue9584 http://hg.python.org/cpython/rev/ec897bb38708 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9584

[issue16420] PEP 249 (DB-API 2.0) converted to reStructuredText

2012-11-06 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 06.11.2012 16:33, Daniele Varrazzo wrote: Daniele Varrazzo added the comment: Andrew, I've probably changed every single line (as almost all the original was indented), so diff wouldn't show anything useful. I'll go through the text and double

[issue14621] Hash function is not randomized properly

2012-11-06 Thread John M Camara
John M Camara added the comment: How about using a secure hash algorithm that's implemented in HW when available. It doesn't eliminate the issue on systems that lack this support but at least it limits the scope of the problem. Of course some testing would need to be done to make sure the

[issue14621] Hash function is not randomized properly

2012-11-06 Thread Alex Gaynor
Changes by Alex Gaynor alex.gay...@gmail.com: -- nosy: +alex ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14621 ___ ___ Python-bugs-list mailing

[issue2275] urllib/httplib header capitalization

2012-11-06 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2275 ___ ___ Python-bugs-list mailing list

[issue16421] importlib.machinery.ExtensionFileLoader cannot load several modules from the same shared object

2012-11-06 Thread Václav Šmilauer
Václav Šmilauer added the comment: I added the test, with a module Modules/_testimportmultiple.c. The test uses the (undocumented) imp module, but all othet tests in Lib/test/test_imp.py do the same, so I assume it is OK? -- Added file:

[issue14621] Hash function is not randomized properly

2012-11-06 Thread Christian Heimes
Christian Heimes added the comment: Our hash randomization will always leak some information about the randomization keys. The only way to properly secure our secrets is a cryptographic secure algorithms, for example a crypto hashing function in combination with a message authentication code

[issue16388] Urllib screws up capitalization in User-Agent HTTP Header

2012-11-06 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16388 ___ ___ Python-bugs-list mailing list

[issue16389] re._compiled_typed's lru_cache causes significant degradation of the mako_v2 bench

2012-11-06 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16389 ___ ___ Python-bugs-list mailing list

[issue14621] Hash function is not randomized properly

2012-11-06 Thread Christian Heimes
Christian Heimes added the comment: I deem hash randomization and collision counting as a poor man's workaround for the actual issue. Perhaps we shouldn't try too hard to fix an unsuitable data type. Hash maps have a known worst case complexity of O(n). A O(log n) algorithm should be used to

[issue14621] Hash function is not randomized properly

2012-11-06 Thread Giovanni Bajo
Giovanni Bajo added the comment: Christian, there are good semi-crypto hash functions that don't leak as bad as Python's own modified FNV hash, without going all the way to HMAC. SipHash has very good collision resistance and doesn't leak anything: https://www.131002.net/siphash/ (notice: they

[issue9584] Allow curly brace expansion

2012-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am absolutely sure this was working in my original submission, I had even added unit tests for it: It can't be working in any implementation. os.makedirs('a{b,c}d/e') os.listdir('a{b,c}d') ['e'] glob.glob('a{b,c}d/*') [] Was ['a{b,c}d/e'] in 3.3.

[issue16421] importlib.machinery.ExtensionFileLoader cannot load several modules from the same shared object

2012-11-06 Thread Brett Cannon
Brett Cannon added the comment: It's fine to cheat in tests, although test_imp predates importlib which is why it uses an undocumented API. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16421

[issue16389] re._compiled_typed's lru_cache causes significant degradation of the mako_v2 bench

2012-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think the lru_cache should be kept if possible (i.e. I'm -0.5 on your patch). This patch is only to show the upper level to which should be sought. I tried to optimize lru_cache(), but got only 15%. I'm afraid that serious optimization is impossible

[issue14621] Hash function is not randomized properly

2012-11-06 Thread Christian Heimes
Christian Heimes added the comment: Thanks! SipHash looks interesting. It's using a XOR + ROT approach with a seed. And it's written by DJB which is usually a good sign. He writes secure code with good quality. Just his coding style tends to be ... unique. :) I'm going to try the algorithm.

[issue9584] Allow curly brace expansion

2012-11-06 Thread Tim Golden
Tim Golden added the comment: Well even in the original [working] version, the scope of this change was limited to glob.glob. os.listdir doesn't currently support any form of expansion (at least not on Windows) and nor does os.makedirs. I don't see any problem in restricting this change -- and

[issue9584] Allow curly brace expansion

2012-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm talking about glob.glob(), not about os.listdir(). Bakward incompatible features should be off by default. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9584

[issue9584] Allow curly brace expansion

2012-11-06 Thread Tim Golden
Tim Golden added the comment: Sorry, I misunderstood the point you were making with the os.listdir/makedirs examples. Fair point about backwards compatibility. This may make this change untenable as no-one will want a series of use_feature_xxx flags, one for each change we introduce to

[issue14621] Hash function is not randomized properly

2012-11-06 Thread Christian Heimes
Christian Heimes added the comment: I modified crypto_auth() a bit: Py_uhash_t crypto_auth(const unsigned char *in, unsigned long long inlen) ... u64 k0 = _Py_HashSecret.prefix; u64 k1 = _Py_HashSecret.suffix; ... return (Py_uhash_t)b; and replaced the loop in _Py_HashBytes() with a

[issue14621] Hash function is not randomized properly

2012-11-06 Thread Giovanni Bajo
Giovanni Bajo added the comment: For short strings, you might want to have a look at the way you fetch the final partial word from memory. If the string is = 8 bytes, you can fetch the last partial word as an unaligned memory fetch followed by a shift, instead of using a switch like in the

[issue14621] Hash function is not randomized properly

2012-11-06 Thread Christian Heimes
Christian Heimes added the comment: We can explore the various optimization options later. Also unaligned memory address is not allowed on some architectures like SPARC. If somebody likes to play with the algorithm: http://hg.python.org/sandbox/cheimes/shortlog/2cb7e97ca8d0 --

[issue9584] Allow curly brace expansion

2012-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This may make this change untenable as no-one will want a series of use_feature_xxx flags, one for each change we introduce to glob.glob. Unless we throw in every known expansion / matching right now and have a single use-extended-features flag. This is

[issue16353] add function to os module for getting path to default shell

2012-11-06 Thread Andrew Svetlov
Andrew Svetlov added the comment: Confirm it for SL4A Python 3.2 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16353 ___ ___ Python-bugs-list

[issue16353] add function to os module for getting path to default shell

2012-11-06 Thread Taras Lyapun
Taras Lyapun added the comment: Andrew, do you mean that Christian Heimes last snippet working on Android? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16353 ___

[issue16421] importlib.machinery.ExtensionFileLoader cannot load several modules from the same shared object

2012-11-06 Thread Andrew Svetlov
Andrew Svetlov added the comment: Reviewed and commented the last patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16421 ___ ___

[issue13669] XATTR_SIZE_MAX and XATTR_LIST_MAX undefined on kfreebsd/debian with eglibc

2012-11-06 Thread Pino Toscano
Pino Toscano added the comment: *_MAX constants are usually defined when the system declares that the maximum limit for that option exist and is already known at compile time. Python should simply not rely on XATTR_LIST_MAX and XATTR_SIZE_MAX being defined, but just grow the buffers as needed

[issue16353] add function to os module for getting path to default shell

2012-11-06 Thread Andrew Svetlov
Andrew Svetlov added the comment: I mean the last available SL4A doesn't have os.confstr Fallback should work, os.environ['PATH'] contains '/system/bin' where 'sh' is living. -- ___ Python tracker rep...@bugs.python.org

[issue14621] Hash function is not randomized properly

2012-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: $ ./python -m timeit -s x = b'a' * int(1E7) hash(x) Note that hash calculated only once. Add -n 1 option and use a larger data. If somebody likes to play with the algorithm: $ ./python -m timeit -n 1 -s t = 'abcdefgh' * 10**8 hash(t) 1 loops, best of 3:

[issue11631] Python 2.7.1 64bit, Win7 64bit problem to read and write with UDP.

2012-11-06 Thread Mahmood Hikmet
Mahmood Hikmet added the comment: I solved the problem - sorry it's taken me so long to reply. I know how frustrating it is when people don't respond with what they found out in the end. Turns out there's no bug as you said and it was based around something I did (as these things usually

[issue3754] cross-compilation support for python build

2012-11-06 Thread Roumen Petrov
Roumen Petrov added the comment: HI, Ambroz Ambroz Bizjak wrote: I've applied all patches from py3k-20121004-CROSS.tgz to Python 3.3.0 except 2, 4, and 9 (which didn't apply), but it's not working. After it builds the built in modules, it tries to run the parser generator which was

[issue12848] pickle.py treats 32bit lengths as signed, but _pickle.c as unsigned

2012-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What if just add 0x? -- nosy: +serhiy.storchaka versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12848 ___

[issue12848] pickle.py treats 32bit lengths as signed, but _pickle.c as unsigned

2012-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ah, for unpacking 32-bit unsigned big-endian bytes you can use len = int.from_bytes(self.read(4), 'big'). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12848

[issue12848] pickle.py treats 32bit lengths as signed, but _pickle.c as unsigned

2012-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Or you can use len = struct.unpack('I', self.read(4)). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12848 ___

[issue16136] Removal of VMS support

2012-11-06 Thread Sandeep Mathew
Sandeep Mathew added the comment: Hey, I was given access to HP's open source VMS cluster, Many thanks to HP. I should be able to continue python development for VMS. I shall ping you guys in case I get stuck. I should be good to go --Thomas --

[issue11631] Python 2.7.1 64bit, Win7 64bit problem to read and write with UDP.

2012-11-06 Thread Christian Heimes
Christian Heimes added the comment: Thanks for your response! I'm closing the ticket. -- nosy: +christian.heimes resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11631

[issue2275] urllib/httplib header capitalization

2012-11-06 Thread Rui Carmo
Rui Carmo added the comment: Should one look into the source and make effort to submit a patch, or is this being handled somehow? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2275 ___

[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset de8cf1ece068 by Victor Stinner in branch 'default': Issue #16414: Add support.FS_NONASCII and support.TESTFN_NONASCII http://hg.python.org/cpython/rev/de8cf1ece068 -- nosy: +python-dev ___ Python tracker

[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0e9fbdda3c92 by Victor Stinner in branch 'default': Issue #16414: Fix support.TESTFN_UNDECODABLE and test_genericpath.test_nonascii_abspath() http://hg.python.org/cpython/rev/0e9fbdda3c92 -- ___ Python

[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Why were you add '- ' suffix to TESTFN_NONASCII? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16414 ___

[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't see U+00A0 and U+20AC in the changeset. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16414 ___ ___

[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 55710b8c6670 by Victor Stinner in branch 'default': Issue #16414: Fix typo in support.TESTFN_NONASCII (useless space) http://hg.python.org/cpython/rev/55710b8c6670 -- ___ Python tracker

[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-06 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: Added file: http://bugs.python.org/file27912/brute2.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16414 ___

[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7f90305d9f23 by Victor Stinner in branch 'default': Issue #16414: Test more characters for support.FS_NONASCII http://hg.python.org/cpython/rev/7f90305d9f23 -- ___ Python tracker rep...@bugs.python.org

[issue12848] pickle.py treats 32bit lengths as signed, but _pickle.c as unsigned

2012-11-06 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: pickle.py is the buggy one here. Its use of the marshal module is really a hack. Plus, it is slower than both struct and int.from_bytes. 14:40:57 [~/cpython]$ ./python -m timeit int.from_bytes(b'\xff\xff\xff\xff', 'big') 100 loops, best of 3: 0.209

[issue2275] urllib/httplib header capitalization

2012-11-06 Thread R. David Murray
R. David Murray added the comment: It looks like there is a patch, so a patch review would be the next step (as indicated by the stage, not that we always remember to update that...) Reading the issue carefully and making sure that all the concerns are addressed is also required. A comitter

[issue16422] Decimal constants should be the same for py c module versions

2012-11-06 Thread Yury Selivanov
New submission from Yury Selivanov: Right now decimal.py defines 'ROUND_DOWN' as 'ROUND_DOWN' (string), whereas C version define it as 1 (integer). While using constant values directly in your code is not a good idea, there is another case where it doesn't work: if you serialize decimal

[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset fce9e892c65d by Victor Stinner in branch 'default': Issue #16414: Fix test_os on Windows, don't test os.listdir() with undecodable http://hg.python.org/cpython/rev/fce9e892c65d -- ___ Python tracker

[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-06 Thread STINNER Victor
STINNER Victor added the comment: Why were you add '- ' suffix to TESTFN_NONASCII? Oops, the space was a mistake. I add - just for the readability of the generated filename. I don't see U+00A0 and U+20AC in the changeset. Oh, I forgot to update the patch with the latest results of

[issue16422] Decimal constants should be the same for py c module versions

2012-11-06 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16422 ___ ___

[issue16422] Decimal constants should be the same for py c module versions

2012-11-06 Thread Mark Dickinson
Mark Dickinson added the comment: I think it's already true that pickling a Decimal context on Python 3.2 and unpickling on Python 3.3 doesn't work. Stefan: do I recall that this is a known issue? -- ___ Python tracker rep...@bugs.python.org

[issue15955] gzip, bz2, lzma: add option to limit output size

2012-11-06 Thread Nadeem Vawda
Nadeem Vawda added the comment: I suspect that it will be slower than the decompress_into() approach, but as you say, we need to do benchmarks to see for sure. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15955

[issue16422] Decimal constants should be the same for py c module versions

2012-11-06 Thread Stefan Krah
Stefan Krah added the comment: Pickling changed in 3.3 to make the C and Python versions compatible. So pickled contexts in 3.3 are actually interchangeable. Pickling a list of rounding modes is not compatible. -- ___ Python tracker

[issue16422] Decimal constants should be the same for py c module versions

2012-11-06 Thread Yury Selivanov
Yury Selivanov added the comment: Well, I don't care about py 3.2 3.3 pickle compatibility in this particular issue. This one is about compatibility of py c decimal modules in 3.3. -- ___ Python tracker rep...@bugs.python.org

[issue16350] zlib.Decompress.decompress() after EOF discards existing value of unused_data

2012-11-06 Thread Nadeem Vawda
Nadeem Vawda added the comment: These were not idle questions. I wrote the patch, and I had to know what behavior is correct. Ah, sorry. I assumed you were going to submit a separate patch to fix the unconsumed_tail issues. Here's the patch. It fixes potential memory bug (unconsumed_tail

[issue16422] Decimal constants should be the same for py c module versions

2012-11-06 Thread Stefan Krah
Stefan Krah added the comment: So what data structure are you trying to serialize interchangeably? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16422 ___

[issue16414] Add support.NONASCII to test non-ASCII characters

2012-11-06 Thread STINNER Victor
STINNER Victor added the comment: Handling non-ASCII paths is always a pain. I don't plan to backport support.FS_NONASCII to Python 3.3 right now, but I may backport it later. -- resolution: - fixed status: open - closed versions: -Python 3.3 ___

[issue16311] Use _PyUnicodeWriter API in text decoders

2012-11-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7ed9993d53b4 by Victor Stinner in branch 'default': Close #16311: Use the _PyUnicodeWriter API in text decoders http://hg.python.org/cpython/rev/7ed9993d53b4 -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status:

[issue16422] Decimal constants should be the same for py c module versions

2012-11-06 Thread Stefan Krah
Stefan Krah added the comment: I see that you mentioned the use case in your first mail. Yes, that isn't possible right now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16422 ___

[issue16422] Decimal constants should be the same for py c module versions

2012-11-06 Thread Yury Selivanov
Yury Selivanov added the comment: Right ;) Is there any chance we can fix that in next 3.3 point release or 3.4? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16422 ___

[issue16389] re._compiled_typed's lru_cache causes significant degradation of the mako_v2 bench

2012-11-06 Thread Richard Oudkerk
Richard Oudkerk added the comment: Maybe lru_cache() should have a key argument so you can specify a specialized key function. So you might have def _compile_key(args, kwds, typed): return args @functools.lru_cache(maxsize=500, key=_compile_key) def _compile(pattern,

[issue14621] Hash function is not randomized properly

2012-11-06 Thread Christian Heimes
Christian Heimes added the comment: Thanks to Snakebit I was able to tests the code on a 32bit BSD installation with GCC 4.2. The ASCII unicode and bytes performance is about 8% slower, UCS2 unicode is about 37% slower. There might be room for improvements, though. % ./python -m timeit -r20

[issue16298] httplib.HTTPResponse.read could potentially leave the socket opened forever

2012-11-06 Thread Eran Rundstein
Eran Rundstein added the comment: Hello I have attached a patch that includes a (slightly broken) fix and a test case. Note that there is currently an unresolved issue: If the user reads the exact amount of bytes the server sent, read() on the socket will never have a chance to return '' and

[issue14621] Hash function is not randomized properly

2012-11-06 Thread Christian Heimes
Christian Heimes added the comment: Serhiy's trick #define U8TO64_LE(p) ((u64)((u32 *)(p))[0] | ((u64)((u32 *)(p))[1] 32)) gives a nice speedup. Now UCS2 is down to 0.133 usec (12% slower than the current algorithm) and ASCII down to 0.105 usec (3% faster). --

[issue16423] urllib data URL recipe

2012-11-06 Thread Mathias Panzenböck
New submission from Mathias Panzenböck: I think it would be really helpful if urllib would support data URLs. However, I was told on the python-ideas mailing list that it would probably only added as recipe in the documentation. The attached patch adds such an recipe to the urllib.request

[issue444582] Finding programs in PATH, adding shutil.which

2012-11-06 Thread Peter Eisentraut
Changes by Peter Eisentraut pete...@gmx.net: -- nosy: +petere ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue444582 ___ ___ Python-bugs-list

[issue11122] bdist_rpm should use rpmbuild, not rpm

2012-11-06 Thread Peter Eisentraut
Peter Eisentraut added the comment: I ran into a similar instance of this problem today and would like to add my support for just getting rid of the rpm calls and just call rpmbuild in all cases. The last release where rpm was used for building was more than 10 years ago. -- nosy:

[issue16423] urllib data URL recipe

2012-11-06 Thread Senthil Kumaran
Changes by Senthil Kumaran sent...@uthcode.com: -- assignee: docs@python - orsenthil nosy: +orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16423 ___

[issue16278] os.rename documentation slightly inaccurate

2012-11-06 Thread Todd Rovito
Todd Rovito added the comment: Chris, That is an excellent suggestion. I modified my OSRenameCombinations.py program and attached. This program prints a table with the src parameters as columns and the dst as rows. Hopefully it will show up ok in the bug tracker. For Unix

[issue16424] regression: os.path.split('//hostname/foo/bar.txt')

2012-11-06 Thread anatoly techtonik
New submission from anatoly techtonik: Windows. Python 3: import os.path as osp osp.split('//hostname/foo/') ('//hostname/foo/', '') Python 2: osp.split('//hostname/foo/') ('//hostname/foo', '') But Python 3 again: osp.split('//hostname/foo/bar/') ('//hostname/foo/bar', '') --

[issue16350] zlib.Decompress.decompress() after EOF discards existing value of unused_data

2012-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry. Here is a patch. -- Added file: http://bugs.python.org/file27916/zlib_unused_data_3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16350 ___

[issue16424] regression: os.path.split('//hostname/foo/bar.txt')

2012-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: '//hostname/foo/' is an UNC path. Now splitunc() deprecated and splitdrive() works with an UNC paths. ntpath.splitdrive('//hostname/foo/') ('//hostname/foo', '/') -- nosy: +serhiy.storchaka ___ Python tracker

[issue14621] Hash function is not randomized properly

2012-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: % ./python -m timeit -r20 -n100 -s h = hash; x = 'a' * 10**7 -- h(x) Here is only one hash calculation and 99 cached calls. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14621

[issue14621] Hash function is not randomized properly

2012-11-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I tested different kind of strings. $ ./python -m timeit -n 1 -s t = b'a' * 10**8 hash(t) $ ./python -m timeit -n 1 -s t = 'a' * 10**8 hash(t) $ ./python -m timeit -n 1 -s t = '\u0100' * 10**8 hash(t) $ ./python -m timeit -n 1 -s t = '\U0001' * 10**8