[issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected

2008-12-19 Thread saa
saa added the comment: There are bigger problems here. When the code calculates the size to map if size is passed as zero, it simply assigns the 64-bit st_size to the size to mmap. On a 32-bit system, it is obvious that the amount to map must be less than a 32-bit value. The calculation sh

[issue3439] create a numbits() method for int and long types

2008-12-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Posted some doc cleanups in r67850 and r67851. ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue4700] UnicodeEncodeError in license()

2008-12-19 Thread Michael Newman
New submission from Michael Newman : UnicodeEncodeError occurs for Microsoft portion of "license()". Confirmed on 3 separate Windows XP computers: Python 3.0 (r30:67507, Dec 3 2008, 20:14:27) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more informat

[issue4567] Registry key not set if unattended installation used

2008-12-19 Thread Martin v. Löwis
Martin v. Löwis added the comment: This is not a bug. The registry keys do get set, though not in HKEY_LOCAL_MACHINE, but in HKEY_CURRENT_USER. To install quietly for all users, you need to add ALLUSERS=1; see http://www.python.org/download/releases/2.5/msi/ -- resolution: -> works fo

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Hagen Fürstenau
New submission from Hagen Fürstenau : As reported by Dmitry Vasiliev on python-dev, a range object suddenly becomes hash()able after an attribute access, e.g. by dir(). If I understand correctly, then the reason is that PyRange_Type doesn't set tp_hash and PyType_Ready is not normally called on

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Hagen Fürstenau
Changes by Hagen Fürstenau : -- keywords: +patch Added file: http://bugs.python.org/file12400/rangehash.patch ___ Python tracker ___ __

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Guilherme Polo
Guilherme Polo added the comment: You don't need to cast PyObject_HashNotImplemented to hashfunc -- nosy: +gpolo ___ Python tracker ___ __

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Hagen Fürstenau
Hagen Fürstenau added the comment: Why does every other place seem to do the cast? Historical reasons? ___ Python tracker ___ ___ Python-bugs-l

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Guilherme Polo
Guilherme Polo added the comment: On Fri, Dec 19, 2008 at 2:02 PM, Hagen Fürstenau wrote: > > Hagen Fürstenau added the comment: > > Why does every other place seem to do the cast? Historical reasons? > No, if you look at the functions being casted you will notice them do not take a pointer t

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Hagen Fürstenau
Hagen Fürstenau added the comment: I'm talking about places like these: [hag...@chage py3k]$ grep -R "(hashfunc)PyObject_HashNotImplemented" Objects/*.c Modules/*.c Objects/dictobject.c: (hashfunc)PyObject_HashNotImplemented, /* tp_hash */ Objects/listobject.c: (hashfunc)PyObject_HashNotIm

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Guilherme Polo
Guilherme Polo added the comment: On Fri, Dec 19, 2008 at 2:14 PM, Hagen Fürstenau wrote: > > Hagen Fürstenau added the comment: > > I'm talking about places like these: > > [hag...@chage py3k]$ grep -R "(hashfunc)PyObject_HashNotImplemented" > Objects/*.c Modules/*.c > Objects/dictobject.c:

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Hagen Fürstenau
Hagen Fürstenau added the comment: Here's an updated patch without the cast and a separate patch for removing the other casts. Added file: http://bugs.python.org/file12401/rangehash2.patch ___ Python tracker __

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Hagen Fürstenau
Changes by Hagen Fürstenau : Added file: http://bugs.python.org/file12402/remove_casts.patch ___ Python tracker ___ ___ Python-bugs-list mailin

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Hagen Fürstenau
Changes by Hagen Fürstenau : Removed file: http://bugs.python.org/file12400/rangehash.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue3439] create a numbits() method for int and long types

2008-12-19 Thread Mark Dickinson
Mark Dickinson added the comment: About the footnote: floor(log(n, 2)) is poor code. This is not supposed to be a dramatic statement, just a statement of fact. Its correctness is dependent on minute details of floating point. It is poor code in exactly the same way that "while x < 1.0: x

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Eric Smith
Changes by Eric Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Hagen Fürstenau
Changes by Hagen Fürstenau : Added file: http://bugs.python.org/file12403/rangehash3.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Hagen Fürstenau
Changes by Hagen Fürstenau : Removed file: http://bugs.python.org/file12401/rangehash2.patch ___ Python tracker ___ ___ Python-bugs-list mailin

[issue3439] create a numbits() method for int and long types

