[issue4876] Incorrect detection of module as local

2009-01-07 Thread Martin v. Löwis
Martin v. Löwis added the comment: That should work, yes. ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue4707] round() shows undocumented behaviour

2009-01-07 Thread Senthil
Senthil added the comment: I also think that documentation should be improved for round(number, [ndigits]). The doc/help says, ndigits can be negative, but does not really say what it means to be negative. It can be confusing to anyione. Take the following example: >>> round(26.5,1) 26.5 >>>

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Fixed in r68394 Will forward port in a day or two. -- resolution: accepted -> fixed status: open -> closed ___ Python tracker ___ __

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Raymond Hettinger
Changes by Raymond Hettinger : Removed file: http://bugs.python.org/file12644/combperm3.diff ___ Python tracker ___ ___ Python-bugs-list mailin

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Raymond Hettinger
Changes by Raymond Hettinger : Added file: http://bugs.python.org/file12647/combperm4.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4877] xml.parsers.expat ParseFile() causes segmentation fault when passed a closed file object

2009-01-07 Thread Steve Howard
New submission from Steve Howard : In Python 2.5.4 built from unmodified source: show...@showardlt:~/src/Python-2.5.4$ ./python Python 2.5.4 (r254:67916, Jan 7 2009, 20:28:41) [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >

[issue4868] Faster utf-8 decoding

2009-01-07 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file12638/utf8decode.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4868] Faster utf-8 decoding

2009-01-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Reopening and attaching a more ambitious patch, based on the optimization of runs of ASCII characters. This time the speedup is much more impressive, up to 75% faster on pure ASCII input -- actually faster than latin1. The worst case (tight interleaving of ASCI

[issue4876] Incorrect detection of module as local

2009-01-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: Should we just run the import fixer (fixes stdlib module names) after the import fixer (fixes sibling imports)? -- assignee: -> benjamin.peterson nosy: +benjamin.peterson ___ Python tracker

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Raymond Hettinger
Changes by Raymond Hettinger : Removed file: http://bugs.python.org/file12642/combperm2.diff ___ Python tracker ___ ___ Python-bugs-list mailin

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Raymond Hettinger
Changes by Raymond Hettinger : Added file: http://bugs.python.org/file12644/combperm3.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4876] Incorrect detection of module as local

2009-01-07 Thread Martin v. Löwis
New submission from Martin v. Löwis : There is an unfortunate interaction of two fixers to be observed in django. django.util.text.py contains from htmlentitydefs import name2codepoint This gets fixed to from .html.entities import name2codepoint because there is also a local module django.uti

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks David. Looks like we're all in agreement. Turns out, I did a weeks worth of mulling today ;-) Accepting the proposal with the following rationale: 1. There exist some valid use cases where r>n. 2. Returning an empty list is the expected outcome with t

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread David W. Lambert
David W. Lambert added the comment: I had thought highly of the "mull it over for a week" plan. After a week we'd decide to follow Stephen Wolfram's lead, which seems to be the current patch. I haven't yet used the python permutations iterator, although I used to have a script that solved w

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

2009-01-07 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I'm sorry, I realized right now that settimeout() should be used also *before* invoking accept(), to avoid the client to stall in case the server does not establish any connection. The second patch in attachment does that by using settimeout() straight into F

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Raymond Hettinger
Changes by Raymond Hettinger : Removed file: http://bugs.python.org/file12640/combperm.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Raymond Hettinger
Changes by Raymond Hettinger : Added file: http://bugs.python.org/file12642/combperm2.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue1068268] subprocess is not EINTR-safe

2009-01-07 Thread STINNER Victor
STINNER Victor added the comment: Since Python 2.5 only accept security fixes, you should update your patch to Python trunk. ___ Python tracker ___ ___

[issue4753] Faster opcode dispatch on gcc

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

[issue2262] Helping the compiler avoid memory references in PyEval_EvalFrameEx

2009-01-07 Thread Collin Winter
Changes by Collin Winter : -- nosy: +collinwinter ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

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

2009-01-07 Thread STINNER Victor
STINNER Victor added the comment: Your patch looks correct. -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list U

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

2009-01-07 Thread STINNER Victor
STINNER Victor added the comment: Can you please generate an unified diff (svn diff, diff -u, etc.)? -- nosy: +haypo ___ Python tracker ___ __

[issue4688] GC optimization: don't track simple tuples and dicts

2009-01-07 Thread Collin Winter
Changes by Collin Winter : -- nosy: +collinwinter ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue4871] zipfile can't decrypt

