[issue4874] decoding functions in _codecs module accept str arguments

2009-01-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: On 2009-01-08 01:59, STINNER Victor wrote: STINNER Victor victor.stin...@haypocalc.com added the comment: Patch replacing s* parsing format by y* for: - utf_7_decode() - utf_8_decode() - utf_16_decode() - utf_16_le_decode() -

[issue4867] crash in ctypes when passing a string to a function without defining argtypes

2009-01-08 Thread Thomas Heller
Thomas Heller thel...@ctypes.org added the comment: The patch is fine, no need for another diff. -- resolution: - accepted versions: +Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4867

[issue4867] crash in ctypes when passing a string to a function without defining argtypes

2009-01-08 Thread Thomas Heller
Thomas Heller thel...@ctypes.org added the comment: Fixed in release30-maint, rev. 68402 and py3k, rev. 68401. Thanks for the patch. -- resolution: accepted - fixed status: open - closed ___ Python tracker rep...@bugs.python.org

[issue4879] Allo buffering for HTTPResponse

2009-01-08 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson krist...@ccpgames.com: This is related to issue 4336. While that issue finally revolved around fixing the Nagle problem for xmlrpc and other http clients, here I propose to fix another performance bottleneck with xmlrpc, reading the HTTP Headers.

[issue4336] Fix performance issues in xmlrpclib

2009-01-08 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Reopening this, since I am not entirely happy with the implementation that was checked in. Please see my comments from Dec 5th onwards. -- status: pending - open ___ Python tracker

[issue1202] zlib.crc32() and adler32() return value

2009-01-08 Thread J. David Ibáñez
J. David Ibáñez jda...@itaapy.com added the comment: I believe I have hit this bug. With Python 2.6.1 in a Gentoo Linux 64 bits. This code: from zipfile import ZipFile inzip = ZipFile('Document.odt') outzip = ZipFile('out.zip', 'w') for f in inzip.infolist(): if f.filename !=

[issue4868] Faster utf-8 decoding

2009-01-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Very nice! It seems that you can get slightly faster by not copying the initial char first: 's' is often already aligned at the beginning of the string, but not after the first copy... Attached patch (utf8decode4.patch) changes this and

[issue4862] utf-16 BOM is not skipped after seek(0)

2009-01-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: On 2009-01-07 01:21, Amaury Forgeot d'Arc wrote: First write a utf-16 file with its signature: f1 = open('utf16.txt', 'w', encoding='utf-16') f1.write('0123456789') f1.close() Then read it twice: f2 = open('utf16.txt', 'r',

[issue4879] Allow buffering for HTTPResponse

2009-01-08 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- title: Allo buffering for HTTPResponse - Allow buffering for HTTPResponse ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4879 ___

[issue4880] PyInt_FromSsize_t LONG_MIN and LONG_MAX typecasts needed

2009-01-08 Thread Luke Kenneth Casson Leighton
New submission from Luke Kenneth Casson Leighton l...@lkcl.net: there's probably a better way to do this (or a better reason), but LONG_MIN and LONG_MAX end up as the wrong constant types when compiling python2.5.2 under wine (don't ask...) PyObject * PyInt_FromSsize_t(Py_ssize_t ival) { if

[issue4861] fix problems with ctypes.util.find_library

2009-01-08 Thread Matthias Klose
Matthias Klose d...@debian.org added the comment: new version of the patch using os instead of platform, and selecting the correct library for biarch platforms, tested on ia64, sparc, s390, amd64, ppc64. unsure if there's a better way to find out if the executable is 32 or 64bit. Added file:

[issue4861] fix problems with ctypes.util.find_library

2009-01-08 Thread Jean-Paul Calderone
Jean-Paul Calderone exar...@divmod.com added the comment: This seems to be a partial duplicate of 3383. A suggestion on that ticket was to look for objdump in PATH and then try /usr/sbin. -- nosy: +exarkun ___ Python tracker rep...@bugs.python.org

[issue4881] Python's timezon handling: daylight saving option

2009-01-08 Thread Pablo Castagnino
New submission from Pablo Castagnino pablo.castagn...@gmail.com: Something in python's timezone handling needs to be updated. Python does not take into account 'daylight saving' clock time changes. The thing is my clock time is correct. If you ask anyone here for the time, they will tell you

[issue4882] Behavior of backreferences to named groups in regular expressions unclear

2009-01-08 Thread alec resnick
New submission from alec resnick aresnick...@gmail.com: I recently learned about named groups in Python regular expressions. Almost all the documentation I've found online explains what they are and give a simple example of how to use them. I was trying to use the variables outside of the

[issue4880] PyInt_FromSsize_t LONG_MIN and LONG_MAX typecasts needed

2009-01-08 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Interesting. How many of those casts are actually necessary to make things work? Have you figured out more precisely why this is failing? E.g., is it somehow that LONG_MIN ends up being an unsigned constant? It seems to me that a better

[issue3383] ctypes.util fails to find libc in some environments

2009-01-08 Thread Matthias Klose
Matthias Klose d...@debian.org added the comment: I think 4861 provides a solution for this issue. I don't see any system where objdump is in /sbin or /usr/sbin. -- nosy: +doko ___ Python tracker rep...@bugs.python.org

[issue4871] zipfile can't decrypt

2009-01-08 Thread Glade Diviney
Glade Diviney gla...@sybase.com added the comment: In this case under test, the password string had been clipped from a filename, so I suppose it would have been Unicode. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4871

[issue4880] PyInt_FromSsize_t LONG_MIN and LONG_MAX typecasts needed

2009-01-08 Thread Luke Kenneth Casson Leighton
Luke Kenneth Casson Leighton l...@lkcl.net added the comment: oh, duh - 2L not 1L yes you're right :) yeh i believe it's likely to be because in PC/pyconfig.h LONG_MAX is #defined to 7fff not 7fffL i'll double-check. you're right that would make life a looot easier.

[issue4880] PyInt_FromSsize_t LONG_MIN and LONG_MAX typecasts needed

2009-01-08 Thread Luke Kenneth Casson Leighton
Luke Kenneth Casson Leighton l...@lkcl.net added the comment: hmmm... noo, it's already #defined to 0x7fffL in both PC/pyconfig.h _and_ in /usr/include/wine/msvcrt/limits.h so this works (Include/pyports.h) #ifdef __WINE__ /* weird: you have to typecast 0x7fffL to long */

[issue4871] zipfile can't decrypt

2009-01-08 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: check if 'password' is a unicode-object and encode to default within zipfile. Hmmm... what is the default charset? :-) I think that the charset depends on the OS and the user locale... ___

