[issue4681] mmap offset should be off_t instead of ssize_t

2008-12-17 Thread saa
New submission from saa p5t...@saaworld.com: In trying to use the mmap offset to allow me to work with a 12GB file, I encountered the fact that the new offset parameter was a ssize_t, which is only 32 bits on my platform (OS X). The mmap offset in C is defined to be an off_t

[issue4681] mmap offset should be off_t instead of ssize_t

2008-12-17 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I don't think fpos_t is a suitable type here. It isn't guaranteed to be an integral type, and, on many systems, it isn't integral. So you can't convert int to it, and you can't do arithmetic on it. -- nosy: +loewis

[issue4681] mmap offset should be off_t instead of ssize_t

2008-12-17 Thread saa
saa p5t...@saaworld.com added the comment: Sorry, I should have explained that the bulk of my patch was derived from existing code. The code that references fpos_t is basically a cut and paste of code from Modules/bz2module.c. I don't know if this is a valid usage of fpos_t, but if it

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: This new patch adds another improvement where tuples can be optimized. Optimized means that tuples which don't contain any GC-tracked object become themselves untracked. Since tuples are immutable this optimization is valid, and since it is common

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

2008-12-17 Thread Skip Montanaro
Changes by Skip Montanaro s...@pobox.com: -- nosy: -skip.montanaro ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3439 ___ ___ Python-bugs-list

[issue1524639] Fix Tkinter Tcl-commands memory-leaks

2008-12-17 Thread Guilherme Polo
Guilherme Polo ggp...@gmail.com added the comment: Fix: My previous comment was about changes in Misc.deletecommand not Misc.destroy (this is what you get for guessing the methods changed in the diff, without applying it). To Quentin: I wouldn't bother mentioning it since this new TkinterError

[issue1170] shlex have problems with parsing unicode

2008-12-17 Thread Nicolau Leal Werneck
Nicolau Leal Werneck nwern...@gmail.com added the comment: Hello. I tried to patch my own shlex, and this doens't seem to be working properly. When I try the patched module isntead of th eoriginal, in my otherwise working program, I get the result ahead. Is there any conversion steps

[issue1170] shlex have problems with parsing unicode

2008-12-17 Thread Nicolau Leal Werneck
Nicolau Leal Werneck nwern...@gmail.com added the comment: OK, it worked after I found out I didn't know how to open unicode files... Sorry for the noise, and thanks for this patch! :] ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1170

[issue4680] Queue class should include high-water mark

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: It is probably easy enough to do so in a custom Queue subclass, and it's too specialized to put in the standard library IMHO. I'm closing the bug, another developer can reopen it if he thinks it is truely useful. -- nosy: +pitrou

[issue1524639] Fix Tkinter Tcl-commands memory-leaks

2008-12-17 Thread Guilherme Polo
Guilherme Polo ggp...@gmail.com added the comment: Rethinking about the changes done in Misc._configure I found out that you don't need any of those there. Isn't it the case of only improving the changes regarding callable overwriting in Misc._options ? So if the value is a callable and the

[issue4684] sys.exit() exits program when non-daemonic threads are still running

2008-12-17 Thread Mark Florisson
New submission from Mark Florisson markflorisso...@gmail.com: sys.exit() exits the program when non-daemonic threads are still running, in versions = 2.5. Test included. A demonstration here: http://paste.pocoo.org/show/95766/ (On debian GNU/Linux) -- components: None files: foo.py

[issue4680] Queue class should include high-water mark

2008-12-17 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I concur with Antoine. -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4680 ___

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