2009-01-07 Thread STINNER Victor
STINNER Victor added the comment: The key is a bytes string or an unicode string? Using bytes, each element is an int instead of a str. -- nosy: +haypo ___ Python tracker ___ __

[issue4874] decoding functions in _codecs module accept str arguments

2009-01-07 Thread STINNER Victor
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_decode() - utf_32_decode() - utf_32_le_decode() - utf_32_be_decode() - utf_32_ex_decode() - unic

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Attached an updated patch which expands the tests and docs. Handles the r>n case with an empty result. Leaves the r<0 case as a ValueError. Am thinking that if we do this, it should be treated as a bug and posted to 2.6 and 3.0. Added file: http://bugs.pyth

[issue4875] find_library can return directories instead of files

2009-01-07 Thread Ryan Kelly
New submission from Ryan Kelly : On win32, ctypes.util.find_library uses os.path.exists() to check for potential library files. This means it is quite happy to return a directory instead of a file, if one happens to exist with the appropriate name somewhere in the search path. Can this please b

[issue4874] decoding functions in _codecs module accept str arguments

2009-01-07 Thread Antoine Pitrou
New submission from Antoine Pitrou : The following function calls should raise a TypeError instead. Encoding functions are fine (they only accept str). >>> import codecs >>> codecs.utf_8_decode('aa') ('aa', 2) >>> codecs.utf_8_decode('éé') ('éé', 4) >>> codecs.latin_1_decode('éé') ('éé', 4) -

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: David, I know the OPs position and Mark's opinion. What is your recommendation for the r>n case and the r<0 case? ___ Python tracker ___

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Summary of functions/definitions expected to return a number: r>n r<0 Source - -- -- error error MS Excel PERMUT() and COMBIN() error error HP32SII nPr and nCr und

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Excel is returning the count, not the set itself. So, it could have chosen to return zero. The HP32SII also has nCr and nPr functions that return INVALID DATA for r>n or r<0. The Combinatorics section of CRC Standard Mathematical Formulae (30th edition) de

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread David W. Lambert
David W. Lambert added the comment: I try to "not know" excel. Does it have any other means to represent an empty set? ___ Python tracker ___ ___

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Data point: Microsoft Excel's PERMUT() and COMBIN() return #NUM! for r>n or r<0. ___ Python tracker ___ _

[issue4873] Refcount error and file descriptor leaks in pwd, grp modules

2009-01-07 Thread David Watson
New submission from David Watson : When investigating issue #4859 I found that when pwd.getpwall() and grp.getgrall() fail due to decoding errors, they leave open file descriptors referring to the passwd and group files, since they don't call the end*ent() functions in this case. Also, the grp.*

[issue4872] Python will not co-exist with MFC (memory leak)

2009-01-07 Thread Martin v. Löwis
Martin v. Löwis added the comment: How do you know that there is a memory leak? I find it very unlikely that this interaction could cause a memory leak (although it is plausible that in this case, not all memory is returned to the system - which is something different from a memory leak). ---

[issue4859] pwd, spwd, grp functions vulnerable to denial of service

2009-01-07 Thread David Watson
David Watson added the comment: > baikie: Open a separated issue for the refcount error and fd leak. OK. It does affect 2.x as well, come to think of it. > On Ubuntu, it's not possible to create an user with a non-ASCII > name: > > $ sudo adduser é --no-create-home > > adduser: To avoid probl

