[issue5048] Extending itertools.combinations

2009-01-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: Guido disallowed returning a len method on iterators. He expected bool(it) to be False. The recipes section of the itertools docs has code for combinations_with_replacement(). It was not included originally because it was unclear whether there was actually

[issue5048] Extending itertools.combinations

2009-01-24 Thread Ezio Melotti
Ezio Melotti added the comment: It would also be nice to have a __len__ method on both permutations and combinations. len(permutations(sequence)) could return the number of permutations using the formulas (e.g. n! for permutations) without generating all the possible permutations (as opposed to

[issue5050] unicode(C) invokes C.__unicode__ when __unicode__ is defined

2009-01-24 Thread Martin v. Löwis
Martin v. Löwis added the comment: No further bugs will be fixed in Python 2.5, unless they are security bugs (which this is not). So closing it as "won't fix". -- nosy: +loewis resolution: -> wont fix status: open -> closed ___ Python tracker

[issue5050] unicode(C) invokes C.__unicode__ when __unicode__ is defined

2009-01-24 Thread Yu-Jie Lin
New submission from Yu-Jie Lin : Run the following code class A: def __str__(self): return "__str__" def __unicode__(self): return "__unicode__" a = A() print str(a), unicode(a) print str(A), unicode(A) Results on Python 2.5.4 (r254:67916): __str__ __unicode__ __main__.A Tra

[issue5048] Extending itertools.combinations

2009-01-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: Do you have compelling use cases? Is it worth what it takes to preserve the relation with permuations() and product() and the lexicographic orderings? Do we care the length of the output is no longer predictable by a simple n! / r! / (n-r)! ? Do we care t

[issue5049] ctypes unwilling to allow pickling wide character

2009-01-24 Thread Jesse Noller
Changes by Jesse Noller : -- nosy: +jnoller ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue5049] ctypes unwilling to allow pickling wide character

2009-01-24 Thread Jason R. Coombs
Jason R. Coombs added the comment: I just discovered that trying to pickle a structure with even just a c_wchar (not an array) also fails. -- title: ctypes unwilling to allow pickling wide character array -> ctypes unwilling to allow pickling wide character ___

[issue5049] ctypes unwilling to allow pickling wide character array

2009-01-24 Thread Jason R. Coombs
New submission from Jason R. Coombs : Using Python 2.6.1, I'm unable to pickle a simple object with an array of wide characters. import ctypes, pickle class MyStruct(ctypes.Structure): _fields_ = [('name', ctypes.c_wchar*2)] s = MyStruct('DC') pickle.dumps(s) # raises ValueError. Replace c

[issue5048] Extending itertools.combinations

2009-01-24 Thread Konrad
New submission from Konrad : The function itertools.combinations might benefit from making the 'r' (length of the combinations) argument optionally a sequence. With that change one could call combinations(sequence, [2, 3]) in order to get all combinations of length 2 and 3. In particular, one co

[issue5047] Remove Monterey support from configure.in

2009-01-24 Thread Skip Montanaro
Skip Montanaro added the comment: And a diff for README. The other changes in r16962 seem to be bug fixes which, while exposed by the Monterey port, don't appear to be platform- dependent. Added file: http://bugs.python.org/file12851/README.diff ___ Python

[issue5047] Remove Monterey support from configure.in

2009-01-24 Thread Skip Montanaro
Skip Montanaro added the comment: Here's the original patch as an attachment. -- keywords: +patch Added file: http://bugs.python.org/file12850/configure.in.diff ___ Python tracker __

[issue4753] Faster opcode dispatch on gcc

2009-01-24 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: In the comment, you might mention both -fno-crossjumping and -fno-gcse. -fno-crossjumping's description looks like it ought to prevent combining computed gotos, but http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Optimize-Options.html says -fno-gcse actually does i

[issue5047] Remove Monterey support from configure.in

2009-01-24 Thread Skip Montanaro
Skip Montanaro added the comment: Martin> You might want to take a look at r16962. It changed a few other Martin> things as well. Will do. Martin> Please do put patches into attachments, rather than including Martin> them in the message. Yeah, that's new mail program version sucka