[issue4871] zipfile can't decrypt

2009-01-08 Thread Lukas Lueg
Lukas Lueg knabberknusperh...@yahoo.de added the comment: The default encoding is UTF8. Even without that there should be no problems while staying in the same environment as the character-translation is the same. However it violates the rule of least surprise to see zipfile throwing CRC errors

[issue4868] Faster utf-8 decoding

2009-01-08 Thread Kevin Watters
Changes by Kevin Watters kevinwatt...@gmail.com: -- nosy: +kevinwatters ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4868 ___ ___

[issue3383] ctypes.util fails to find libc in some environments

2009-01-08 Thread Jean-Paul Calderone
Jean-Paul Calderone exar...@divmod.com added the comment: I think Antoine meant (and I was just copying him) /bin or /usr/bin. The specific case where I encountered the failure was one where PATH was not set to anything. The fix in the patch attached to this ticket would make it much easier to

[issue4394] make the storage of the password optional in .pypirc (using the prompt)

2009-01-08 Thread Tarek Ziadé
Tarek Ziadé ziade.ta...@gmail.com added the comment: Ok, I had one +1 from distutils-SIG, so I am updating this patch to commit it in 2.7 and 3.1. -- versions: -Python 3.0 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4394

[issue4884] Work around gethostbyaddr_r bug