[issue4872] Python will not co-exist with MFC (memory leak)

2009-01-07 Thread nqiang
New submission from nqiang : The following code will cause memory leak in debug mode using visual studio 2008/2005 Comment out either MFC related (CString s) or Python related PY_XX. Then there will be no memory leak. #include #include int _tmain(int argc, _TCHAR* argv[]) { Py_Init

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Mark Dickinson
Mark Dickinson added the comment: Got Sage working again. It also returns an empty list for r > n. For r negative, Combinations returns an empty list and Permutation gives an error. sage: Combinations(range(4), 6) Combinations of [0, 1, 2, 3] of length 6 sage: Combinations(range(4), 6).list

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Mark Dickinson
Mark Dickinson added the comment: Results from Magma, Sage and Gap: Magma provides functions "Subsets(S, k)" and "Permutations(S, k)". From the documentation: Subsets(S, k) : The set of subsets of the set S of size k. If k is larger than the cardinality of S then the result will be empty.

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread David W. Lambert
David W. Lambert added the comment: Mathematica indicates for the user to define it later. An error. In[3]:= Permutations[{1,2},{-2}] Permutations::nninfseq: Position 2 of Permutations[{1, 2}, {-2}] must be All, Infinity, a non-negative integer, or a List whose first element (r

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: David, thanks for the data point. What does it return for In[1]:= Permutations[{a, b, c}, {-1}] ___ Python tracker ___ ___

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread David W. Lambert
David W. Lambert added the comment: Mathematica returns an empty list. In[1]:= Permutations[{1,2},{1}] Out[1]= {{1}, {2}} In[2]:= Permutations[{1,2},{4}] Out[2]= {} In[3]:= -- nosy: +LambertDW ___ Python tracker

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Mark Dickinson
Mark Dickinson added the comment: > 5. This one bugs me a bit. It is nice to have all the factorial > formulas just work and not have a piecewise definition. IIRC, in the 'Concrete Mathematics' book, Knuth and co use something like (n choose k) = (n-to-the-k-falling)/k! to get around this:

[issue4871] zipfile can't decrypt

2009-01-07 Thread Glade Diviney
New submission from Glade Diviney : If a password is supplied using zpifile.read(objName, password), a TypeError occurs: File "C:\Program Files\Python30\lib\zipfile.py", line 420, in __init__ self._UpdateKeys(p) File "C:\Program Files\Python30\lib\zipfile.py", line 424, in _UpdateKeys

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Another thought before I forget: The piecewise definition of the choose function or for binomial coefficients suggests that supporting the r>n case should be accompanied by supporting the r<0 case. ___ Python tracker

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: 1. This is the most important issue. Is the r>n case typically an error in the user's program or thought process. If so, then the utility of a ValueError can be weighed against the utility of other cases where you want combs/perms to automatically handle t

[issue1303434] Please include pdb with windows distribution

2009-01-07 Thread Daniel Stutzbach
Changes by Daniel Stutzbach : -- nosy: +stutzbach ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue4753] Faster opcode dispatch on gcc

2009-01-07 Thread Paolo 'Blaisorblade' Giarrusso
Paolo 'Blaisorblade' Giarrusso added the comment: @skip: In simple words, the x86 call: call 0x2000 placed at address 0x1000 becomes: call %rip + 0x1000 RIP holds the instruction pointer, which will be 0x1000 in this case (actually, I'm ignoring the detail that when executing the call, RIP

[issue4870] ssl module is missing SSL_OP_NO_SSLv2

2009-01-07 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > Actually, that's not quite true. > Specifying TLSv1 or SSLv3 on the > server side will disable SSLv2. There are use cases like FTPS where it is desirable that servers support SSLv3 *and* TLSv1. To do that by using OpenSSL SSLv23 protocol must be specifie

[issue4869] random.expovariate(0.0)

2009-01-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Mark. -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue4870] ssl module is missing SSL_OP_NO_SSLv2