[issue5047] Remove Monterey support from configure.in

2009-01-24 Thread Martin v. Löwis
Martin v. Löwis added the comment: You might want to take a look at r16962. It changed a few other things as well. Please do put patches into attachments, rather than including them in the message. -- nosy: +loewis ___ Python tracker

[issue5046] native win32 and wine mingw+msys build of python2.7

2009-01-24 Thread Martin v. Löwis
Martin v. Löwis added the comment: Please don't post work in progress to this bugtracker. -- nosy: +loewis resolution: -> rejected status: open -> closed ___ Python tracker ___

[issue5026] [reopening] native build of python win32 using msys under both wine and native win32

2009-01-24 Thread Luke Kenneth Casson Leighton
Luke Kenneth Casson Leighton added the comment: #5046 supercedes this patch, for python2.7. still relevant for python2.5 though. ___ Python tracker ___ __

[issue4111] Add DTrace probes

2009-01-24 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue1672332] cPickle cannot unpickle subnormal floats on some machines

2009-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: Fix merged in r68907 (2.6), r68908 (3.1) and r68909 (3.0). -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___

[issue5034] itertools.fixlen

2009-01-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: Am still leaning towards rejecting this one based on: * paucity of use cases * non-atomicity (it can be built-out of existing tools) * minimizing the number of tools in the toolkit * not convinced that padded tuple unpacking is desirable

[issue5047] Remove Monterey support from configure.in

2009-01-24 Thread Skip Montanaro
New submission from Skip Montanaro : The attached patch removes vestiges of Monterey compiler support from configure.in. Apparently Monterey was some ill-conceived 64-bit SCO/IBM operating system which died in 2000. Can't see why we need to support it. Skip ===File ~/src/python/trunk/configur

[issue5046] native win32 and wine mingw+msys build of python2.7

2009-01-24 Thread Luke Kenneth Casson Leighton
New submission from Luke Kenneth Casson Leighton : this is an update of the mingw+msys port for native win32, with the aim of being both compiled and used under both wine-win32 and native-win32. it is not a cross-compile patch. it does not require -lwine. it does not require a unix system. it

[issue5045] imaplib should remove length of literal strings

2009-01-24 Thread Branden Moore
New submission from Branden Moore : IMAP Literals are a tricky subject. Currently, if IMAP returns: * text text text {5}\r\n 12345more text imaplib will return 2 data items: [("text text text {5}", '12345'), "more text"] This forces users of imaplib to then parse out and remove the '{5}' from

[issue3657] pickle can pickle the wrong function

2009-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: I just committed Tim's suggested change in r68906. This seemed a no- brainer, regardless of what should be done about pickle.whichmodule. One fewer sporadic buildbot failure sounds like a good thing to me. (I hadn't noticed the pickletools failures until jus

[issue4676] python3 closes + home keys

2009-01-24 Thread Weeble
Weeble added the comment: Another complication. On Windows, this line doesn't do what it claims: if (event.state & 12) != 0 and event.keysym == "Home": # state&1==shift, state&4==control, state&8==alt return # ; fall back to class binding The comment says state&8==alt, but this is wron

[issue5044] name not found in generator in eval()

2009-01-24 Thread David W. Lambert
Changes by David W. Lambert : -- nosy: +LambertDW ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue2527] Pass a namespace to timeit

2009-01-24 Thread David W. Lambert
David W. Lambert added the comment: This note is simply a reminder that Antoine's 'from __main__ import *' solution fails in python3. Also, resolution of this issue probably could incorporate Issue1397474. >>> import timeit >>> timeit.timeit('None','from __main__ import *') Traceback (most

[issue3657] pickle can pickle the wrong function

2009-01-24 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +marketdickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue1672332] cPickle cannot unpickle subnormal floats on some machines

2009-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks, Antoine! ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue1672332] cPickle cannot unpickle subnormal floats on some machines

