[issue7440] distutils shows incorrect Python version in MSI installers

2009-12-04 Thread Mario Vilas
Mario Vilas added the comment: My proposed patch is to change line 506 of bdist_msi.py from this: version = sys.version[:3]+" " to this: version = self.target_version[:3]+" " which is what I did to work around the problem. -- ___

[issue7440] distutils shows incorrect Python version in MSI installers

2009-12-04 Thread Mario Vilas
New submission from Mario Vilas : I just hit this silly bug in distutils, should be quite easy to fix. When building MSI installers for a target_version other than the current Python version, the target directory selection dialog shows a wrong message. For example, here is a screen capture of an

[issue7434] pprint doesn't know how to print a namedtuple

2009-12-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: I agree with you that pprint needs to be rewritten to make it more extensible. I do not see a straight-forward way of handling your feature request. First, namedtuple() is a factory function and is not itself a class, so there is no standard way to recogniz

[issue1771] Remove cmp parameter to list.sort() and builtin.sorted()

2009-12-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, we had a long discussion on comp.lang.python and the net result was that no use cases were found that required a cmp function. One complex case (sorting recursive tree structures) at first appeared to need a cmp-function but was found to be simpler and

[issue7439] Bug or expected behavior? I cannot tell.

2009-12-04 Thread David W. Lambert
New submission from David W. Lambert : Raymond Hettinger posted clever Hamming number generator, http://code.activestate.com/recipes/576961/ which I tried to modify. The function gives incorrect output when called as hamming_numbers(shorthand = True). It seemed reasonable to expect the two arra

[issue7438] Allow to use a part of subprocess module during building Python

2009-12-04 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : Added file: http://bugs.python.org/file15452/subprocess.py-3.2.patch ___ Python tracker ___ __

[issue7438] Allow to use a part of subprocess module during building Python

2009-12-04 Thread Arfrever Frehtes Taifersar Arahesis
New submission from Arfrever Frehtes Taifersar Arahesis : It is sometimes useful to call subprocess.Popen() in setup.py of Python. Currently it would fail, because subprocess module tries to import some modules, which not always are used. I suggest to delay some imports. -- components:

[issue1923] meaningful whitespace can be lost in rfc822_escape

2009-12-04 Thread Tarek Ziadé
Tarek Ziadé added the comment: Notice that we are also losing something else that can mean a lot in reST : empty lines. They also need to be escaped. But we can't do it properly unless we encode empty lines with something else than a 8 space line because when rfc822.Message reads it, it removes

[issue7437] OS X 2.6.4 installer fails on 10.3 with two corrupted file names, ignored on 10.4

2009-12-04 Thread Ned Deily
New submission from Ned Deily : See the thread starting at http://mail.python.org/pipermail/pythonmac- sig/2009-December/021907.html for full details. It appears two vestigial gif files included in the 2.6.4 OS installer are being installed under corrupted file names by the OS X Installer.app

[issue7435] Int/Long: some tests are duplicate and error messages refer to "long"

2009-12-04 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +eric.smith, mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue6594] json C serializer performance tied to structure depth on some systems

2009-12-04 Thread Antoine Pitrou
Changes by Antoine Pitrou : Removed file: http://bugs.python.org/file15444/json-opts.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue6594] json C serializer performance tied to structure depth on some systems

2009-12-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a new patch with an internal memo dict to reuse equal keys, and some tests. -- stage: -> patch review versions: +Python 3.2 Added file: http://bugs.python.org/file15450/json-opts2.patch ___ Python tracker <

[issue7406] int arithmetic relies on C signed overflow behaviour