2009-01-07 Thread Bill Janssen
Bill Janssen added the comment: Actually, that's not quite true. Specifying TLSv1 or SSLv3 on the server side will disable SSLv2. However, there's currently no way to specify SSLv3 *or* TLSv1 *but not* SSLv2. This looks easy to fix; I'll add another entry to the list of protocol versions, whi

[issue4850] Change type and add _Py_ prefix to COUNT_ALLOCS variables

2009-01-07 Thread Martin v. Löwis
Changes by Martin v. Löwis : -- resolution: -> accepted status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue4850] Change type and add _Py_ prefix to COUNT_ALLOCS variables

2009-01-07 Thread Martin v. Löwis
Martin v. Löwis added the comment: > My main interest in this patch are the type and %d to %zd change, but > by throwing in the name change, I unintentionally made it more > controversial. Would it help if I resubmit the patch without name > changes or is this something that a committer can ta

[issue4868] Faster utf-8 decoding

2009-01-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 2009-01-07 16:25, Antoine Pitrou wrote: > New submission from Antoine Pitrou : > > Here is a patch to speedup utf8 decoding. On a 64-bit build, the maximum > speedup is around 30%, and on a 32-bit build around 15%. (*) > > The patch may look disturbingl

[issue4850] Change type and add _Py_ prefix to COUNT_ALLOCS variables

2009-01-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 2009-01-07 10:33, Martin v. Löwis wrote: > Martin v. Löwis added the comment: > >> However, they are still exported from the object files, > > Ah. Those are "global symbols", not "exported symbols"; "export" > is a concept specific to Win32. Not at a

[issue4868] Faster utf-8 decoding

2009-01-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ha, the patch makes things slower on MSVC. The patch can probably be rejected, then. (and interestingly, MSVC produces 40% faster code than gcc on my mini-bench, despite the virtual machine overhead) -- resolution: -> rejected status: open -> closed

[issue3244] multipart/form-data encoding

2009-01-07 Thread Chris Lasher
Changes by Chris Lasher : -- nosy: +gotgenes ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue4870] ssl module is missing SSL_OP_NO_SSLv2

2009-01-07 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola' : As came out here: http://groups.google.it/group/comp.lang.python/browse_thread/thread/7d5b96f9bacb03d3?hl=it# ...the ssl module does not provide any facility to disable SSL version 2. This is very important when writing SSLv3/TLSv1 compatible servers.

[issue4868] Faster utf-8 decoding

2009-01-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: As I said I don't think it's due to register allocation, but simply avoiding register write-to-read dependencies by using separate variables for the loop count and the pointer. I'm gonna try under Windows (in a virtual machine, but it shouldn't make much differe

[issue4865] system wide site-packages dir not used on Mac OS X

2009-01-07 Thread Karsten Petersen
Karsten Petersen added the comment: Sorry, I should have made this clear: I am NOT proposing to add this patch. I meant this more to show what related changes were done by Apple. Some of these clearly wouldn't even work like this if applied to a Python not installed in /System/Library/Framewo

[issue4869] random.expovariate(0.0)

2009-01-07 Thread Mark Dickinson
Mark Dickinson added the comment: Doc fixes in r68378. Closing. -- resolution: -> rejected status: open -> closed ___ Python tracker ___ ___

[issue4868] Faster utf-8 decoding

2009-01-07 Thread Martin v. Löwis
Martin v. Löwis added the comment: Can you please upload it to Rietveld? I'm skeptical about changes that merely rely on the compiler's register allocator to do a better job. This kind of change tends to pessimize the code for other compilers, and also may pessimize it for future versions of th

[issue4865] system wide site-packages dir not used on Mac OS X

2009-01-07 Thread Martin v. Löwis
Martin v. Löwis added the comment: IIUC, you are not the author of the patch (in the sense that you wrote the new code), but rather created a diff between Apple's code and Python's. In this case, we cannot accept the patch - it needs to be contributed by the authors (i.e. Apple). Furthermore, I