2009-01-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: This is not a new failure but an erratic one, and caused by a weakness in pickle's handling of functions. See #3657. -- nosy: +pitrou ___ Python tracker

[issue5016] FileIO.seekable() can return False

2009-01-24 Thread STINNER Victor
STINNER Victor added the comment: Woops, I attached the wrong patch! Added file: http://bugs.python.org/file12848/fileio_seekable.patch ___ Python tracker ___ ___

[issue5016] FileIO.seekable() can return False

2009-01-24 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file12821/fileio_append.patch ___ Python tracker ___ ___ Python-bugs-list mail

[issue4676] python3 closes + home keys

2009-01-24 Thread Weeble
Weeble added the comment: I have experienced similar problems in Python 2.6.1 on Windows, and found them to be due to Tk 8.5. I posted my findings here: http://mail.python.org/pipermail/idle-dev/2009-January/002738.html In summary, Tk 8.5 changed the name of the "anchor" mark to be unique to e

[issue1672332] cPickle cannot unpickle subnormal floats on some machines

2009-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: Hmm. After checking in this patch, the gentoo x86 trunk buildbot has a new failure in test_pickletools, with the following output: test_pickletools ** File "/home/buildslave/python-trunk/trun

[issue5043] get_msvcr() returns None rather than []

2009-01-24 Thread Roumen Petrov
Roumen Petrov added the comment: My comment on this part of code is( from issue3871): +# FIXME: next code is from issue870382 +# MS C-runtime libraries never support backward compatibility. +# Linking to a different library without to specify correct runtime +# version for the h

[issue1529142] Allowing multiple instances of IDLE with sub-processes

2009-01-24 Thread Weeble
Weeble added the comment: I installed Ubuntu on a laptop at the beginning of January and have applied the patch I submitted above to IDLE. I've been using it regularly for the last few weeks and have had no problems with it. ___ Python tracker

[issue5044] name not found in generator in eval()

2009-01-24 Thread Frank Henigman
New submission from Frank Henigman : # works >>> eval( "sum( [ a[0]=='a' for j in 'a' ] )", {}, dict(a='a')) # take out the square brackets >>> eval( "sum( a[0]=='a' for j in 'a' )", {}, dict(a='a')) NameError: global name 'a' is not defined -- components: Interpreter Core messages:

[issue5037] unicode(x) for weakref.proxy objects invokes __str__ instead of __unicode__

2009-01-24 Thread Benjamin Peterson
Benjamin Peterson added the comment: Here's a patch. -- keywords: +needs review, patch priority: -> high Added file: http://bugs.python.org/file12847/weakref_unicode.patch ___ Python tracker __

[issue5031] Thread.daemon docs

2009-01-24 Thread Jesse Noller
Jesse Noller added the comment: Then the patch I wrote before "correcting it" was more purist ;) I preferred the `daemon` = ``False`` wording as well. Here's a corrected patch. Added file: http://bugs.python.org/file12846/issue5031.patch ___ Python tracker

[issue5031] Thread.daemon docs

2009-01-24 Thread Jesse Noller
Changes by Jesse Noller : Removed file: http://bugs.python.org/file12843/issue5031.patch ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue5043] get_msvcr() returns None rather than []

2009-01-24 Thread Luke Kenneth Casson Leighton
New submission from Luke Kenneth Casson Leighton : def get_msvcr(): """Include the appropriate MSVC runtime library if Python was built with MSVC 7.0 or later. """ msc_pos = sys.version.find('MSC v.') if msc_pos != -1: msc_ver = sys.version[msc_pos+6:msc_pos+10]

[issue4908] adding a get_metadata in distutils

2009-01-24 Thread Ray
Ray added the comment: There wouldn't be an easy way to read the distutils setup.py info at all in 2.4? i suppose i could write something specific for our environment. On 1/24/09, Tarek Ziadé wrote: > > Tarek Ziadé added the comment: > > Well since Python 2.4 doesn't have the egg-info feat

[issue1672332] cPickle cannot unpickle subnormal floats on some machines