2009-12-04 Thread Tim Peters
Tim Peters added the comment: Terry, the language reference also says: """ For the purpose of shift and mask operations, a binary representation is assumed, and negative numbers are represented in a variant of 2's complement which gives the illusion of an infinite string of sign bits extending

[issue1771] Remove cmp parameter to list.sort() and builtin.sorted()

2009-12-04 Thread Guido van Rossum
Guido van Rossum added the comment: Can someone provide a code sample to make this argument more understandable for those of us who don't compare points by angular order for a living... :-) I'm not sure what the 2to3 example (I presume you mean msg59937) shows except that conversion from a c

[issue7406] int arithmetic relies on C signed overflow behaviour

2009-12-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: I consider the binary bitwise operations, for negative ints, to be either undefined or wrongly implemented. Consider the following (3.1) >>> 3^2 1 >>> -3^2 -1 >>> 3^-2 -3 >>> -3^-2 3 >>> 2^3 1 >>> -2^3 -3 Something change sign just flips the sign of the result,

[issue1771] Remove cmp parameter to list.sort() and builtin.sorted()

2009-12-04 Thread Tom Switzer
Tom Switzer added the comment: I am not sure I understand the reasoning behind removing the cmp parameter (and agree with Lea Wiemann). Trying to wedge a proper comparison into the key parameter is clumsy and unreadable (as can be seen in the 2to3 example above). The intrinsic ordering on object

[issue7436] Define 'object with assignable attributes'

2009-12-04 Thread Terry J. Reedy
New submission from Terry J. Reedy : On Python list, someone asked what guarantees that functions have and will continue to have assignable attributes. I started to say 'the docs' but failed to find anything specific in 7.6. Function definitions or LibRef 5.12.3. Functions (all references to 3.1/

[issue7435] Int/Long: some tests are duplicate and error messages refer to "long"

2009-12-04 Thread flox
Changes by flox : -- keywords: +patch Added file: http://bugs.python.org/file15449/issue7435_py3k.diff ___ Python tracker ___ ___ Pytho

[issue7435] Int/Long: some tests are duplicate and error messages refer to "long"

2009-12-04 Thread flox
New submission from flox : In python 3.x there's a single type for integer: int. The automatic conversion of the test suite has created many tests which are duplicate of each other. The attached patch removes duplication of tests, and fix the strings for these modules: Lib/random.py Lib/tes

[issue7426] StringIO and with statement

2009-12-04 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti : -- resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> fileinput, StringIO, and cStringIO do not support the with protocol ___ Python tracker

[issue7426] StringIO and with statement

2009-12-04 Thread Brian Curtin
Brian Curtin added the comment: #1286 looks related -- nosy: +brian.curtin ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue7427] BadStatusLine is hell to debug

2009-12-04 Thread Jake McGuire
Jake McGuire added the comment: I think what's happening is that your connection is being closed due to inactivity, so the status line that comes back is empty. Printing repr(line) would probably make the emptiness clear, but maybe the httplib code should put in a more specific message in th

[issue7434] pprint doesn't know how to print a namedtuple

2009-12-04 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue7434] pprint doesn't know how to print a namedtuple

2009-12-04 Thread Anthony Foglia
New submission from Anthony Foglia : It would be nice if pprint could format namedtuples wrapping lines as it does with tuples. Looking at the code, this does not look like an easy task. Completely rewriting pprint to allow it to be extensible to user-created classes would be best, but involve

[issue7433] MemoryView memory_getbuf causes segfaults, double call to tp_releasebuffer

2009-12-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: > To work around this, *_releasebuf must be written so that it does not > use the "view" pointer passed to it -- the data structure may have been > shallow copied and any memory pointers in it may have already been freed. > > I can try to cook up a patch fixing

[issue7327] format: minimum width: UTF-8 separators and decimal points

2009-12-04 Thread Eric Smith
Eric Smith added the comment: See the discussion on python-dev, in particular Martin's comment at http://mail.python.org/pipermail/python-dev/2009-December/094412.html The solutions to this seem too complex for 2.x. It is not a problem in 3.x. -- resolution: -> wont fix status: open -

[issue7433] MemoryView memory_getbuf causes segfaults, double call to tp_releasebuffer

2009-12-04 Thread Pauli Virtanen
Pauli Virtanen added the comment: I think this is an implementation issue in MemoryView rather than an issue with the buffer interface. PEP 3118 states, "This same bufferinfo structure must be passed to bf_releasebuffer (if available) when the consumer is done with the memory." -- this is not gu

[issue7433] MemoryView memory_getbuf causes segfaults, double call to tp_releasebuffer

2009-12-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I was probably thinking about allocating new temporary arrays for > strides etc. on each *_getbuffer -- if that's done, then manually > keeping track of all the allocated memory seems like a waste of effort > (ie. not feasible). Yes, I know it looks very pain

[issue7433] MemoryView memory_getbuf causes segfaults, double call to tp_releasebuffer

2009-12-04 Thread Pauli Virtanen
Pauli Virtanen added the comment: > Why do you say that: > > > There is no feasible way the bf_releasebuffer can keep track of how > > many calls to it have been made. I was probably thinking about allocating new temporary arrays for strides etc. on each *_getbuffer -- if that's done, then ma

[issue7385] MemoryView_FromObject crashes if PyBuffer_GetBuffer fails

2009-12-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Nice catch. I wonder whether there's a simple way of cooking up an unit test for this (short of creating a new extension type). -- assignee: -> pitrou nosy: +pitrou priority: -> high stage: -> needs patch versions: +Python 2.7, Python 3.2 __

[issue7433] MemoryView memory_getbuf causes segfaults, double call to tp_releasebuffer

2009-12-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Why do you say that: > There is no feasible way the bf_releasebuffer can keep track of how many > calls to it have been made. Because that's exactly what e.g. bytearray objects do (see the ob_exports field in Objects/bytearrayobject.c). -- nosy: +pitr

[issue1923] meaningful whitespace can be lost in rfc822_escape

2009-12-04 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- assignee: -> tarek nosy: +tarek ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7048] decimal.py: logb: round the result if it is greater than prec

2009-12-04 Thread Mark Dickinson
Mark Dickinson added the comment: Mike Cowlishaw has confirmed that the tests scbx164, scbx165 (in version 2.59 of the tests) are implementation-specific, so test_decimal is doing the right thing in skipping them. So I think this issue can be closed. I don't think it's worth removing the res

[issue7406] int arithmetic relies on C signed overflow behaviour

2009-12-04 Thread Mark Dickinson
Mark Dickinson added the comment: Zooko: Yes; that's the sort of solution that's needed if we're not allowed to assume two's complement with the extraordinary value (- sys.maxint - 1) not a trap representation. If we are allowed to assume this, then more efficient solutions are available. Al

[issue7430] "cmp" still sends messages

2009-12-04 Thread Mark Dickinson
Mark Dickinson added the comment: Fixed in r76663, r76664. Thanks for the report! -- resolution: -> fixed status: open -> closed versions: +Python 3.2 ___ Python tracker ___ __