[issue7406] int arithmetic relies on C signed overflow behaviour

2009-12-03 Thread Zooko O'Whielacronx
Zooko O'Whielacronx added the comment: Here is a set of macros that I use to test for overflow: http://allmydata.org/trac/libzutil/browser/libzutil/zutilimp.h -- ___ Python tracker

[issue7406] int arithmetic relies on C signed overflow behaviour

2009-12-03 Thread Zooko O'Whielacronx
Zooko O'Whielacronx added the comment: Here is a way to test for overflow which is correct for any C implementation: static PyObject * int_add(PyIntObject *v, PyIntObject *w) { register long a, b; CONVERT_TO_LONG(v, a); CONVERT_TO_LONG(w, b); if (((a>0)&&(b>0)&&(

[issue7431] UnboundLocalError during test.test_linecache.LineCacheTests

2009-12-03 Thread R. David Murray
R. David Murray added the comment: Fixed in r76659, r76660, r76661, and r76662. I also changed the open to use 'with' so that errors raised by the open will not be masked. Flox, given how active you are being, you might enjoy joining us in #python-dev on freenode. -- resolution: -> f

[issue7431] UnboundLocalError during test.test_linecache.LineCacheTests

2009-12-03 Thread R. David Murray
Changes by R. David Murray : -- assignee: -> r.david.murray components: +Tests -Library (Lib) nosy: +r.david.murray priority: -> low versions: +Python 2.6, Python 3.1 ___ Python tracker ___

[issue7431] UnboundLocalError during test.test_linecache.LineCacheTests

2009-12-03 Thread flox
Changes by flox : -- versions: +Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.or

[issue7431] UnboundLocalError during test.test_linecache.LineCacheTests

2009-12-03 Thread flox
flox added the comment: Actually it should use the TESTFN filename which is always writable. Patch attached. -- keywords: +patch nosy: +flox Added file: http://bugs.python.org/file15448/issue7431.diff ___ Python tracker

[issue7385] MemoryView_FromObject crashes if PyBuffer_GetBuffer fails

2009-12-03 Thread Pauli Virtanen
Changes by Pauli Virtanen : -- type: -> crash ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue7429] PrettyPrinter cannot print dicts with unsortable keys

2009-12-03 Thread R. David Murray
R. David Murray added the comment: Confirmed, it is fixed on all maintained branches. So the fix will be in 3.1.2, which should be in a month or so. -- components: +Library (Lib) -None nosy: +r.david.murray priority: -> normal resolution: -> out of date status: open -> closed type:

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

2009-12-03 Thread Pauli Virtanen
Changes by Pauli Virtanen : -- type: -> crash ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

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

2009-12-03 Thread Pauli Virtanen
New submission from Pauli Virtanen : The following code causes a segmentation fault (or glibc error, or other problems): >>> x = someobject() >>> y = memoryview(x) >>> z = memoryview(y) The problem is that someobject.bf_releasebuffer will be called two times with an identical Py_buffer structur

[issue7432] Py3k doc: "from __future__ import division" not necessary

2009-12-03 Thread Jared Grubb
Jared Grubb added the comment: Ditto on a few dozen lines later: INPLACE_TRUE_DIVIDE()¶ Implements in-place TOS = TOS1 / TOS when from __future__ import division is in effect. -- ___ Python tracker ___

[issue7432] Py3k doc: "from __future__ import division" not necessary