[issue4869] random.expovariate(0.0)

2009-01-07 Thread Mark Dickinson
Mark Dickinson added the comment: > to allow lambda=0 is sometimes useful in simulations, meaning that it's > infinite time to the next event, i.e. it never occurs. Thanks; that makes sense. If 1./0. returned inf then expovariate would already do what you want. But rightly or wrongly, Python

[issue4869] random.expovariate(0.0)

2009-01-07 Thread Keith Briggs
Keith Briggs added the comment: That's all true - the only thing in favour of my suggestion is that to allow lambda=0 is sometimes useful in simulations, meaning that it's infinite time to the next event, i.e. it never occurs. A FP infinity would do this without requiring a special case. At le

[issue4869] random.expovariate(0.0)

2009-01-07 Thread Mark Dickinson
Mark Dickinson added the comment: I would suggest adding a note to the documentation stating clearly that the parameter should be nonzero. The documentation is also unclear on whether a negative parameter value is permitted, although the current code works exactly the way that I'd expect for

[issue4869] random.expovariate(0.0)

2009-01-07 Thread Mark Dickinson
Mark Dickinson added the comment: An exponential distribution with parameter 0 isn't an exponential distribution any more. On the real line, there isn't even a limiting distribution as the parameter approaches 0. Is there really any use for having expovariate degenerate this way? It seems muc

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

2009-01-07 Thread jice
jice added the comment: Moving the ffi_type affectation before the pre-processor directive seems to work : 648d647 < #ifdef HAVE_USABLE_WCHAR_T 649a649 > #ifdef HAVE_USABLE_WCHAR_T ___ Python tracker __

[issue4869] random.expovariate(0.0)

2009-01-07 Thread Keith Briggs
New submission from Keith Briggs : random.expovariate(lambd) should handle lambd=0 cleanly, and probably return a FP infinity. At the moment it gives: ZeroDivisionError: float division -- components: Extension Modules messages: 79346 nosy: kbriggs severity: normal status: open title: r

[issue1222721] tk + setlocale problems...

2009-01-07 Thread Guilherme Polo
Guilherme Polo added the comment: The problem with the backspace key was fixed in python 2.6 when using the windows installer at least. I didn't check yet if it is specific to tcl/tk or if it involves tkinter. ___ Python tracker

[issue4850] Change type and add _Py_ prefix to COUNT_ALLOCS variables

2009-01-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Jan 7, 2009 at 4:33 AM, Martin v. Löwis wrote: > > Martin v. Löwis added the comment: > .. Furthermore, they all have names that are > unlikely to collide. Even if they get a _Py_ prefix, there could > still be a conflict. > My main interest in

[issue814654] 'import Tkinter' causes windows missing-DLL popup

2009-01-07 Thread Guilherme Polo
Guilherme Polo added the comment: The bug mentioned by the OP doesn't occur with the newer installers, closing. -- nosy: +gpolo resolution: -> out of date status: open -> closed ___ Python tracker _

[issue4025] C99 comments in Python 2.6 break build on AIX 6.1

2009-01-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: It seems everything has been fixed in the 2.6 branch and in trunk. Andrew, can you do a quick SVN checkout and test it? -- nosy: +pitrou ___ Python tracker

[issue4858] Deprecation of MD5

2009-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: For the record, I'm with Martin -- there are many existing uses that we can't just legislate away. -- nosy: +gvanrossum ___ Python tracker ___

[issue4026] fcntl extension fails to build on AIX 6.1

2009-01-07 Thread Jeremy Olexa
Jeremy Olexa added the comment: I have now confirmed that the fix described here[1] works as desired. I don't know if this is proper or not but it matches what inkblotter said. [1]: http://www.ibm.com/developerworks/forums/thread.jspa?threadID=226339 ___ Pyt

[issue4860] js_output wrong for cookies with " characters

