[issue6611] HTMLParser cannot deal with mixture of arbitrary data and character reference

2009-07-31 Thread bones7456
bones7456 added the comment: another fix way: and these three lines to the head of file: import sys reload(sys) sys.setdefaultencoding('utf8') -- nosy: +bones7456 ___ Python tracker ___

[issue6608] asctime causing python to crash

2009-07-31 Thread James Abbatiello
James Abbatiello added the comment: Since there's no good way to disable the assertion (see issue4804), checking the validity of the argument beforehand looks like an option. The checking that's currently being done in the strftime() implementation looks useful but it is not enough. The checki

[issue5737] add Solaris errnos

2009-07-31 Thread Christopher Dolan
Christopher Dolan added the comment: This is a patch against the latest subversion revision that adds the addition errno names, numbers, and messages available in Solaris. -- keywords: +patch nosy: +cdolan Added file: http://bugs.python.org/file14616/issue5737.diff

[issue6550] asyncore incorrect failure when connection is refused and using async_chat channel

2009-07-31 Thread Nir Soffer
Nir Soffer added the comment: I tested asyncore_fix_refused-3.patch on Mac OS X 10.5 - all asyncore and asynchat tests pass. There is one minor issue - _exception calls the non existing handle_close_event instead of handle_close. However, looking again at the code I think that it is ugly and

[issue5505] sys.stdin.read() doesn't return after first EOF on Windows

2009-07-31 Thread Martin
Martin added the comment: Looks like python needs eof() or something for file objects, just like any other languages. Since read() is using the system call, that's the right behavior: read() blocks until EOF, and returns whatever was buffered. EOF character is consumed, but since it's a stdin,

[issue6614] heapq.nsmallest and nlargest should be smarter/more usable/more consistent

2009-07-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: There is a basis for the pure python version to switch to bisect. There is not a basis for having the final wrapped C function switch to using sorted(). That is a programmer decision. The pure python version is there to show how it could be done using a mi

[issue5404] Cross-compiling Python

2009-07-31 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue1597850] Cross compiling patches for MINGW

2009-07-31 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue1006238] cross compile patch

2009-07-31 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- assignee: -> gregory.p.smith nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list ma

[issue3718] environment variable MACHDEP and python build system

2009-07-31 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- assignee: -> gregory.p.smith nosy: +gregory.p.smith priority: -> normal ___ Python tracker ___ ___ P

[issue1115] Minor Change For Better cross compile

2009-07-31 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- assignee: loewis -> gregory.p.smith nosy: +gregory.p.smith priority: low -> normal ___ Python tracker ___

[issue6614] heapq.nsmallest and nlargest should be smarter/more usable/more consistent

2009-07-31 Thread Joshua Bronson
Joshua Bronson added the comment: > That is in the pure python version of nsmallest() and that > code is not used (it is overriden by the C version). So just because it isn't used by CPython it should remain in there even though as you said yourself it's completely without basis? What about no

[issue6584] gzip module has no custom exception

2009-07-31 Thread Terry J. Reedy
Terry J. Reedy added the comment: Unless something in the docs claims that there is/should be such a thing, this is a feature request, not a bug ('behavior') report, and only applicable to future x.y versions. -- nosy: +tjreedy type: behavior -> feature request versions: +Python 2.7 -Py

[issue6580] No deprecation warning for list comprehension leak conflict

2009-07-31 Thread Terry J. Reedy
Terry J. Reedy added the comment: 2.5 is closed to fixes other than security fixes. So this needs to be checked with the latest 2.6. The implementation of new features does not always exactly follow the PEP. So if there is also no warning in 2.6, the question remains whether accident or intenti

[issue6239] c_char_p return value returns string, not bytes

2009-07-31 Thread Thomas Heller
Thomas Heller added the comment: Here's a patch. -- keywords: +patch Added file: http://bugs.python.org/file14615/c_char_p.patch ___ Python tracker ___ __

[issue6574] List the __future__ features in a table

2009-07-31 Thread Terry J. Reedy
Terry J. Reedy added the comment: For Python3, the table should start empty as of 3.0/3.1 -- nosy: +tjreedy ___ Python tracker ___ ___

[issue6570] Tutorial clarity: section 4.7.2, parameters and arguments

2009-07-31 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- title: Documentation Clarity -> Tutorial clarity: section 4.7.2, parameters and arguments ___ Python tracker ___ __

[issue6614] heapq.nsmallest and nlargest should be smarter/more usable/more consistent

2009-07-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Except that it's no longer true that "when n==1, it is > more efficient to use the builtin min() and max() functions." There's still the dispatch overhead. If someone needs a n==1 case, they *should* use min/max for both speed and clarity. Also, it is imp

[issue6614] heapq.nsmallest and nlargest should be smarter/more usable/more consistent

2009-07-31 Thread Joshua Bronson
Joshua Bronson added the comment: One more thing: > I prefer the docs the way they are. They help the reader understand > the relationship between min, max, nsmallest, nlargest, and sorted. The docs still use the unspecific language "for smaller values of n" and "for larger values". I think

[issue4606] Passing 'None' if argtype is set to POINTER(...) doesn't always result in NULL

2009-07-31 Thread Thomas Heller
Thomas Heller added the comment: Python 3.0 is dead ;-). -- versions: -Python 3.0 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4606] Passing 'None' if argtype is set to POINTER(...) doesn't always result in NULL

2009-07-31 Thread Thomas Heller
Thomas Heller added the comment: Andrew McNabb schrieb: > I just looked at ConvParam in a little more detail, and it seems that > the problem is caused because setting pa->value.i to 0 only works for > the lower-order bits. Apparently the higher order bits in pa->value are > non-zero when ConvP