2009-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: Fixed in the trunk in r68903. If the buildbots are happy with the new tests, I'll port to 2.6, 3.0 and 3.1. -- versions: -Python 2.7 ___ Python tracker __

[issue4982] Running python 3 as Non-admin User requests the Runtime to terminate in an unusual way.

2009-01-24 Thread Martin v. Löwis
Martin v. Löwis added the comment: Do you have PYTHONPATH set, by any chance? Python 3.0 shouldn't pick up c:\python25. -- nosy: +loewis ___ Python tracker ___ __

[issue4566] 2.6.1 breaks many applications that embed Python on Windows

2009-01-24 Thread Martin v. Löwis
Martin v. Löwis added the comment: Mark, the patch is fine, please apply. Great work! -- assignee: -> mhammond resolution: -> accepted ___ Python tracker ___ __

[issue2271] msi installs to the incorrect location (C drive)

2009-01-24 Thread Martin v. Löwis
Martin v. Löwis added the comment: Fixed in r66305. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-

[issue3105] Python 2.5.2 Windows Source Distribution missing Visual Studio 2005 ssl build files

2009-01-24 Thread Martin v. Löwis
Martin v. Löwis added the comment: This patch is out of date; VS 2005 is no longer of interest. -- nosy: +loewis resolution: -> out of date status: open -> closed ___ Python tracker ___

[issue3881] IDLE won't start in custom directory.

2009-01-24 Thread Martin v. Löwis
Martin v. Löwis added the comment: Committed as r68893, r68894, r68898, r68901. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___

[issue5025] test_kqueue failure on OS X

2009-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: Fixed in the trunk in r68897. Will merge to 2.6, 3.0 and 3.1. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ __

[issue5042] Structure sub-subclass does not initialize with base class positional arguments

2009-01-24 Thread Jason R. Coombs
New submission from Jason R. Coombs : When trying to create a sub-subclass of a ctypes.Structure, the behavior is not as expected. An executable example that describes the problem in detail and demonstrates the issue is available at http://paste.turbogears.org/paste/29555 and also attached. The

[issue4393] Portability fixes in longobject.c

2009-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: Fixed in r68890, r68891, r68895 and r68896 -- status: open -> closed ___ Python tracker ___ ___ Pyth

[issue5037] unicode(x) for weakref.proxy objects invokes __str__ instead of __unicode__

2009-01-24 Thread Nick Coghlan
Nick Coghlan added the comment: weakref.proxy needs to be fixed to delegate the unicode slot correctly. >>> from weakref import proxy >>> "__unicode__" in dir(type(proxy(Exception))) False That predicate must return true in order for the delegation to do the right thing (this is actually the c

[issue5036] xml.parsers.expat make a dictionary which keys are broken if buffer_text is False.

2009-01-24 Thread Takeshi Matsuyama
Takeshi Matsuyama added the comment: a mistake of my former message, briefly -> in detail >Please read "The ContentHandler.characters() callback is missing data!" >http://www.saxproject.org/faq.html I was just reading above site. it is now very clear for me. Thanks kawai and I'm sorry to take

[issue5036] xml.parsers.expat make a dictionary which keys are broken if buffer_text is False.

2009-01-24 Thread HiroakiKawai
HiroakiKawai added the comment: Please read "The ContentHandler.characters() callback is missing data!" http://www.saxproject.org/faq.html and close this issue :) ___ Python tracker ___

[issue5041] Memory leak in imp.find_module

2009-01-24 Thread Hirokazu Yamamoto
New submission from Hirokazu Yamamoto : I found memory leak related to "es" on PyArg_ParseTuple. -- components: Extension Modules files: py3k_memory_leak.patch keywords: easy, needs review, patch messages: 80452 nosy: ocean-city severity: normal status: open title: Memory leak in imp.fin

[issue5036] xml.parsers.expat make a dictionary which keys are broken if buffer_text is False.

2009-01-24 Thread HiroakiKawai
HiroakiKawai added the comment: That's the spec of XML SAX interface. ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue4710] [PATCH] zipfile.ZipFile does not extract directories properly

2009-01-24 Thread Martin v. Löwis
Martin v. Löwis added the comment: Committed as r68885, r68886, r68887, and r6 -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue5036] xml.parsers.expat make a dictionary which keys are broken if buffer_text is False.