2009-12-03 Thread Jared Grubb
New submission from Jared Grubb : In the Python 3.1 docs for the 'dis' module, the following appears: ( http://docs.python.org/3.1/library/dis.html ) BINARY_TRUE_DIVIDE()¶ Implements TOS = TOS1 / TOS when from __future__ import division is in effect. There is always true in 3k, correct? The

[issue7431] UnboundLocalError during test.test_linecache.LineCacheTests

2009-12-03 Thread ivank
ivank added the comment: This error is just masking a Permission denied error during source = open(source_name, 'w') so I guess it's not very important, just annoying. -- ___ Python tracker ___

[issue7431] UnboundLocalError during test.test_linecache.LineCacheTests

2009-12-03 Thread ivank
New submission from ivank : Python 2.7, svn r76655. I ran the tests with python2.7 Lib/test/testall.py > test-results.txt test_linecache test_checkcache (test.test_linecache.LineCacheTests) ... ERROR test_clearcache (test.test_linecache.LineCacheTests) ... ok test_getline (test.test_linecache.Li

[issue6834] use different mechanism for pythonw on osx

2009-12-03 Thread Ned Deily
Ned Deily added the comment: Another reminder: when implementing, make sure platform.architecture() always returns the correct results for bits. It seems the Apple patches in 10.6 don't handle that (it seems to always report 64-bit), probably because the code in platform.architecture() doesn

[issue4120] Do not embed manifest files in *.pyd when compiling with MSVC

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

[issue4120] Do not embed manifest files in *.pyd when compiling with MSVC

2009-12-03 Thread Martin v . Löwis
Martin v. Löwis added the comment: Thanks for the patch. Committed as r76651, r76652, r76653, r76654, r76655 and r76656. -- ___ Python tracker ___ ___

[issue7430] "cmp" still sends messages

2009-12-03 Thread Mark Dickinson
Mark Dickinson added the comment: How about "maximum recursion depth exceeded in comparison" instead? (It's coming from PyObject_RichCompare in Objects/object.c, by the way.) -- nosy: +mark.dickinson ___ Python tracker

[issue4380] Deepcopy of functools.partial gives wierd exception

2009-12-03 Thread flox
flox added the comment: Already fixed on Python trunk (2.7). Fixed on branches 3.1 and 3.2, too. -- ___ Python tracker ___ ___ Python-

[issue7430] "cmp" still sends messages

2009-12-03 Thread David W. Lambert
New submission from David W. Lambert : ''' RuntimeError: maximum recursion depth exceeded in cmp Python 3.1.1 (r311:74480, Oct 2 2009, 12:29:57) [GCC 4.3.3] on linux2 ''' import itertools,pprint combos = itertools.combinations def connect(nodes,a,b): nodes[a].append(b) n

[issue7429] PrettyPrinter cannot print dicts with unsortable keys

2009-12-03 Thread David W. Lambert
David W. Lambert added the comment: I believe this issue was resolved---expect it in a future release. -- nosy: +LambertDW ___ Python tracker ___

[issue7428] Possible memory issue with optparse

2009-12-03 Thread Martin v . Löwis
Martin v. Löwis added the comment: optparse itself is a pure-python library, so it can't possibly cause memory errors. Thanks for the report, but there isn't any realistic chance that we can do anything with it. So closing it as won't fix. If you want to debug it further, I would run a debug

[issue1398] Can't pickle partial functions

2009-12-03 Thread flox
flox added the comment: It seems fixed on trunk. It is fixed on Python 3.1 and 3.2, too. With Python 2.6 I see the error: >>> ./python partial_bug.py TypeError: can't pickle partial objects Documentation for "trunk" and "py3k" is OK? -- nosy: +flox _

[issue7429] PrettyPrinter cannot print dicts with unsortable keys

2009-12-03 Thread Martin Altmayer
New submission from Martin Altmayer : In the following code I use a class for dictionary-keys that has a __hash__-function but cannot be ordered and try to print that dictionary with a PrettyPrinter. import pprint pp = pprint.PrettyPrinter() # A class that supports hashing and comparison for eq

[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace"

2009-12-03 Thread flox
Changes by flox : Added file: http://bugs.python.org/file15447/issue7381_py3k.diff ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace"

2009-12-03 Thread flox
flox added the comment: Patch against the trunk, and against the Py3k branch. It fixes: * docstring and documentation formatting * and examples -- assignee: -> georg.brandl components: +Documentation nosy: +georg.brandl versions: +Python 2.6, Python 2.7 Added file: http://bugs.pytho

[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace"

2009-12-03 Thread flox
Changes by flox : Removed file: http://bugs.python.org/file15386/issue7381_first.diff ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue6895] locale._parse_localename fails when localename does not contain encoding information

2009-12-03 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: The reason this call fails is that there's no locale alias defined for "ml_IN" in the local_alias dictionary. While the patch is probably a good idea, it also hides the missing mapping. I think a better approach would be to check the locale name for standa

[issue7428] Possible memory issue with optparse

2009-12-03 Thread Bill Spotz
New submission from Bill Spotz : I develop python extension modules for Trilinos, a large scientific computing project: http://trilinos.sandia.gov Unit testing my extension modules under Mac OS X, I came across the following error messages after upgrading from gcc 4.0 to basically any hi

[issue7427] BadStatusLine is hell to debug

2009-12-03 Thread djc
djc added the comment: Also, it might be useful here if it showed repr(line) instead of just line, but that'd just be icing on the cake. -- ___ Python tracker ___ ___

[issue7427] BadStatusLine is hell to debug

2009-12-03 Thread djc
New submission from djc : For whatever reason, BadStatusLine tracebacks often don't show the line passed into them. Given the errr, heavy architecture of httplib, this makes it pretty bad to debug. It's not clear to me why this is: Traceback (most recent call last): File "/home/djc/src/couchdb

[issue2441] Mac build_install.py script fetches unavailable SQLite version

2009-12-03 Thread Gerhard Häring
Gerhard Häring added the comment: This has long been fixed. Even for 2.6maint the SQLite version currently being fetched is 3.6.11. -- resolution: -> out of date status: open -> closed ___ Python tracker _

[issue2441] Mac build_install.py script fetches unavailable SQLite version

2009-12-03 Thread Ronald Oussoren
Changes by Ronald Oussoren : -- assignee: glyph -> ronaldoussoren nosy: +ronaldoussoren ___ Python tracker ___ ___ Python-bugs-list mai

[issue5985] Implement os.path.samefile and os.path.sameopenfile on Windows

2009-12-03 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: -tjreedy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue6895] locale._parse_localename fails when localename does not contain encoding information

2009-12-03 Thread Martin v . Löwis
Martin v. Löwis added the comment: Assigning to MAL, as this is his code. -- assignee: loewis -> lemburg nosy: +lemburg ___ Python tracker ___ ___

[issue5985] Implement os.path.samefile and os.path.sameopenfile on Windows

2009-12-03 Thread Erik Carstensen
Erik Carstensen added the comment: > Once I considered this approach, but problems was that > nFileIndexLow/High can change every time file handle is opened, so it's > not unique. See remarks in following page. > http://msdn.microsoft.com/en-us/library/aa363788%28VS.85%29.aspx Actually, that pa

[issue6895] locale._parse_localename fails when localename does not contain encoding information

2009-12-03 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- versions: +Python 2.6, Python 2.7, Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue6645] multiprocessing build fails on AIX - /dev/urandom (or equivalent) not found

2009-12-03 Thread David Narayan
David Narayan added the comment: This is a patch that I have used on AIX. The idea for this patch came from uuid.py. This patch was created against Python 2.6.4. -- keywords: +patch nosy: +davidnarayan Added file: http://bugs.python.org/file15445/multiprocessing-urandom-fallback.patch

[issue6985] range() fails with long integers

2009-12-03 Thread Mark Dickinson
Mark Dickinson added the comment: Whoops. That revision number should have been r76648. -- ___ Python tracker ___ ___ Python-bugs-list

[issue6985] range() fails with long integers

2009-12-03 Thread Mark Dickinson
Mark Dickinson added the comment: I suspect the ints in builtin_range should have been changed to Py_ssize_t when PEP 353 was implemented. I've fixed them in trunk in r76625; it doesn't seem worth changing this in the 2.6 branch. So on an LP64 machine with sufficient memory, range(2**31) sh

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

2009-12-03 Thread Eric Smith
Eric Smith added the comment: I've raised the issue with unicode and locale on python-dev: http://mail.python.org/pipermail/python-dev/2009-December/094408.html Pending the outcome of that decision, I'll move forward on this issue. -- ___ Python tra

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

2009-12-03 Thread Mark Dickinson
Mark Dickinson added the comment: Reassigning to Eric. -- assignee: mark.dickinson -> eric.smith ___ Python tracker ___ ___ Python-bug

[issue7414] Format code "C" is missing from skipitem() in getargs.c

2009-12-03 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks! Fixed in r76646 (py3k) and r76647 (release31-maint). -- nosy: +mark.dickinson resolution: -> fixed stage: -> committed/rejected status: open -> closed type: -> behavior versions: +Python 3.2 ___ Python tr

[issue7426] StringIO and with statement

2009-12-03 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +alexandre.vassalotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue7426] StringIO and with statement

2009-12-03 Thread Jean-Michel Fauth
New submission from Jean-Michel Fauth : When toying with the "with" statement, I fell on this: Python 2.6.4 >>> with open('abc.txt', 'r') as f: for line in f: print line.rstrip() abc def >>> >>> import StringIO >>> fo = StringIO.StringIO('abc\ndef\n') >>> fo.se