[issue6606] csv.Sniffer.sniff on data with doublequotes doesn't set up the dialect properly

2009-07-31 Thread Thomas W. Barr
Thomas W. Barr added the comment: Patch uploaded to rietveld: http://codereview.appspot.com/96202/show -- ___ Python tracker ___ ___ P

[issue6614] heapq.nsmallest and nlargest should be smarter/more usable/more consistent

2009-07-31 Thread Joshua Bronson
Joshua Bronson added the comment: > I prefer the docs the way they are. They help the reader understand > the relationship between min, max, nsmallest, nlargest, and sorted. Except that it's no longer true that "when n==1, it is more efficient to use the builtin min() and max() functions." S

[issue3493] No Backslash (\) in IDLE 1.2.2

2009-07-31 Thread François HOUNDONOUGBO
François HOUNDONOUGBO added the comment: Same probleme here with Idle 2.6.2, with a french keyboard. I finally thought that it was due to a default binding recorded as or :, something like that, which is identical to the binding of Backslash character on my keyboard. So I modified the binding

[issue5093] 2to3 with a pipe on non-ASCII script

2009-07-31 Thread Matthew Barnett
Matthew Barnett added the comment: I was thinking that if you're converting a Python 2.x script to Python 3.x using 2to3 then also encoding the new script in UTF-8 might be a good idea. -- ___ Python tracker __

[issue6614] heapq.nsmallest and nlargest should be smarter/more usable/more consistent

2009-07-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: One other thought: When memory is tight, the programmer needs to be able to select the heap algorithm in favor of sorted() even for relatively large values of n. I do not want an automatic switchover point that takes away a programmer's choice between speed

[issue6614] heapq.nsmallest and nlargest should be smarter/more usable/more consistent

2009-07-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: I prefer the docs the way they are. They help the reader understand the relationship between min, max, nsmallest, nlargest, and sorted. I'm not sure where you got the n * 10 <= len(iterable) switch-over point. That is arbitrary. The correct switchover poi

[issue6614] heapq.nsmallest and nlargest should be smarter/more usable/more consistent

2009-07-31 Thread Joshua Bronson
Joshua Bronson added the comment: Oh, that's great! (I also noticed that the previously inutile line "_heappushpop = heappushpop" is now doing something in the heapq.py you linked to, nice.) It looks like the docs haven't been updated yet though. For instance, http://docs.python.org/3.1/libr

[issue5093] 2to3 with a pipe on non-ASCII script

2009-07-31 Thread James Abbatiello
James Abbatiello added the comment: In what case(s) do you propose the output to be encoded in UTF-8? If output is to a terminal and that terminal is set to Latin-1 or cp437 or whatever then outputting UTF-8 in that case will only show garbage characters to the user. If output is to a file the

[issue6614] heapq.nsmallest and nlargest should be smarter/more usable/more consistent

2009-07-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, 2.7 and 3.1 already have automatic selection of sort()/min()/max() alternatives. They use pure python to dispatch to the underlying C functions: http://svn.python.org/view/python/branches/release31-maint/Lib/heapq.py?revision=73579&view=markup --

[issue6614] heapq.nsmallest and nlargest should be smarter/more usable/more consistent

2009-07-31 Thread Joshua Bronson
New submission from Joshua Bronson : >From http://docs.python.org/library/heapq.html: > The latter two functions (nlargest and nsmallest) perform best for > smaller values of n. For larger values, it is more efficient to use > the sorted() function. Also, when n==1, it is more efficient to use >

[issue6595] Make Decimal constructor accept all unicode decimal digits in input.

2009-07-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: I like the str(int(...)) approach because it guarantees handling that is consistent with other types. -- ___ Python tracker ___

[issue6613] ctypes.PyThreadState_SetAsyncExc does not work on linux 64bit machines

2009-07-31 Thread Thomas Heller
Thomas Heller added the comment: I have no time to figure out what the attached script is supposed to do. Please provide a standalone test-script and describe exactly how it should be used to reproduce the bug. However, I guess the problem is that the signature of PyThreadState_SetAsyncEx is t

[issue6613] ctypes.PyThreadState_SetAsyncExc does not work on linux 64bit machines

2009-07-31 Thread Tiago Coutinho
New submission from Tiago Coutinho : Hello, It seems that the ctypes.PyThreadState_SetAsyncExc is not working in Linux 64bits machines I have tried the code in attachment in python 2.5 and 2.6 in both 32bits and 64bits machines with the following return: | linux 32bits | linux 64bits | -

[issue5093] 2to3 with a pipe on non-ASCII script

2009-07-31 Thread Matthew Barnett
Matthew Barnett added the comment: I'd like to suggest that it the output could/should be encoded in UTF-8. -- nosy: +mrabarnett ___ Python tracker ___ __

[issue6612] 'import site' fails when called from an unlinked directory

2009-07-31 Thread W. Trevor King
New submission from W. Trevor King : I don't imagine this comes up very often, but: $ mkdir /tmp/a; cd /tmp/a; rmdir /tmp/a; python -c 'import site'; rmdir: removing directory, /tmp/a 'import site' failed; use -v for traceback Traceback (most recent call last): File "", line 1, in File "/ho

[issue6611] HTMLParser cannot deal with mixture of arbitrary data and character reference

2009-07-31 Thread Liu DongMiao
New submission from Liu DongMiao : HTMLParser (Python 2.6.2) Cannot deal with mixture of arbitrary data and character reference. In line 365-373, replaceEntities(s) returns unichr(charref) in unicode, which cannot be a mixture with arbitrary data in str. A fix way: replace unichr(c) with unich

[issue6550] asyncore incorrect failure when connection is refused and using async_chat channel

2009-07-31 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/