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

2009-01-08 Thread Raymond Hettinger
Raymond Hettinger 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 broken anything. If that was the

[issue4889] difflib

2009-01-08 Thread Pratik Potnis
New submission from Pratik Potnis : 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 (this string is in small cap

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

2009-01-08 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: Sounds like a fine change to me. -- nosy: +jyasskin ___ Python tracker ___ ___ Python-bugs-list mai

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

2009-01-08 Thread Skip Montanaro
New submission from Skip Montanaro : There is what I believe is a misplaced - or at least misleading - assert in the while loop following the fast_block_end label. If why != WHY_YIELD before the loop starts I don't see how that relationship could change within the loop. Proposed patch against p

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

2009-01-08 Thread Daniel Diniz
Daniel Diniz added the comment: Pablo, As Martin says, Python does support DST changes. But it might not have enough information about your timezone. If that's the case, take a look at these links to see how adding (up-to-date) support for your tz can be achieved: Building a tzinfo class -> htt

[issue4876] Incorrect detection of module as local

2009-01-08 Thread Benjamin Peterson
Benjamin Peterson added the comment: Fixed in r68422. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Pytho

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

2009-01-08 Thread Tarek Ziadé
Tarek Ziadé added the comment: done in r68415 -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue4705] python3.0 -u: unbuffered stdout

2009-01-08 Thread STINNER Victor
STINNER Victor 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: http://bugs.python.org/file12657/unbufferedstdout-5.patch __

[issue4887] environment inspection and manipulation API is buggy, inconsistent with "Python philosophy" for wrapping native APIs

2009-01-08 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone : According to a recent thread on python-dev, Python APIs with the same name as native APIs can be trusted to just pass through to the platform API call (). This isn't the case for the e

[issue4868] Faster utf-8 decoding

2009-01-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Antoine Pitrou wrote: > Antoine Pitrou 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 variable name "word" to some

[issue4751] Patch for better thread support in hashlib

2009-01-08 Thread Lukas Lueg
Lukas Lueg added the comment: I'll do a patch for 2.7 -- versions: +Python 2.7 -Python 3.1 ___ Python tracker ___ ___ Python-bugs-list

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

2009-01-08 Thread Collin Winter
Collin Winter 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 included verbatim. Othe

[issue4705] python3.0 -u: unbuffered stdout

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou 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 ___ __

[issue4106] multiprocessing occasionally spits out exception during shutdown

2009-01-08 Thread Jesse Noller
Changes by Jesse Noller : -- assignee: -> jnoller nosy: +jnoller ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4065] _multiprocessing doesn't build on macosx 10.3

2009-01-08 Thread Jesse Noller
Changes by Jesse Noller : -- assignee: -> jnoller nosy: +jnoller ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue3325] use of cPickle in multiprocessing

2009-01-08 Thread Jesse Noller
Changes by Jesse Noller : -- assignee: -> jnoller ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[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 : -- assignee: -> jnoller nosy: +jnoller ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou 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 memory) __

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

2009-01-08 Thread Michael Yang
Changes by Michael Yang : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

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

2009-01-08 Thread Michael Yang
New submission from Michael Yang : 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 machine configurations,

[issue4751] Patch for better thread support in hashlib

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou 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

[issue4751] Patch for better thread support in hashlib

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou 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 added the comment: Oops, nevermind what I said. The GIL isn't released if obj->lock isn't there. ___ Python tracker ___ ___ Pyth

[issue4751] Patch for better thread support in hashlib

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou 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, since A doens't

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

2009-01-08 Thread Martin v. Löwis
Martin v. Löwis 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 definitely does sup

[issue4880] PyInt_FromSsize_t LONG_MIN and LONG_MAX typecasts needed

2009-01-08 Thread Martin v. Löwis
Martin v. Löwis 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 I know of. -

[issue4885] mmap enhancement request

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou 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, Python 3.1 -Py

[issue4868] Faster utf-8 decoding

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

[issue4885] mmap enhancement request

2009-01-08 Thread ndbecker
New submission from ndbecker : 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 any object supporting

[issue4868] Faster utf-8 decoding

2009-01-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Antoine Pitrou wrote: > Antoine Pitrou 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 mac

[issue4868] Faster utf-8 decoding

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: (PS : performance measured on UCS-2 and UCS-4 builds with gcc, and under Windows with MSVC) ___ Python tracker ___ __

[issue4868] Faster utf-8 decoding

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou 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, it is between

[issue4884] Work around gethostbyaddr_r bug

2009-01-08 Thread Jeffrey Yasskin
New submission from Jeffrey Yasskin : 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 socketmodule.c:socket_gethostbyaddr(),

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

2009-01-08 Thread Tarek Ziadé
Tarek Ziadé 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 ___

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

2009-01-08 Thread Jean-Paul Calderone
Jean-Paul Calderone 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 track down why the

[issue4868] Faster utf-8 decoding

2009-01-08 Thread Kevin Watters
Changes by Kevin Watters : -- nosy: +kevinwatters ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue4871] zipfile can't decrypt