2009-01-07 Thread STINNER Victor
STINNER Victor added the comment: The characters <>& should also be escaped. ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue4868] Faster utf-8 decoding

2009-01-07 Thread Antoine Pitrou
New submission from Antoine Pitrou : Here is a patch to speedup utf8 decoding. On a 64-bit build, the maximum speedup is around 30%, and on a 32-bit build around 15%. (*) The patch may look disturbingly trivial, and I haven't studied the assembler output, but I think it is explained by the fact

[issue1622010] Tcl/Tk auto-expanding window

2009-01-07 Thread Guilherme Polo
Guilherme Polo added the comment: I can't reproduce this on python 2.4.4 (or any newer version) using windows vista, so this is either specific to the tk included in python 2.4.2 or tk and your specific os version. If you still have this problem, report it at http://sourceforge.net/projects/

[issue4860] js_output wrong for cookies with " characters

2009-01-07 Thread Noufal
Noufal added the comment: A lot of the cookie tests need to be updated. A separate bug was filed regarding this. http://bugs.python.org/issue3788. I'm working on that now and will apply your patch there as well. ___ Python tracker

[issue4753] Faster opcode dispatch on gcc

2009-01-07 Thread Skip Montanaro
Skip Montanaro added the comment: Paolo> Various techniques allow to create binary code from the Paolo> interpreter binary, by just pasting together the code for the Paolo> common interpreters cases and producing calls to the other. But, Paolo> guess what, on most platforms (except p

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

2009-01-07 Thread jice
New submission from jice : This code works in python 2.5 & 2.6 : >>> import ctypes >>> lib=ctypes.cdll['./libtcod.so'] >>> lib.TCOD_console_init_root(80,50,'test',0) 1 In python 3.0, it crashes in _CallProc (callproc.c, line 1136) : if (atypes[i]->type == FFI_TYPE_STRUCT atypes[i] == NULL here

[issue4866] Code to remove in parsetok?

2009-01-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The code is excluded from compilation with a #ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD There is no __future__ feature in 3.0 for the moment, but the code stays here as a placeholder, to remind developers what they need to do to support __future__ flags

[issue4866] Code to remove in parsetok?

2009-01-07 Thread ganderson
New submission from ganderson : At the lines 99 .. 103, there are the message on Python 2.6. ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4866] Code to remove in parsetok?

2009-01-07 Thread ganderson
Changes by ganderson : -- components: Interpreter Core nosy: ganderson severity: normal status: open title: Code to remove in parsetok? type: behavior versions: Python 3.0 ___ Python tracker

[issue4841] io's close() not handling errors correctly

2009-01-07 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: >> 4. I wonder if internal_close() should reset only the 'fd' field >> or if it should also reset 'readable', 'writable', 'seekable' > > seekable(), readable() and writable() raise an error if the file > is closed. I think it's fine to leave the internal attrib

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

2009-01-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, there are other problems with utf-16, e.g. when opening an existing file for appending, the BOM is written again: >>> f = open('utf16.txt', 'w', encoding='utf-16') >>> f.write('abc') 3 >>> f.close() >>> f = open('utf16.txt', 'a', encoding='utf-16') >>> f.

[issue4865] system wide site-packages dir not used on Mac OS X

2009-01-07 Thread Karsten Petersen
New submission from Karsten Petersen : [Guido asked me to file this as an issue.] On Mac OS X Apple has configured the system provided Python to also search this global site-packages directory: /Library/Python//site-packages/ This allows users to install their own system-wide packages there

[issue4841] io's close() not handling errors correctly

2009-01-07 Thread STINNER Victor
STINNER Victor added the comment: > 1. The handling of the error in internal_close() isn't really good. What > I'm also not sure about is whether it is correct to set the error there, > the old code sometimes did set an error as reaction to internal_close() > failing and sometimes not. internal

[issue4842] int('3L') still valid in Python 3.0

2009-01-07 Thread STINNER Victor
STINNER Victor added the comment: I like the new patches: break int("3L") but keep pickle compatibility. I already noticed the "L" suffix problem when I was hacking the long type in Python 3.x (eg. by using GMP instead of builtin library). -- nosy: +haypo

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

2009-01-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: > The problem is maybe that TextIOWrapper._pack_cookie() > can create a cookie=0 But only when position==0. And in this case, at the beginning of the stream, it makes sense to reset everything to its initial value: zero for the various counts, and call d

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

2009-01-07 Thread STINNER Victor
STINNER Victor added the comment: > This is because the zero in seek(0) is a "cookie" > which contains both the position and the decoder state. > Unfortunately, state=0 means 'endianness has been determined: > native order'. The problem is maybe that TextIOWrapper._pack_cookie() can create a

[issue4263] BufferedWriter non-blocking overage

2009-01-07 Thread Sever Băneșiu
Sever Băneșiu added the comment: > Anyway :) Practically, the test does work on both py3k and another > implementation, so I don't see any urgency to remove anything from it. Indeed, it doesn't hurt keeping it. For completeness' sake I've updated your tests to cover the pre-flush condition exis