2009-01-08 Thread Jeffrey Yasskin
New submission from Jeffrey Yasskin jyass...@gmail.com: glibc until 2.10 has a bug in gethostbyaddr_r that assumes the buffer argument is 8-byte aligned (http://sources.redhat.com/ml/libc-alpha/2009-01/msg0.html). gcc seems to always provide such alignment for the call in

[issue4868] Faster utf-8 decoding

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Attached patch adds acceleration for latin1 and utf16 decoding as well. All three codecs (utf8, utf16, latin1) are now in the same ballpark performance-wise on favorable input: on my machine, they are able to decode at almost 1GB/s. (unpatched,

[issue4868] Faster utf-8 decoding

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: (PS : performance measured on UCS-2 and UCS-4 builds with gcc, and under Windows with MSVC) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4868 ___

[issue4868] Faster utf-8 decoding

2009-01-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Antoine Pitrou wrote: Antoine Pitrou pit...@free.fr added the comment: Attached patch adds acceleration for latin1 and utf16 decoding as well. All three codecs (utf8, utf16, latin1) are now in the same ballpark performance-wise on

[issue4885] mmap enhancement request

2009-01-08 Thread ndbecker
New submission from ndbecker ndbeck...@gmail.com: I'd like to suggest some improvements from mmap 1) mmap assign to slice only accepts a string. This is unfortunate, because AFAIK a string can only be created by copying data, and this is wasteful for large data transfers. mmap should accept

[issue4868] Faster utf-8 decoding

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Marc-Andre, this patch should address your comments. Added file: http://bugs.python.org/file12656/decode6.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4868

[issue4885] mmap enhancement request

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: As for 2), the buffer() function is deprecated and is replaced in 3.0 by new object called memoryview() (together with a revamped internal API for taking and releasing buffers). -- nosy: +pitrou priority: - normal versions: +Python 2.7,

[issue4880] PyInt_FromSsize_t LONG_MIN and LONG_MAX typecasts needed

2009-01-08 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I think you should study the preprocessor output to find out what LONG_MAX really expands to, at the point where it is used. In any case, I'm tempted to close this as works for me - 0x7FFFL is definitely a long constant in all compilers

[issue4881] Python's timezon handling: daylight saving option

2009-01-08 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Can you provide more details? What is the specific Python source code that you are running, what operating system you run it one, what time zone has been configured into your system, what output do you get, what output do you expect? Python

[issue4751] Patch for better thread support in hashlib

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: There is still a potential problem. Figure the following: - thread A executes ENTER_HASHLIB while lock is NULL; therefore, thread A has released the GIL and doesn't hold any lock - thread B enters EVP_update with a large buffer (it can be there,

[issue4751] Patch for better thread support in hashlib

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Oops, nevermind what I said. The GIL isn't released if obj-lock isn't there. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4751 ___

[issue4751] Patch for better thread support in hashlib

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Haypo's last patch is ok. If you want it to be in 2.7 too, however, you'll have to provide another patch (I won't do it myself). -- resolution: - accepted versions: -Python 2.7 ___ Python tracker

[issue4751] Patch for better thread support in hashlib

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Committed to py3k in r68411. Please tell me if you intend to do a patch for 2.7. Otherwise, you/I can close the issue. -- stage: - committed/rejected status: open - pending ___ Python tracker

[issue4886] test/regrtest.py contains error on __import__

2009-01-08 Thread Michael Yang
New submission from Michael Yang yangofz...@gmail.com: I want to use the included test.regrtest (located in $pythondir/lib/python[ver]/test) to regression test some of my own scripts located in directory myDir. The script has some nice configurability features to skip some tests based on

[issue3383] ctypes.util fails to find libc in some environments

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Well, I did mean /usr/sbin at the time, but I don't remember why I said that. However, I had access to Solaris and AIX machines back then, and my comment may be related to finding out where objdump was on those machines. (sorry, I have a bad

[issue3551] multiprocessing.Pipe terminates with ERROR_NO_SYSTEM_RESOURCES if large data is sent (win2000)

2009-01-08 Thread Jesse Noller
Changes by Jesse Noller jnol...@gmail.com: -- assignee: - jnoller nosy: +jnoller ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3551 ___ ___

[issue3325] use of cPickle in multiprocessing

2009-01-08 Thread Jesse Noller
Changes by Jesse Noller jnol...@gmail.com: -- assignee: - jnoller ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3325 ___ ___ Python-bugs-list

[issue4065] _multiprocessing doesn't build on macosx 10.3

2009-01-08 Thread Jesse Noller
Changes by Jesse Noller jnol...@gmail.com: -- assignee: - jnoller nosy: +jnoller ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4065 ___ ___

[issue4705] python3.0 -u: unbuffered stdout

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: If `PyObject_SetAttrString(raw, _name, text)` fails, a reference to raw is leaked. Other than that, the patch looks good. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4705

[issue4074] Building a list of tuples has non-linear performance

2009-01-08 Thread Collin Winter
Collin Winter coll...@gmail.com added the comment: Looking at gctrigger5.patch, my only thought is that it would be helpful for posterity to include more verbose comments about why this new behaviour was chosen; chunks of Martin's proposal from the referenced python-dev thread could be

[issue4751] Patch for better thread support in hashlib

2009-01-08 Thread Lukas Lueg
Lukas Lueg knabberknusperh...@yahoo.de added the comment: I'll do a patch for 2.7 -- versions: +Python 2.7 -Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4751 ___

[issue4868] Faster utf-8 decoding

2009-01-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Antoine Pitrou wrote: Antoine Pitrou pit...@free.fr added the comment: Marc-Andre, this patch should address your comments. Added file: http://bugs.python.org/file12656/decode6.patch Thanks. Much better ! BTW: I'd also change the

[issue4705] python3.0 -u: unbuffered stdout

2009-01-08 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Updated patch: clear raw on error + if (!Py_UnbufferedStdioFlag) + Py_XDECREF(raw); Question: Should we use line_buffering in unbuffered mode? Added file:

[issue4394] make the storage of the password optional in .pypirc (using the prompt)

2009-01-08 Thread Tarek Ziadé
Tarek Ziadé ziade.ta...@gmail.com added the comment: done in r68415 -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4394 ___

[issue4889] difflib

2009-01-08 Thread Pratik Potnis
New submission from Pratik Potnis pratik.pot...@gmail.com: While using function HtmlDiff() from Library difflib, if there is difference in caps of two strings it does not provide proper diff results. Two strings in two different files in this context that I used are: hostname vaijain123 and

[issue4888] misplaced (or misleading) assert in ceval.c

2009-01-08 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: IIRC, I think I put this here a long while ago when replacing or removing a corresponding if-test that had always been compiled-in. The assertion was a way of validating that the refactoring and elimination of tests had not