Re: how to make portable distribution of python 2.6?

2010-08-14 Thread Perica Zivkovic
Hi there, numpy, matplotlib are already parts of Portable Python, PyQt is coming in one of the next versions. Creating it is not so difficult, it is basically repackaging of the python core and the required modules. Tricky part is keeping it portable as big part of libs is storing their

Re: writing \feff at the begining of a file

2010-08-14 Thread Thomas Jollans
On Saturday 14 August 2010, it occurred to Steven D'Aprano to exclaim: On Fri, 13 Aug 2010 18:25:46 -0400, Terry Reedy wrote: A short background to MRAB's answer which I will try to get right. The byte-order-mark was invented for UTF-16 encodings so the reader could determine whether the

Re: writing \feff at the begining of a file

2010-08-14 Thread Martin v. Loewis
Is there a standard way to autodetect the encoding of a text file? Use the chardet module: http://chardet.feedparser.org/ Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: looping through possible combinations of McNuggets packs of 6,9 and 20

2010-08-14 Thread gslindstrom
On Aug 12, 4:33 am, Paul Rubin no.em...@nospam.invalid wrote: Baba raoul...@gmail.com writes: exercise: given that packs of McNuggets can only be bought in 6, 9 or 20 packs, write an exhaustive search to find the largest number of McNuggets that cannot be bought in exact quantity. Is that

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-14 Thread Baba
On Aug 13, 8:25 pm, Ian Kelly ian.g.ke...@gmail.com wrote: It's not.  You're not just trying to find the sixth value that can be bought in exact quantity, but a sequence of six values that can all be bought in exact quantity.  The integers [6, 9, 12, 15, 18, 20] are not sequential. Hi Ian,

print v. print()

2010-08-14 Thread Frederick Williams
I am learning Python from Hammond Robinson's _Python Programming on Win32_, January 2000 edition. This print Sleeping for 10 seconds which appears in some example code, fails to... um... Compile? Interpret? Well, whatever the word is, it fails. Trial and error revealed that

Re: Why is python not written in C++ ?

2010-08-14 Thread Aahz
In article i3ahdl$ce...@reader1.panix.com, Grant Edwards inva...@invalid.invalid wrote: I also looked at Modula-3 once, and thought it had some real promise, but I think it's probably deader than Ada now. That's because you should be using Oberon instead. -- Aahz (a...@pythoncraft.com)

Re: print v. print()

2010-08-14 Thread Thomas Jollans
On Saturday 14 August 2010, it occurred to Frederick Williams to exclaim: I am learning Python from Hammond Robinson's _Python Programming on Win32_, January 2000 edition. This print Sleeping for 10 seconds which appears in some example code, fails to... um... Compile? Interpret?

Re: print v. print()

2010-08-14 Thread Mel
Thomas Jollans wrote: On Saturday 14 August 2010, it occurred to Frederick Williams to exclaim: So why the change from print to print()? There's no reason for print to be a statement -- it can just as well be a function, which makes the language more regular, and therefore quite possibly

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-14 Thread Mel
Baba wrote: def can_buy(n_nuggets): for a in range (0,n_nuggets): for b in range (0,n_nuggets): for c in range (0,n_nuggets): #print trying for %d: %d %d %d % (n_nuggets,a,b,c) if 6*a+9*b+20*c==n_nuggets: return [a,b,c]

Re: python ide for ubuntu