2008-12-17 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Committed Really? YEAH! Great job everybody ;-) I read the code and it looks valid. Micro optimisation (for smaller memory footprint): would it be possible to share the 32 int table (BitLengthTable) between int and long (in

[issue1524639] Fix Tkinter Tcl-commands memory-leaks

2008-12-17 Thread Guilherme Polo
Guilherme Polo ggp...@gmail.com added the comment: The changes in Misc.destroy do not look right, why are you deleting commands created by bind_all (for example) from the root window when a simple widget is destroyed ? It would make more sense to not apply these changes in Misc.destroy,

[issue4681] mmap offset should be off_t instead of ssize_t

2008-12-17 Thread saa
saa p5t...@saaworld.com added the comment: Thanks again, revised patch attached. Added file: http://bugs.python.org/file12376/mmap_off_t_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4681

[issue3110] Multiprocessing package build problem on Solaris 10

2008-12-17 Thread osvenskan
Changes by osvenskan osvens...@users.sourceforge.net: -- nosy: +osvenskan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3110 ___ ___

[issue4680] Queue class should include high-water mark

2008-12-17 Thread Roy Smith
Roy Smith r...@panix.com added the comment: I'm suppose you could implement this in a subclass, but it would be inefficient. You'd have to over-ride put() and get(), call qsize(), then delegate to Base.put() and Base.get(). A cleaner solution would be in the C implementation of deque, in

[issue4683] urllib2.HTTPDigestAuthHandler fails on third hostname?

2008-12-17 Thread Chris Boyle
New submission from Chris Boyle ch...@boyle.name: The attached script, when edited to fill in valid LiveJournal credentials (or InsaneJournal, if you change the URL and user list) fails for me in a very odd way. It fetches the first two URLs quite happily, and returns a 401 on the third after

[issue4685] IDLE will not open (2.6.1 on WinXP pro)

2008-12-17 Thread Ilan
New submission from Ilan idji...@yahoo.com: Hello, I am new to programming... I installed Python a couple days ago with no problems. I used it quite a bit since I'm going through loads of tutorials. All of a sudden, it shut off, closed and will no longer open. This problem seems to be common,

[issue4681] mmap offset should be off_t instead of ssize_t

2008-12-17 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: This is different from bz2, though. In bzlib, there is no API to seek to a certain position. In mmap, the offset type in mmap specified as off_t, so fpos_t plays no role here. ___ Python tracker

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: FWIW, with the tuple optimization, the number of objects in gc.get_objects() after the regression tests has fallen from 15 to 14. ___ Python tracker rep...@bugs.python.org

[issue1524639] Fix Tkinter Tcl-commands memory-leaks

2008-12-17 Thread Quentin Gallet-Gilles
Quentin Gallet-Gilles qgal...@gmail.com added the comment: A little remark : please replace if not globals().has_key('TkinterError'): by if 'TkinterError' not in globals():. has_key is now deprecated in 2.6 and should be avoided. -- nosy: +quentin.gallet-gilles versions: -Python 2.5

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: This new patch also adds a function named gc.is_tracked() which returns True if the object is tracked by the GC: import gc gc.is_tracked(1) False gc.is_tracked([]) True gc.is_tracked(()) True gc.is_tracked((0,1)) False gc.is_tracked((0,a))

[issue4686] Exceptions in ConfigParser don't set .args

2008-12-17 Thread David M. Beazley
New submission from David M. Beazley beaz...@users.sourceforge.net: The ConfigParser module defines a variety of custom exceptions, many of which take more than one argument (e.g., InterpolationError, NoOptionError, etc.). However, none of these exceptions properly set the .args attribute.

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

2008-12-17 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Committed to trunk in r67822, py3k in r67824. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3439 ___

[issue4681] mmap offset should be off_t instead of ssize_t

2008-12-17 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Ah, I think I'm beginning to understand. Thanks for the explanation. So, if I understand correctly, I should refactor the patch and just remove all of the Py_off_t and just use off_t because the standard says that *is* the type.

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Here is a new patch adding tests for gc.is_tracked(). Added file: http://bugs.python.org/file12380/gctrigger4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4074

[issue4682] 'b' formatter is actually unsigned char

2008-12-17 Thread vt
New submission from vt v...@foilhead.net: The 'b' format unit to PyArg_ParseTuple, PyArg_ParseTupleAndKeywords, and PyArg_Parse is described in the documentation (in Parsing arguments and building values) as representing a signed char, but actually represents an unsigned char. Personally, I

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

2008-12-17 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: 32 bytes isn't worth sharing between modules. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3439 ___

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file11743/tuple_gc_hell.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4074 ___

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: New version of Greg's script, with different choices (list of tuples, list of lists, list of dicts, dict of tuples). Added file: http://bugs.python.org/file12382/tuple_gc_hell.py ___ Python tracker

[issue4681] mmap offset should be off_t instead of ssize_t

2008-12-17 Thread saa
saa p5t...@saaworld.com added the comment: Ah, I think I'm beginning to understand. Thanks for the explanation. So, if I understand correctly, I should refactor the patch and just remove all of the Py_off_t and just use off_t because the standard says that *is* the type. Correct?

[issue4680] deque class should include high-water mark

2008-12-17 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Will think about it for a bit. My initial inclination is against because there have been no other such requests to instrument all the fundamental data types, because it's not hard to add instrumentation using your own pure

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Now an additional patch which applies over the basic gctrigger4.patch. It adds dict optimizations so that dicts with only atomic or immutable elements are also untracked (they get tracked later when other trackable elements are added). Since

[issue4397] test_socket fails occassionaly in teardown: AssertionError: [Errno 57] Socket is not connected

2008-12-17 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Thanks for the report. I can reproduce this both on the py3k branch and the trunk. It looks as though there's a race condition in the testShutDown/_testShutDown pair of methods in SocketConnectedTest. If you add the line

[issue4680] deque class should include high-water mark

2008-12-17 Thread Roy Smith
Roy Smith r...@panix.com added the comment: I'm not actually sure what the use case is for clear(). It's easy enough to just create a new deque. If you can do that, why do you need clear()? Since I don't ever see a reason anybody would want to call clear(), I'm not 100% if it should reset the

[issue4273] cycle created by profile.run

2008-12-17 Thread darrenr
darrenr python-roun...@dranalli.com added the comment: I think we still need to prevent collectable cycles in our Python code. Here's the situation: We've got a process that creates many Python objects, and it needs to be responsive, it's not good for it to block on one operation for more than

[issue2467] gc.DEBUG_STATS reports invalid elapsed times

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Fixed in r67832, thanks! -- nosy: +pitrou resolution: - fixed stage: - committed/rejected status: open - closed versions: +Python 2.7 -Python 2.5, Python 2.6 ___ Python tracker rep...@bugs.python.org

[issue1524639] Fix Tkinter Tcl-commands memory-leaks

2008-12-17 Thread Guilherme Polo
Guilherme Polo ggp...@gmail.com added the comment: I've fixed the leaks in Variable doing this: http://code.google.com/p/plumage/source/detail?r=93 I don't use an extra _tclCommands for Variable, instead in __del__ I use the information returned by Variable.trace_vinfo to remove associated

[issue4687] GC stats not accurate because of debug overhead

2008-12-17 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: With gc.DEBUG_STATS, each GC collection displays the elapsed time. Unfortunately, this elapsed time includes the debug overhead itself, most notable the calls to gc_list_size() which can be quite expensive with lots of objects in the older

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file12383/dictopts.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4074 ___

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file12353/gctrigger.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4074 ___

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file12378/gctrigger2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4074 ___

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file12379/gctrigger3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4074 ___

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file12380/gctrigger4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4074 ___

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Cleanup: this patch only has the algorithmic change. Tuple and dict opts will go to a separate tracker issue. Added file: http://bugs.python.org/file12386/gctrigger5.patch ___ Python tracker

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

2008-12-17 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: Split out from #4074, here is a standalone patch which disables GC tracking for simple tuples (tuples made of atomic objects or immutable containers, possibly nested). The performance improvement can be evaluated using tuple_gc_hell.py from

[issue4074] Building a list of tuples has non-linear performance

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The optimization issue for tuples and dicts is #4688. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4074 ___

[issue4680] deque class should include high-water mark

2008-12-17 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: FWIW, here's a trivial Queue subclass with instrumentation: class HighWaterQueue(Queue): def _init(self, maxsize): Queue.__init__(self, maxsize) self.highwater = 0 def _put(self, item):

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

2008-12-17 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: I've looked very quickly over your patches to try to figure what rule qualifies a tuple or dict as simple enough to be untracked, out of curiosity. For tuples, I think the rule is: If an object is immutable, and it points

[issue4689] Typo in PyObjC URL on GUI Programming on the Mac

2008-12-17 Thread Mark Evans
New submission from Mark Evans markmev...@spamcop.net: The GUI Programming on the Mac page: http://www.python.org/doc/2.5.3/mac/node10.html states that the PyObjC project is at: http://pybojc.sourceforge.net This is incorrect and should be: http://pyobjc.sourceforge.net This appears

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

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Le mercredi 17 décembre 2008 à 23:56 +, Daniel Stutzbach a écrit : For tuples, I think the rule is: If an object is immutable, and it points only to untracked objects, the object can be untracked. Roughly, yes. Exactly, it is if it

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

2008-12-17 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4688 ___ ___

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

2008-12-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: So, I've tried without the dedicated flag in the dict object and it's as fast as previously! Here is a new patch. Added file: http://bugs.python.org/file12389/dictopts2.patch ___ Python tracker

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

2008-12-17 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file12388/dictopts.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4688 ___

[issue4690] asyncore calls handle_write() on closed sockets when use_poll=True

2008-12-17 Thread Forest Wilkinson
New submission from Forest Wilkinson for...@users.sourceforge.net: With use_poll=True on linux, asyncore calls handle_write() after the socket has been closed. More specifically, it looks like asyncore dispatches handle_read() and handle_close() events between the writable() test and the

[issue4643] cgitb.html fails if getattr call raises exception

2008-12-17 Thread Allan Crooks
Allan Crooks a...@users.sourceforge.net added the comment: In terms of patching scanvars, I came up with the following solution: ORIGINAL: if parent is not __UNDEF__: value = getattr(parent, token, __UNDEF__) vars.append((prefix + token, prefix, value)) SOLUTION: if parent is not

[issue3110] Multiprocessing package build problem on Solaris 10

2008-12-17 Thread osvenskan
osvenskan osvens...@users.sourceforge.net added the comment: I'm facing the same problem (getting a good definition of SEM_VALUE_MAX) for my posix_ipc extension. The patch presented here will get the compiler to shut up on OpenSolaris, but not for the reason you think. At least, that's the way I

[issue1524639] Fix Tkinter Tcl-commands memory-leaks

2008-12-17 Thread Guilherme Polo
Guilherme Polo ggp...@gmail.com added the comment: On Wed, Dec 17, 2008 at 3:51 PM, Guilherme Polo rep...@bugs.python.org wrote: Guilherme Polo ggp...@gmail.com added the comment: Rethinking about the changes done in Misc._configure I found out that you don't need any of those there. Isn't

[issue4680] deque class should include high-water mark

2008-12-17 Thread Roy Smith
Roy Smith r...@panix.com added the comment: And, FWIW, I did figure out a use case for clear(). I create a queue and pass it to two threads. One side or the other decides to abandon processing of the events currently in the queue. I can't just create a new queue, because you have no way to

[issue2944] asyncore doesn't handle connection refused correctly

2008-12-17 Thread Forest Wilkinson
Changes by Forest Wilkinson for...@users.sourceforge.net: -- nosy: +forest ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2944 ___ ___

[issue4680] deque class should include high-water mark

2008-12-17 Thread Tim Peters
Tim Peters tim.pet...@gmail.com added the comment: There's no need to keep asking -- this report was already rejected ;-) Seriously, the efficiency argument carries no weight with me -- in 15 years of using Queue in a variety of applications, the time it takes to .put and .get here's a piece of

[issue4691] IDLE Code Caching Windows

2008-12-17 Thread Brandon Dixon
New submission from Brandon Dixon brandon.s.di...@gmail.com: I made changes to my code and hit F5 to run it through IDLE. The code appeared to run without any errors, but when I closed everything out and ran it again it turned out to be full of errors. I am able to replicate this problem with

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

2008-12-17 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: IIUC, you try to find various places where tuples are created, and check whether they create tuples that don't need tracking. I think this approach is difficult to maintain, and also may miss some objects. I'd rather see that integrated

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

2008-12-17 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: Unfortunately, the check is O(n), so it can get a little expensive. I suppose that's no worse than traversing the tuple to look for a cycle, though. Perhaps it could be done at the same time? Can _PyObject_GC_UNTRACK() be

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

2008-12-17 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Unfortunately, the check is O(n), so it can get a little expensive. Not in the typical case, I guess. *If* you have to go through all objects, then likely you end up untracking the object. If you can't untrack, you typically find a tracked

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

2008-12-17 Thread Gregory P. Smith
Changes by Gregory P. Smith g...@krypto.org: -- nosy: +gregory.p.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4688 ___ ___ Python-bugs-list

[issue4621] zipfile returns string but expects binary

2008-12-17 Thread Francesco Ricciardi
Francesco Ricciardi francesco.riccia...@hp.com added the comment: If that is what is requested, then the manual entry for ZipFile.read must be corrected, because it states: ZipFile.read(name[, pwd]) name is the name of the file in the archive, or a ZipInfo object. However, Eddie, you