2009-01-08 Thread Lukas Lueg
Lukas Lueg 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 because the password is so

[issue4871] zipfile can't decrypt

2009-01-08 Thread STINNER Victor
STINNER Victor 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... ___ Python tracker

[issue4880] PyInt_FromSsize_t LONG_MIN and LONG_MAX typecasts needed

2009-01-08 Thread Luke Kenneth Casson Leighton
Luke Kenneth Casson Leighton 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 */ #undef LONG_MAX

[issue4871] zipfile can't decrypt

2009-01-08 Thread Lukas Lueg
Lukas Lueg added the comment: This is basically the same problem as with other bytes-orientated modules. The choice is either to reject unicode and force the caller to use .encode() on all his strings (so 'password' is an instance of bytes and 'ch' an instance of int). I'd prefer that. Or to c

[issue4880] PyInt_FromSsize_t LONG_MIN and LONG_MAX typecasts needed

2009-01-08 Thread Luke Kenneth Casson Leighton
Luke Kenneth Casson Leighton 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.

[issue4871] zipfile can't decrypt

2009-01-08 Thread Glade Diviney
Glade Diviney 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 ___ __

[issue4883] Compiling python 2.5.2 under Wine on linux.

2009-01-08 Thread Luke Kenneth Casson Leighton
New submission from Luke Kenneth Casson Leighton : messy patches which get python 2.5.2 compiling - and producing python.exe.so - under wine. the setup.py is presently _wholly_ unsuited to use for building the modules - get_sysconfig("srcdir") returns None because... it's supposed to! but, the

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

2009-01-08 Thread Matthias Klose
Matthias Klose 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 __

[issue4880] PyInt_FromSsize_t LONG_MIN and LONG_MAX typecasts needed

2009-01-08 Thread Mark Dickinson
Mark Dickinson 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 fix would be to fix L

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

2009-01-08 Thread alec resnick
New submission from alec resnick : 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 original regex, later in t

[issue4868] Faster utf-8 decoding

2009-01-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Attached patch > (utf8decode4.patch) changes this and may enter the fast loop on the > first character. Thanks! > Does this idea apply to the encode function as well? Probably, although with less efficiency (a long can hold 1, 2 or 4 unicode characters depe

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

2009-01-08 Thread Pablo Castagnino
New submission from Pablo Castagnino : 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 it's X. However, Python belie

[issue4861] fix problems with ctypes.util.find_library

2009-01-08 Thread Jean-Paul Calderone
Jean-Paul Calderone 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 ___

[issue2233] Makefile.pre.in contains extra slash before $(DESTDIR) which can cause Cygwin build to fail

2009-01-08 Thread Jason Tishler
Jason Tishler added the comment: Sorry for the delay, but I was on vacation and then recovering from vacation... You are correct that my initial patch does not handle the case when DESTDIR is not specified. Your suggestion will work, but seems hacky. What about adding the defaulting of DEST

[issue4861] fix problems with ctypes.util.find_library

2009-01-08 Thread Matthias Klose
Matthias Klose 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: http://bugs.python

[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 : 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 ((long)ival >

[issue4879] Allow buffering for HTTPResponse

2009-01-08 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson : -- title: Allo buffering for HTTPResponse -> Allow buffering for HTTPResponse ___ Python tracker ___ __

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

2009-01-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg 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', e

[issue4868] Faster utf-8 decoding

2009-01-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc 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 may enter the fast

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

2009-01-08 Thread J. David Ibáñez
J. David Ibáñez 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 != 'content.xml':

[issue4336] Fix performance issues in xmlrpclib

2009-01-08 Thread Kristján Valur Jónsson
Kristján Valur Jónsson 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

[issue4879] Allo buffering for HTTPResponse

2009-01-08 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson : 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. HTTPResponse creates a s

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

2009-01-08 Thread Thomas Heller
Thomas Heller 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 _

[issue4878] post installer script's message is not shown to user with bdist_wininst

2009-01-08 Thread Juha Rantanen
New submission from Juha Rantanen : 1. Create installer with bdist_wininst with python version 2.5 2. Install it to 2.6 Python. 3. The post installer message is not shown to user in the installer window. 4. Remove the installation from add/remove programs. 5. Messages coming from removing are no

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

2009-01-08 Thread Thomas Heller
Thomas Heller added the comment: The patch is fine, no need for another diff. -- resolution: -> accepted versions: +Python 3.1 ___ Python tracker ___ ___

[issue4874] decoding functions in _codecs module accept str arguments

2009-01-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 2009-01-08 01:59, STINNER Victor wrote: > STINNER Victor added the comment: > > Patch replacing "s*" parsing format by "y*" for: > - utf_7_decode() > - utf_8_decode() > - utf_16_decode() > - utf_16_le_decode() > - utf_16_be_decode() > - utf_16_ex_

[issue4814] ftplib does not honour "timeout" parameter for active data connections

2009-01-08 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file12552/ftplib.patch ___ Python tracker ___ ___ Python-bugs-list mailing lis