2008-12-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Other possible wording: ... so that ``k`` is approximately ``1 + int(log(abs(x), 2))``. -- assignee: marketdickinson -> rhettinger ___ Python tracker _

[issue4017] Tkinter cannot find Tcl/Tk on Mac OS X

2008-12-19 Thread Muhammad Alkarouri
Muhammad Alkarouri added the comment: 2008/12/18 Benjamin Peterson : > > Benjamin Peterson added the comment: > > I've uploaded a .dmg for 2.6.1 to > http://www.python.org/ftp/python/2.6.1/. Could you please test it? > Just to confirm, I have installed the package in OS X 10.4.11, and Tkinter

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Nick Coghlan
Nick Coghlan added the comment: The origin of the unnecessary hashfunc casts is just me following some of the more specific examples of filling in the tp_hash slot too closely without checking if the cast was still needed. I'll apply and backport Hagen's patches to 3.0 soon (as well as fixing s

[issue4702] [PATCH] msvc9compiler raises IOError when no compiler found instead of DistutilsError

2008-12-19 Thread Philip Jenvey
New submission from Philip Jenvey : Python 2.6's new msvc9compiler misbehaves when it can't find a compiler (actually a utility of the missing compiler) in its query_vcvarsall() -- it raises an IOError instead of a typical distutils error build tools expect a consistent set of potential except

[issue4017] Tkinter cannot find Tcl/Tk on Mac OS X

2008-12-19 Thread Miki Tebeka
Changes by Miki Tebeka : -- nosy: -tebeka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.or

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Nick Coghlan
Nick Coghlan added the comment: OK, the discrepancy with bytearray turns out to be fairly straightforward: bytearray overrides the comparison operations, so inheritance of the default object.__hash__ is automatically blocked. range() objects don't support comparison, so they inherit __hash__ whe

[issue4017] Tkinter cannot find Tcl/Tk on Mac OS X

2008-12-19 Thread Leo M
Changes by Leo M : -- nosy: -leoofborg ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/m

[issue3439] create a numbits() method for int and long types

2008-12-19 Thread Mark Dickinson
Mark Dickinson added the comment: > ... so that ``k`` is approximately ``1 + int(log(abs(x), 2))``. I guess that could work. One other thing: the docs for the trunk seem to suggest that we should be using trunc here, rather than int. I'm looking at: http://docs.python.org/dev/library/stdty

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Patch looks good to me. -- nosy: +amaury.forgeotdarc resolution: -> accepted ___ Python tracker ___ _

[issue4580] slicing of memoryviews when itemsize != 1 is wrong

2008-12-19 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- priority: high -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4700] UnicodeEncodeError in license()

2008-12-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Fixed in r67859 (trunk), r67860 (py3k) and r67861 (3.0) Thanks for the report! -- nosy: +amaury.forgeotdarc resolution: -> fixed status: open -> closed ___ Python tracker __

[issue4702] [PATCH] msvc9compiler raises IOError when no compiler found instead of DistutilsError

2008-12-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I agree with the patch, except that DistutilsPlatformError seems more appropriate - this function is called when the compiler object is configured, before it is used to actually compile files. -- nosy: +amaury.forgeotdarc resolution: -> accepte

[issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected

2008-12-19 Thread saa
saa added the comment: Notes on the problem. The Python mmap documentation says: If length is 0, the maximum length of the map will be the current size of the file when mmap is called. Currently, on a system where off_t is 64-bit and size_t is 32-bit, if the size of the file (st_size) is > 0

[issue4017] Tkinter cannot find Tcl/Tk on Mac OS X

2008-12-19 Thread Ohmi
Ohmi added the comment: Installed on 10.5.6, IDLE ran correctly. Nicely done. ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue4691] IDLE Code Caching Windows

2008-12-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Reopening: the user did not choose the "-n" option; this option is always set when using "edit with IDLE" Windows shell command. -- resolution: invalid -> status: closed -> open ___ Python tracker

[issue4691] IDLE Code Caching Windows

2008-12-19 Thread Brandon Dixon
Brandon Dixon added the comment: I tested this issue in Linux using the IDLE package (packed separately) from Python. I was not able to reproduce this error, so it appears to be with the Windows version of Python. ___ Python tracker

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, xrange() is hashable in Py2.6. I believe it was intended that that carry over to Py3.0's range() objects. -- nosy: +rhettinger ___ Python tracker

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Raymond Hettinger
Changes by Raymond Hettinger : ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/pyt

[issue4533] 3.0 file.read dreadfully slow

