[issue7430] cmp still sends messages

2009-12-04 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Fixed in r76663, r76664. Thanks for the report! -- resolution: - fixed status: open - closed versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7430

[issue7406] int arithmetic relies on C signed overflow behaviour

2009-12-04 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com 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

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

2009-12-04 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com 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

[issue1923] meaningful whitespace can be lost in rfc822_escape

2009-12-04 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- assignee: - tarek nosy: +tarek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1923 ___ ___

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

2009-12-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr 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).

[issue7385] MemoryView_FromObject crashes if PyBuffer_GetBuffer fails

2009-12-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr 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 Pauli Virtanen
Pauli Virtanen p...@iki.fi 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,

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

2009-12-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr 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

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

2009-12-04 Thread Pauli Virtanen
Pauli Virtanen p...@iki.fi 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

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

2009-12-04 Thread Eric Smith
Eric Smith e...@trueblade.com 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

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

2009-12-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr 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

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

2009-12-04 Thread Anthony Foglia
New submission from Anthony Foglia afog...@gmail.com: 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

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

2009-12-04 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- assignee: - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7434 ___

[issue7427] BadStatusLine is hell to debug

2009-12-04 Thread Jake McGuire
Jake McGuire j...@youtube.com 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

[issue7426] StringIO and with statement

2009-12-04 Thread Brian Curtin
Brian Curtin cur...@acm.org added the comment: #1286 looks related -- nosy: +brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7426 ___

[issue7426] StringIO and with statement

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

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

2009-12-04 Thread flox
New submission from flox la...@yahoo.fr: 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:

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

2009-12-04 Thread flox
Changes by flox la...@yahoo.fr: -- keywords: +patch Added file: http://bugs.python.org/file15449/issue7435_py3k.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7435 ___

[issue7436] Define 'object with assignable attributes'

2009-12-04 Thread Terry J. Reedy
New submission from Terry J. Reedy tjre...@udel.edu: 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

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

2009-12-04 Thread Tom Switzer
Tom Switzer thomas.swit...@gmail.com 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

[issue7406] int arithmetic relies on C signed overflow behaviour

2009-12-04 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu 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 Guido van Rossum
Guido van Rossum gu...@python.org 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

[issue7406] int arithmetic relies on C signed overflow behaviour

2009-12-04 Thread Tim Peters
Tim Peters tim.pet...@gmail.com 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

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

2009-12-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr 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 ___

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

2009-12-04 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file15444/json-opts.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6594 ___

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

2009-12-04 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +eric.smith, mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7435 ___ ___

[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 n...@acm.org: 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

[issue1923] meaningful whitespace can be lost in rfc822_escape

2009-12-04 Thread Tarek Ziadé
Tarek Ziadé ziade.ta...@gmail.com 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

[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 arfrever@gmail.com: 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.

[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 arfrever@gmail.com: Added file: http://bugs.python.org/file15452/subprocess.py-3.2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7438 ___

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

2009-12-04 Thread David W. Lambert
New submission from David W. Lambert b49p23t...@stny.rr.com: 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

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

2009-12-04 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net 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

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

2009-12-04 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net 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

[issue7440] distutils shows incorrect Python version in MSI installers

2009-12-04 Thread Mario Vilas
New submission from Mario Vilas mvi...@gmail.com: 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

[issue7440] distutils shows incorrect Python version in MSI installers

2009-12-04 Thread Mario Vilas
Mario Vilas mvi...@gmail.com 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. --