[issue4859] pwd, spwd, grp functions vulnerable to denial of service

2009-01-07 Thread STINNER Victor
STINNER Victor added the comment: > For a system program written in Python, this > can amount to a denial of service attack, especially > if the program uses the get*all() functions I don't think that it can be called a "denial of service attack". ___ Pytho

[issue4859] pwd, spwd, grp functions vulnerable to denial of service

2009-01-07 Thread STINNER Victor
STINNER Victor added the comment: About pwd, we have 7 fields: - username: the regex looks like « [a-za-z0-...@] [a-za-z0-...@\/]*$? », so it's ASCII only - password: ASCII only? on my Ubuntu, /etc/passwd uses "x" for all passwords, and /etc/shadow uses MD5 hash with a like like "$1$x6vJEXyc

[issue4753] Faster opcode dispatch on gcc

2009-01-07 Thread Paolo 'Blaisorblade' Giarrusso
Paolo 'Blaisorblade' Giarrusso added the comment: I finally implemented my suggestion for the switch elimination. On top of threadedceval5.patch, apply abstract-switch-reduced.diff and then restore-old-oparg-load.diff to test it. This way, only computed goto's are used. I would like who had mis

[issue4859] pwd, spwd, grp functions vulnerable to denial of service

2009-01-07 Thread STINNER Victor
STINNER Victor added the comment: > it's conceivable that arbitrary data could even be > placed in the username field. On Ubuntu, it's not possible to create an user with a non-ASCII name: $ sudo adduser é --no-create-home adduser: To avoid problems, the username should consist only of letter

[issue4859] pwd, spwd, grp functions vulnerable to denial of service

2009-01-07 Thread STINNER Victor
STINNER Victor added the comment: baikie: Open a separated issue for the refcount error and fd leak. -- nosy: +haypo ___ Python tracker ___ __

[issue4863] deprecate/delete distutils.mwerkscompiler...

2009-01-07 Thread Martin v. Löwis
Martin v. Löwis added the comment: > So the only place it used to work was on pre-Mac OS X, which Python doesn't > support any longer and "will need work" for Windows or Mac OS X which > presumably nobody has done. This module should be deprecated in 3.1 and > removed in 3.2. I would actually

[issue4861] fix problems with ctypes.util.find_library

2009-01-07 Thread Thomas Heller
Thomas Heller added the comment: Matthias Klose schrieb: > there are some problems with ctypes.util.find_library(), which I would > like to see fixed on active branches. > > - find_library is not robust, if either objdump or gcc are not >installed. fixed by raising an exception if the tool

[issue4859] pwd, spwd, grp functions vulnerable to denial of service

2009-01-07 Thread Martin v. Löwis
Martin v. Löwis added the comment: Any decision on this issue should be deferred until a PEP has been written and accepted that decides on usage of bytes in Unix APIs. -- nosy: +loewis ___ Python tracker __

  1   2   >