2008-12-19 Thread Martin v. Löwis
Changes by Martin v. Löwis : -- priority: deferred blocker -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue4565] io write() performance very slow

2008-12-19 Thread Martin v. Löwis
Changes by Martin v. Löwis : -- priority: deferred blocker -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue1717] Get rid of more refercenes to __cmp__

2008-12-19 Thread Martin v. Löwis
Changes by Martin v. Löwis : -- priority: deferred blocker -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue4604] close() seems to have limited effect

2008-12-19 Thread Martin v. Löwis
Changes by Martin v. Löwis : -- priority: deferred blocker -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue4617] SyntaxError when free variable name is also an exception target

2008-12-19 Thread Martin v. Löwis
Changes by Martin v. Löwis : -- priority: deferred blocker -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue4228] struct.pack('L', -1)

2008-12-19 Thread Martin v. Löwis
Changes by Martin v. Löwis : -- priority: deferred blocker -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue3248] ScrolledText can't be placed in a PanedWindow

2008-12-19 Thread Martin v. Löwis
Changes by Martin v. Löwis : -- priority: deferred blocker -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue3767] tkColorChooser may fail if no color is selected

2008-12-19 Thread Martin v. Löwis
Changes by Martin v. Löwis : -- priority: deferred blocker -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue1706039] Added clearerr() to clear EOF state

2008-12-19 Thread Martin v. Löwis
Changes by Martin v. Löwis : -- priority: deferred blocker -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue1040026] os.times() is bogus

2008-12-19 Thread Martin v. Löwis
Changes by Martin v. Löwis : -- priority: deferred blocker -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue4561] Optimize new io library

2008-12-19 Thread Martin v. Löwis
Changes by Martin v. Löwis : -- priority: deferred blocker -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue4449] AssertionError in Doc/includes/mp_benchmarks.py

2008-12-19 Thread Martin v. Löwis
Changes by Martin v. Löwis : -- priority: deferred blocker -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue4669] bytes,join and bytearray.join not in manual; help for bytes.join is wrong.

2008-12-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: I am puzzled as to what you think is missing in the manual. "Bytes and Byte Array Methods Bytes and bytearray objects, being “strings of bytes”, have all methods found on strings, with the exception of encode(), format() and isidentifier(), which do not make se

[issue4703] Syntax error in sample code for enumerate in documentation.

2008-12-19 Thread Roger
New submission from Roger : Summary: Sample code for enumerate contains a syntax error. The same code reads: >>> for i, season in enumerate(['Spring', 'Summer', 'Fall', 'Winter')]: ... print(i, season) Where the parenthesis and square bracket to the left of the colon in the for line are bac

[issue4703] Syntax error in sample code for enumerate in documentation.

2008-12-19 Thread Benjamin Peterson
Benjamin Peterson added the comment: Thanks for the report! Fixed in r67865. -- nosy: +benjamin.peterson resolution: -> fixed status: open -> closed ___ Python tracker ___ _

[issue4669] bytes,join and bytearray.join not in manual; help for bytes.join is wrong.

2008-12-19 Thread John Machin
John Machin added the comment: Terry, you are right. I missed that. My report was based on looking via the index and finding only "(str method)", no "(byte[sarray] method)". ___ Python tracker __

[issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected

2008-12-19 Thread saa
saa added the comment: Ok, put a fork in me, 'cuz I'm done with this. The latest is that mmap.size() is defined to return the size of the file and not the size of the data. It tries to return it as a ssize_t, which of course, on systems where off_t is 64-bits and ssize_t is 32-bits, won't w

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Nick Coghlan
Nick Coghlan added the comment: It has been pointed out to me that xrange() objects are hashable in 2.x, and since these range objects are immutable, I don't believe there is any driving reason for them not to be hashable. At that point the question becomes one of why xrange() is being initiali

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Nick Coghlan
Nick Coghlan added the comment: Bumping to release blocker for 3.0.1 - until I understand this better, I'm not sure if the xrange->range hashing behaviour change between 2.x and 3.x is a type specific problem or a general issue in the implementation of the new approach to tp_hash inheritance for

[issue4701] range objects becomes hashable after attribute access

2008-12-19 Thread Nick Coghlan
Nick Coghlan added the comment: Ah, I think I figured it out - in 2.x, PyObject_Hash itself includes the fallback to _PyHash_Pointer if none of tp_hash, tp_compare or the tp_richcompare slots have been implemented on the type. So long as a type is only trying to inherit object.__hash__ (as is t