2009-01-24 Thread Takeshi Matsuyama
Takeshi Matsuyama added the comment: Hi kawai. I got correct output by modifying the code like you say, but I still cannot understand why this happens. Could you tell me more briefly, or point any documents about it? I can't find any notes which say don't pass strings but append it for Character

[issue3677] importing from UNC roots doesn't work

2009-01-24 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: Ah, "es" is used in py3k, thanks. And sorry about my merge which had memory leak. ___ Python tracker ___

[issue4111] Add DTrace probes

2009-01-24 Thread Skip Montanaro
Skip Montanaro added the comment: Laca> Please see here for discussion about the -G flag on OS X: Laca> http://markmail.org/message/4nheqnexjr2o6mcx Laca> If I read it correctly, on OS X, you will need to use -h instead Laca> of -G and it won't emit an object file (dtrace.o) so you

[issue3677] importing from UNC roots doesn't work

2009-01-24 Thread Martin v. Löwis
Martin v. Löwis added the comment: > Sorry if I'm missing something, but is this really needed? Yes, the "es" converter allocates memory. ___ Python tracker ___ _

[issue5025] test_kqueue failure on OS X

2009-01-24 Thread Mark Dickinson
Changes by Mark Dickinson : -- priority: -> normal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue5025] test_kqueue failure on OS X

2009-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: I just saw this same test_kqueue failure pop up on the OS X 3.x buildbot, so it's evidently not just a peculiarity of my machine. Unless there are any objections, I'll go ahead and check this in: I think it's a sufficiently trivial fix that it's not worth was

[issue3677] importing from UNC roots doesn't work

2009-01-24 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: >The path variable should be PyMem_Free'd Sorry if I'm missing something, but is this really needed? Other PyArg_ParseTuple(args, "s... doesn't seem to have corresponding PyMem_Free. static PyObject * imp_new_module(PyObject *self, PyObject *args) {

[issue3677] importing from UNC roots doesn't work

2009-01-24 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Added tests for UNC path imports in r68883 and r68884 ___ Python tracker ___ ___ Python-bugs-list mai

[issue3677] importing from UNC roots doesn't work

2009-01-24 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: added the mem release in r68882. I'll try to add test cases too. ___ Python tracker ___ ___ Python-bu

[issue4672] Distutils SWIG support blocks use of SWIG -outdir option

2009-01-24 Thread Tarek Ziadé
Tarek Ziadé added the comment: Good suggestion, I'll add the quotes in the spawn call Which does a simple log.info(string.join(cmd, ' ')) at the moment -- assignee: -> tarek nosy: +tarek versions: +Python 2.6, Python 2.7, Python 3.0, Python 3.1 -Python 2.5 ___

[issue5040] Bug of CGIXMLRPCRequestHandler

2009-01-24 Thread Wayne Huang
New submission from Wayne Huang : I met a bug of CGIXMLRPCRequestHandler in Python3.0. Because of the bug, I couldn't use RPC in Apache CGI. The version of my Python 3.0 is "Python 3.0 (r30:67507, Dec 3 2008, 20:14:27) [MSC v.1500 32 bit (Intel)] win32". The code of my client is follow. s = x

[issue4908] adding a get_metadata in distutils

2009-01-24 Thread Tarek Ziadé
Tarek Ziadé added the comment: Well since Python 2.4 doesn't have the egg-info feature, that is another story. ___ Python tracker ___ ___ Pytho

[issue5036] xml.parsers.expat make a dictionary which keys are broken if buffer_text is False.

2009-01-24 Thread HiroakiKawai
HiroakiKawai added the comment: The sample code has bug. expat is OK. Method char_data must append the incoming characters because the character sequence is an buffered input. def char_data(self, data): self.data += data You should reset it by self.data = '' at end_element(). -