2010-08-14 Thread Juan Andres Knebel
Hi Bhanu, if you want to use QT try eric4 for python2 or eric5 for python3. Is very nice IDE, but if you want to develop only pure python use kate or similar or eclipse if you need a nice way to see the debug processes On Thu, Aug 12, 2010 at 7:44 AM, Roald de Vries downa...@gmail.com wrote:

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-14 Thread member thudfoo
On 8/14/10, Baba raoul...@gmail.com wrote: On Aug 13, 8:25 pm, Ian Kelly ian.g.ke...@gmail.com wrote: It's not. You're not just trying to find the sixth value that can be bought in exact quantity, but a sequence of six values that can all be bought in exact quantity. The integers [6, 9, 12,

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-14 Thread Ian Kelly
On Sat, Aug 14, 2010 at 8:52 AM, Baba raoul...@gmail.com wrote: my code is probably not elegant but a huge step forward from where i started: def can_buy(n_nuggets):   for a in range (0,n_nuggets):       for b in range (0,n_nuggets):           for c in range (0,n_nuggets):              

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-14 Thread MRAB
Baba wrote: On Aug 13, 8:25 pm, Ian Kelly ian.g.ke...@gmail.com wrote: It's not. You're not just trying to find the sixth value that can be bought in exact quantity, but a sequence of six values that can all be bought in exact quantity. The integers [6, 9, 12, 15, 18, 20] are not sequential.

Re: python ide for ubuntu

2010-08-14 Thread Bhanu Kumar
Thanks!! On Sat, Aug 14, 2010 at 9:49 PM, Juan Andres Knebel juankne...@gmail.comwrote: Hi Bhanu, if you want to use QT try eric4 for python2 or eric5 for python3. Is very nice IDE, but if you want to develop only pure python use kate or similar or eclipse if you need a nice way to see the

Re: minidom help -- line number

2010-08-14 Thread Thomas Jollans
On Saturday 14 August 2010, it occurred to GZ to exclaim: Hi All, I am writing a little program that reads the minidom tree built from an xml file. I would like to print out the line number of the xml file on the parts of the tree that are not valid. But I do not seem to find a way to

Re: EXOR or symmetric difference for the Counter class

2010-08-14 Thread Raymond Hettinger
On Aug 12, 1:20 pm, Paddy paddy3...@googlemail.com wrote: I find myself needing to calculate the difference between two Counters or multisets or bags. I want those items that are unique to each bag. Tell us about your use cases. I'm curious how a program would ascribe semantic meaning to the

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-14 Thread John Posner
On 8/14/2010 10:52 AM, Baba wrote: for n_nuggets in range(50): result1 = can_buy(n_nuggets) result2 = can_buy(n_nuggets+1) result3 = can_buy(n_nuggets+2) result4 = can_buy(n_nuggets+3) result5 = can_buy(n_nuggets+4) result6 = can_buy(n_nuggets+5) if

Re: minidom help -- line number

2010-08-14 Thread GZ
On Aug 14, 12:07 pm, Thomas Jollans tho...@jollybox.de wrote: On Saturday 14 August 2010, it occurred to GZ to exclaim: Hi All, I am writing a little program that reads the minidom tree built from an xml file. I would like to print out the line number of the xml file on the parts of the

Re: minidom help -- line number

2010-08-14 Thread Thomas Jollans
On Saturday 14 August 2010, it occurred to GZ to exclaim: On Aug 14, 12:07 pm, Thomas Jollans tho...@jollybox.de wrote: On Saturday 14 August 2010, it occurred to GZ to exclaim: Hi All, I am writing a little program that reads the minidom tree built from an xml file. I would like

Re: minidom help -- line number

2010-08-14 Thread Ian Kelly
On Sat, Aug 14, 2010 at 11:56 AM, Thomas Jollans tho...@jollybox.de wrote: The DOM is disjunct from the original file, stream, string, etc. That's in the nature of the DOM, and it's probably true for most, if not all, DOM implementations, in other programming languages as well as Python. If

problem in using linalg solver in numpy

2010-08-14 Thread Pramod
Hi Friends When run the below program in python i got error like this , Matrix [[ 8 -6 2] [-4 11 -7] [ 4 -7 6]] row vecotr X [[ 28 -40 33]] Traceback (most recent call last): File solve.py, line 16, in module print A*B File

Chrome ore Sell Pakistani 30% - 52%,

2010-08-14 Thread iqbal iqbal
Chrome ore Sell Pakistani 30% - 52%, http://buy-sell-pakistani-minerals.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Tk window and contents will not display

2010-08-14 Thread Chris Hare
The scenario is this: I want to loop around all of the images in a given directory (which I know will be images, but I guess I should check), show an image in a window, wait 2 seconds and show the next one and repeat that indefinitley, which will be until the user closes the window. This is

Re: problem in using linalg solver in numpy

2010-08-14 Thread Peter Otten
Pramod wrote: When run the below program in python i got error like this , Matrix [[ 8 -6 2] [-4 11 -7] [ 4 -7 6]] row vecotr X [[ 28 -40 33]] Traceback (most recent call last): File solve.py, line 16, in module print A*B File

Re: problem in using linalg solver in numpy

2010-08-14 Thread MRAB
Pramod wrote: Hi Friends When run the below program in python i got error like this , Matrix [[ 8 -6 2] [-4 11 -7] [ 4 -7 6]] row vecotr X [[ 28 -40 33]] Traceback (most recent call last): File solve.py, line 16, in module print A*B File

Re: Simple Python Sandbox

2010-08-14 Thread Stephen Hansen
On 8/13/10 8:04 PM, Steven D'Aprano wrote: On Fri, 13 Aug 2010 16:37:40 -0700, Stephen Hansen wrote: Howdy-ho. So, I'm working on a project which embeds Python into a bigger system to provide extensibility. In this project, there's basically two types of people who will be entering python

Re: Tk window and contents will not display

2010-08-14 Thread Peter Otten
Chris Hare wrote: The scenario is this: I want to loop around all of the images in a given directory (which I know will be images, but I guess I should check), show an image in a window, wait 2 seconds and show the next one and repeat that indefinitley, which will be until the user closes

Re: Simple Python Sandbox

2010-08-14 Thread Cameron Simpson
On 14Aug2010 12:56, Stephen Hansen me+list/pyt...@ixokai.io wrote: | On 8/13/10 8:04 PM, Steven D'Aprano wrote: | On Fri, 13 Aug 2010 16:37:40 -0700, Stephen Hansen wrote: | So, I'm working on a project which embeds Python into a bigger system to | provide extensibility. In this project,

Re: Why is python not written in C++ ?

2010-08-14 Thread Aahz
In article 7xeieevrze@ruckus.brouhaha.com, Paul Rubin no.em...@nospam.invalid wrote: I'm not sure what the hiring issue is. I think anyone skilled in C++ or Java can pick up Ada pretty easily. It's mostly a subset of C++ with different surface syntax. Heck, I learned Ada as a

Re: Simple Python Sandbox

2010-08-14 Thread geremy condra
On Sat, Aug 14, 2010 at 12:56 PM, Stephen Hansen me+list/pyt...@ixokai.io wrote: On 8/13/10 8:04 PM, Steven D'Aprano wrote: On Fri, 13 Aug 2010 16:37:40 -0700, Stephen Hansen wrote: Howdy-ho. So, I'm working on a project which embeds Python into a bigger system to provide extensibility. In

Re: Tk window and contents will not display

2010-08-14 Thread Chris Hare
On Aug 14, 2010, at 3:14 PM, Peter Otten wrote: Chris Hare wrote: The scenario is this: I want to loop around all of the images in a given directory (which I know will be images, but I guess I should check), show an image in a window, wait 2 seconds and show the next one and repeat that

Re: Tk window and contents will not display

2010-08-14 Thread Peter Otten
Chris Hare wrote: Thanks Peter. I threw away what I started with and merged your code into my class: class externalLoopDisplay: def show(self): main.logging.debug(externalLoopDisplay.show:,start) self.window = Tk() self.btnClose =

Pop return from stack?

2010-08-14 Thread bvdp
Assuming I have a module 'foo.py' with something like this: def error(s): print Error, s sys.exit(1) def func(s): ... do some processing ... call error() if bad .. go to system exit. ... more processing and then I write a new program, test.py, which: import foo def

Re: Tk window and contents will not display

2010-08-14 Thread Chris Hare
On Aug 14, 2010, at 5:49 PM, Peter Otten wrote: Chris Hare wrote: Thanks Peter. I threw away what I started with and merged your code into my class: class externalLoopDisplay: def show(self): main.logging.debug(externalLoopDisplay.show:,start) self.window = Tk()

Re: Pop return from stack?

2010-08-14 Thread Thomas Jollans
On Sunday 15 August 2010, it occurred to bvdp to exclaim: Assuming I have a module 'foo.py' with something like this: def error(s): print Error, s sys.exit(1) def func(s): ... do some processing ... call error() if bad .. go to system exit. ... more processing

Re: Simple Python Sandbox

2010-08-14 Thread Roland Koebler
Hi, I know all this -- but its not relevant really, I think. I'm not trying to create a safe yet relatively complete or functional Python. All those efforts to sandbox Python fail because of the incredible dynamic nature of the language has lots of enticing little holes in it. But I'm not

Working with PDFs?

2010-08-14 Thread jyoung79
Just curious if anyone knows if it's possible to work with pdf documents with Python? I'd like to do the following: - Pull out text from each PDF page (to search for specific words) - Combine separate pdf documents into one document - Add bookmarks (with destination settings) A few programs

Re: Tk window and contents will not display

2010-08-14 Thread Peter Otten
Chris Hare wrote: On Aug 14, 2010, at 5:49 PM, Peter Otten wrote: Chris Hare wrote: Thanks Peter. I threw away what I started with and merged your code into my class: class externalLoopDisplay: def show(self): main.logging.debug(externalLoopDisplay.show:,start)

Re: Simple Python Sandbox

2010-08-14 Thread Steven D'Aprano
On Sun, 15 Aug 2010 01:24:00 +0200, Roland Koebler wrote: I had the same problem, and so I created a pseudo-sandbox for embedding Python in templates. This pseudo-sandbox creates a restricted Python environment, where only whitelisted functions/classes are allowed. Additionally, it prevents

Re: Simple Python Sandbox

2010-08-14 Thread Steven D'Aprano
On Sat, 14 Aug 2010 12:56:45 -0700, Stephen Hansen wrote: I suggest that if the untrusted code is only supposed to be simple and limited, you would be best off to write your own mini-language using Python syntax. I considered it and rejected it. The return from the effort required doesn't

Re: print v. print()

2010-08-14 Thread Steven D'Aprano
On Sat, 14 Aug 2010 11:44:22 -0400, Mel wrote: The downside to a print() function is that assigning to `print` can mask the function, and leave a neophyte without any way to get output out of the program. On the other hand, the upside to a print() function is that assigning to `print` can

Re: shelf-like list?

2010-08-14 Thread kj
In af7fdb85-8c87-434e-94f3-18d8729bf...@l25g2000prn.googlegroups.com Raymond Hettinger pyt...@rcn.com writes: On Aug 12, 1:37=A0pm, Thomas Jollans tho...@jollybox.de wrote: On Tuesday 10 August 2010, it occurred to kj to exclaim: I'm looking for a module that implements persistent lists:

Re: Pop return from stack?

2010-08-14 Thread Steven D'Aprano
On Sat, 14 Aug 2010 16:05:05 -0700, bvdp wrote: Assuming I have a module 'foo.py' with something like this: def error(s): print Error, s sys.exit(1) def func(s): ... do some processing ... call error() if bad .. go to system exit. ... more processing and then I

How to add silent stretches to MP3 using Python?

2010-08-14 Thread kj
Here's the problem: I have about 25,000 mp3 files, each lasting, *on average*, only a few seconds, though the variance is wide (the longest one lasts around 20 seconds). (These files correspond to sample sentences for foreign language training.) The problem is that there is basically no

Re: Simple Python Sandbox

2010-08-14 Thread Christian Heimes
For example, when you go to save your bit of code, it will go in and if it finds __ anywhere in the text it just replaces it with xx. And, since getattr is not available, '_' + '_' won't get you anywhere. That's not as secure as you might think. First of all you can write _ in more way than

Re: Tk window and contents will not display

2010-08-14 Thread Chris Hare
On Aug 14, 2010, at 6:46 PM, Peter Otten wrote: Chris Hare wrote: On Aug 14, 2010, at 5:49 PM, Peter Otten wrote: Chris Hare wrote: Thanks Peter. I threw away what I started with and merged your code into my class: class externalLoopDisplay: def show(self):

Re: Simple Python Sandbox

2010-08-14 Thread Roland Koebler
On Sun, Aug 15, 2010 at 12:06:35AM +, Steven D'Aprano wrote: Hmmm... is that meant just as an illustration of a general technique, or do you actually have something against the class of 0? It's a short illustration; 0 .__class__ itself is harmless, but e.g. 0

Re: How to add silent stretches to MP3 using Python?

2010-08-14 Thread Tim Chase
Here's the problem: I have about 25,000 mp3 files, each lasting, *on average*, only a few seconds, though the variance is wide (the longest one lasts around 20 seconds). (These files correspond to sample sentences for foreign language training.) The problem is that there is basically no padding

Re: Pop return from stack?

2010-08-14 Thread Carl Banks
On Aug 14, 4:05 pm, bvdp b...@mellowood.ca wrote: Assuming I have a module 'foo.py' with something like this: def error(s):     print Error, s     sys.exit(1) def func(s):     ... do some processing     ... call error() if bad .. go to system exit.     ...  more processing and then I

Re: Simple Python Sandbox

2010-08-14 Thread Stephen Hansen
On 8/14/10 5:06 PM, Steven D'Aprano wrote: On Sun, 15 Aug 2010 01:24:00 +0200, Roland Koebler wrote: I had the same problem, and so I created a pseudo-sandbox for embedding Python in templates. This pseudo-sandbox creates a restricted Python environment, where only whitelisted

Re: Simple Python Sandbox

2010-08-14 Thread Stephen Hansen
On 8/14/10 2:25 PM, Cameron Simpson wrote: Ok, what about this: run the untrusted code in a separate process, if necessary running as a user with different privileges. Way too much overhead by a really significant margin: I need to do many, many, many, many, many very short (often very *very*

Re: Simple Python Sandbox

2010-08-14 Thread Stephen Hansen
On 8/14/10 4:24 PM, Roland Koebler wrote: You can find some documentation at http://simple-is-better.org/template/pyratemp.html#evaluation, and the pseudo-sandbox itself in my template-engine, class EvalPseudoSandbox on the website above. (Please write me if you have any comments.) How are

Re: Working with PDFs?

2010-08-14 Thread Terry Reedy
On 8/14/2010 7:44 PM, jyoun...@kc.rr.com wrote: Just curious if anyone knows if it's possible to work with pdf documents with Python? I'd like to do the following: search python pdf library reportlab -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Python Sandbox

2010-08-14 Thread Stephen Hansen
On 8/14/10 5:36 PM, Christian Heimes wrote: For example, when you go to save your bit of code, it will go in and if it finds __ anywhere in the text it just replaces it with xx. And, since getattr is not available, '_' + '_' won't get you anywhere. That's not as secure as you might think.

Re: Simple Python Sandbox

2010-08-14 Thread Stephen Hansen
On 8/14/10 5:09 PM, Steven D'Aprano wrote: My worst case fall-back plan is to embed /another/ language (be it Lua or JavaScript through V8) and offer it a very limited environment. But I don't want to do that (and considering I solved the while True: pass problem last night, I'm pretty sure I

Re: Pop return from stack?

2010-08-14 Thread Chris Rebert
On Sat, Aug 14, 2010 at 5:23 PM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: snip Oh my ... I've seen people writing Java in Python, C++ in Python, Perl in Python, even VB in Python, but this is the first time I've meet some one who wants to write assembler in Python :) +1 QOTW

Re: Simple Python Sandbox

2010-08-14 Thread geremy condra
On Sat, Aug 14, 2010 at 8:07 PM, Stephen Hansen me+list/pyt...@ixokai.io wrote: On 8/14/10 5:09 PM, Steven D'Aprano wrote: My worst case fall-back plan is to embed /another/ language (be it Lua or JavaScript through V8) and offer it a very limited environment. But I don't want to do that (and

Re: Simple Python Sandbox

2010-08-14 Thread Stephen Hansen
On 8/14/10 8:11 PM, geremy condra wrote: cpulimit or a cgroups container can both be easy solutions here, depending on your exact needs. Hmm! I wasn't aware of those, I'll check that out. Thanks. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT)

Re: Simple Python Sandbox

2010-08-14 Thread geremy condra
On Sat, Aug 14, 2010 at 8:18 PM, Stephen Hansen me+list/pyt...@ixokai.io wrote: On 8/14/10 8:11 PM, geremy condra wrote: cpulimit or a cgroups container can both be easy solutions here, depending on your exact needs. Hmm! I wasn't aware of those, I'll check that out. Thanks. Np. I wrote a

Re: Why is python not written in C++ ?

2010-08-14 Thread Lawrence D'Oliveiro
In message 44d30ac7-931e-4eb0-9aed-f664c872d...@l20g2000yqm.googlegroups.com, sturlamolden wrote: A C++ compiler can use Python's header files and link with Python's C API correctly. But it cannot compile Python's C source code. A C compiler is required to compile and build Python. Since

Re: Pop return from stack?

2010-08-14 Thread bvdp
An exception will walk up the stack, calling any cleaning-up code that needs to be done (removing object references, executing finally: blocks, exiting context managers properly. It won't break anything. Don't be afraid of Python's high-level features! Okay, I believe you (and the rest of

Re: Pop return from stack?

2010-08-14 Thread bvdp
On Aug 14, 5:23 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: This general technique is called monkey patching. New term for me :) Now, if an error is encountered myerror() is called. Fine. But execution resumes in func(). Not exactly what I wanted. Of course it does.

Re: Why is python not written in C++ ?

2010-08-14 Thread Grant Edwards
On 2010-08-14, Aahz a...@pythoncraft.com wrote: Paul Rubin no.em...@nospam.invalid wrote: I'm not sure what the hiring issue is. I think anyone skilled in C++ or Java can pick up Ada pretty easily. It's mostly a subset of C++ with different surface syntax. Heck, I learned Ada as a

Re: shelf-like list?

2010-08-14 Thread Zac Burns
This should help: http://docs.python.org/library/pickle.html -- Zachary Burns (407)590-4814 Aim - Zac256FL Production Engineer Zindagi Games On Sat, Aug 14, 2010 at 5:13 PM, kj no.em...@please.post wrote: In af7fdb85-8c87-434e-94f3-18d8729bf...@l25g2000prn.googlegroups.com Raymond Hettinger

Re: shelf-like list?

2010-08-14 Thread Chris Rebert
On Sat, Aug 14, 2010 at 5:13 PM, kj no.em...@please.post wrote: In af7fdb85-8c87-434e-94f3-18d8729bf...@l25g2000prn.googlegroups.com Raymond Hettinger pyt...@rcn.com writes: On Aug 12, 1:37=A0pm, Thomas Jollans tho...@jollybox.de wrote: On Tuesday 10 August 2010, it occurred to kj to exclaim:

[issue5867] No way to create an abstract classmethod

2010-08-14 Thread Daniel Urban
Daniel Urban urban.dani...@gmail.com added the comment: I'm attaching a new patch adding the abc.abstractclassmethod and abc.abstractstaticmethod decorators. -- Added file: http://bugs.python.org/file18519/abstractclassstaticmethod.diff ___ Python

[issue9548] locale can be imported at startup but relies on too many library modules

2010-08-14 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: As we move more and more infrastructure into Python code, we're going to see this pattern (i.e. a bootstrap module underlying the real module) more and more often (e.g. I seem to recall Brett has to do something similar when playing with the

[issue9601] ftplib should accept 250 on MKD

2010-08-14 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: Since this is a feature request, it could only be added to 3.2, not the other versions. -- nosy: +eric.smith type: behavior - feature request versions: -Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.3

[issue9548] locale can be imported at startup but relies on too many library modules

2010-08-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Antoine fixed #9589 by rewriting site.py code in C and calling it more much earlier: r83988. This commit fixes the initial problem of this issue: $ ./python -c 'import heapq; print(heapq.heapify)' built-in function heapify $ cat |

[issue586680] -S hides standard dynamic modules

2010-08-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: r83988 does really fix this issue in python 3.2, 8 years later, yeah! -- nosy: +haypo, pitrou resolution: duplicate - fixed ___ Python tracker rep...@bugs.python.org

[issue9589] test_heapq: AttributeError: 'int' object has no attribute 'pop'

2010-08-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: r83988 is also the correct fix for #586680: I updated this issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9589 ___

[issue586680] -S hides standard dynamic modules

2010-08-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Ooops, I didn't notice that Antoine did already updated this issue. Restore the resolution as duplicate since the superseder field is set. -- resolution: fixed - duplicate ___ Python

[issue9596] PC/getpathp.c unused?

2010-08-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Oh, my bad. Is there any reason for the MS_WINDOWS guards in Modules/getpath.c, then? -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org

[issue9601] ftplib should accept 250 on MKD

2010-08-14 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9601 ___ ___ Python-bugs-list

[issue9596] PC/getpathp.c unused?

2010-08-14 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: No, the guards are probably redundant. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9596 ___

[issue9520] Add Patricia Trie high performance container

2010-08-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: For example, on the x64 machine the following dict() mapping 10,000,000 very short unicode keys (~7 chars) to integers eats 149 bytes per entry. This is counting the keys too. Under 3.x: d = {} for i in range(0, 1000): d[str(i)] = i

[issue9520] Add Patricia Trie high performance container

2010-08-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: So, here is the modified benchmark. It first creates a cache of the random wordlist, because it is quite long to compute (for N up to 1000). The cache is reused in subsequent runs. This takes some memory though (probably won't run it if you

[issue9584] Allow curly braces in fnmatch

2010-08-14 Thread Mathieu Bridon
Mathieu Bridon boche...@fedoraproject.org added the comment: Wow, I certainly didn't expect to generate so much controversy. :-/ First of all, thanks for the comments on the patch Antoine and David. I don't get what the purpose of these two lines is. Forbid empty patterns? I copy-pasted the

[issue7219] Unhelpful error message when a distutils package install fails due to a permissions error

2010-08-14 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: The None error message *looks* to me like the result of a failed assertion. That may not be correct of course... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7219

[issue4947] sys.stdout fails to use default encoding as advertised

2010-08-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Attached patch fixes this old and annoying issue. The issue only concerns sys.std* files, because Python only set the encoding and errors attributes for these files. -- keywords: +patch versions: +Python 2.7 Added file:

[issue4947] sys.stdout fails to use default encoding as advertised

2010-08-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Oh, I forgot to write that my patch uses also the errors attribute. Update the patch to add tests on errors: file_write-2.7-v2.patch. -- Added file: http://bugs.python.org/file18522/file_write-2.7-v2.patch

[issue4947] sys.stdout fails to use default encoding as advertised

2010-08-14 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file18521/file_write-2.7.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4947 ___

[issue4947] sys.stdout fails to use default encoding as advertised

2010-08-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Your patch threatens to break compatibility. I think it would be better to simply change the encoding and errors attributes of standard streams. -- ___ Python tracker rep...@bugs.python.org

[issue9601] ftplib should accept 250 on MKD

2010-08-14 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: The server responses 250 instead of 257 (which would be correct according to RFC959, ftp) In response to what command? MKD? And what do you mean by tolerate? -- ___ Python tracker

[issue8857] socket.getaddrinfo needs tests

2010-08-14 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: I'm not sure whether it's a problem with my python installation but this is what I get on FreeBSD 7.0 with both python 2.7 and 3.2: import socket socket.getaddrinfo('localhost', 80) Traceback (most recent call last): File stdin, line

[issue9602] PyObject_AsCharBuffer() should only accept read-only objects

2010-08-14 Thread STINNER Victor
New submission from STINNER Victor victor.stin...@haypocalc.com: mmap, buffer, bytearray, string and unicode objects set the char buffer callback (bf_getcharbuffer). The bytearray object sets also the release buffer callback (bf_releasebuffer). In Python 2.7, PyObject_AsCharBuffer() accepts

[issue9584] Allow curly braces in fnmatch

2010-08-14 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: python-idea is read by more people. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9584 ___ ___

[issue9602] PyObject_AsCharBuffer() should only accept read-only objects

2010-08-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I don't think we should change anything in 2.7 at this point. It risks breaking compatibility while we are at the end of the 2.x line, for little added benefit (the old buffer API has always been insecure with mutable buffers). As for 3.2,

[issue8428] buildbot: test_multiprocessing timeout (test_notify_all? test_pool_worker_lifetime?)

2010-08-14 Thread Florent Xicluna
Florent Xicluna florent.xicl...@gmail.com added the comment: Still failing on 3.2 and 2.7 - x86 FreeBSD 7.2 3.x r83981, r83971 ... http://www.python.org/dev/buildbot/all/builders/x86%20FreeBSD%207.2%203.x/builds/823 - x86 FreeBSD 7.2 2.7 r83985, r83806 ...

[issue4947] sys.stdout fails to use default encoding as advertised

2010-08-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Your patch threatens to break compatibility Yes it does. But I think that nobody relies on this bug. If your terminal uses something that utf-8, you will see strange characters if you write something else than ascii characters. I

[issue4947] sys.stdout fails to use default encoding as advertised

2010-08-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: 3rd version of the patch: accept character buffer objects without reencoding them. Add also tests on character buffer objects. -- Added file: http://bugs.python.org/file18524/file_write-2.7-v3.patch

[issue4947] sys.stdout fails to use default encoding as advertised

2010-08-14 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file18522/file_write-2.7-v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4947 ___

[issue9600] multiprocessing Pool instantiation crashes on 64 bit 2.6.6rc1 under Windows 7

2010-08-14 Thread Brian Curtin
Brian Curtin cur...@acm.org added the comment: Ok, it turns out this is in fact a regression from 2.6.5. My prior investigation for that 3.x issue must not have been on the 2.6 version I thought it was. Barry: the fix from #9513 (e.g., r83722) will correct this. -- priority: normal -

[issue9425] Rewrite import machinery to work with unicode paths

2010-08-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: r84012 creates _Py_stat(). It is a little bit different than the attached patch (_Py_stat.patch): it doesn't clear Python exception on unicode conversion error. -- ___ Python tracker

[issue9425] Rewrite import machinery to work with unicode paths

2010-08-14 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file18448/_Py_stat.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9425 ___

[issue9425] Rewrite import machinery to work with unicode paths

2010-08-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: r84012 patchs zipimporter_init() to use the new PyUnicode_FSDecoder() and use Py_UNICODE* (unicode) strings instead of char* (byte) strings. -- ___ Python tracker rep...@bugs.python.org

[issue5930] Transient error in multiprocessing (test_number_of_objects)

2010-08-14 Thread Florent Xicluna
Florent Xicluna florent.xicl...@gmail.com added the comment: It happens on some 3.1 buildbots: - x86 FreeBSD 7.2 3.1 r83984, r83968, ... http://www.python.org/dev/buildbot/all/builders/x86%20FreeBSD%207.2%203.1/builds/595 - ARMv4 Debian 3.1 r83831, r83805, r83772, ...

[issue8857] socket.getaddrinfo needs tests

2010-08-14 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: This seems to be related with issue 1282647. Modified patch which skips the test in case of buggy libc version is in attachment. -- Added file: http://bugs.python.org/file18525/getaddrinfo3.patch

[issue1282647] socket.getaddrinfo() bug for IPv6 enabled platforms

2010-08-14 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: I agree with Bert that this is not a Python issue hence I'm closing this out as invalid. Btw, the libc version in which this has been fixed should be 2.1.2: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=52195 -- nosy:

  1   2   >