Announce: LDTP 3.0 - Linux GUI test automation tool

2012-08-04 Thread Nagappan Alagappan
Hello, Highlights: * Java / C# / VB.NET http://vb.net/ / PowerShell / Ruby are now officially supported LDTP scripting languages other than Python New Features: * Firefox have check / uncheck as actions for check box New APIs: * selectpanel * selectpanelname * selectpanelindex Bug fix: *

PythonOnWheels (PoW)

2012-08-04 Thread python onwheels
Hi, I am announcing PythonOnWheels. (short PoW) Projectname: PythonOnWheels Motto: We are only on wheels but it feels like having wings ;) A quick and easy to use generative Web framework for python. STOP: I know what you are thinking: What the world doen't need are more lawyers and python

On-topic: alternate Python implementations

2012-08-04 Thread Steven D'Aprano
Most people are aware, if only vaguely, of the big Four Python implementations: CPython, or just Python, the reference implementation written in C. IronPython, written in .NET. Jython, written in Java. PyPy, the optimizing implementation written in Python (actually, it's written in a subset of

Re: On-topic: alternate Python implementations

2012-08-04 Thread Chris Angelico
On Sat, Aug 4, 2012 at 4:15 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: CLPython, an implementation of Python written in Common Lisp. Berp - a compiler which works by translating Python to Haskell and compiling that. Okay. WHY? CLPython gives some reason, but how often do

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Steven D'Aprano, 04.08.2012 08:15: Most people are aware, if only vaguely, of the big Four Python implementations: CPython, or just Python, the reference implementation written in C. IronPython, written in .NET. Jython, written in Java. PyPy, the optimizing implementation written in

Re: Eclipse and the Python plugin

2012-08-04 Thread lipska the kat
On 04/08/12 00:29, Cousin Stanley wrote: lipska the kat wrote: I can now create, debug and test a simple IRC server written in Java and an IRC Bot that I am attempting to build in Python For a bit of inspiration python-irc-bot-wise you might look at supybot Yep, it's

Re: On-topic: alternate Python implementations

2012-08-04 Thread Steven D'Aprano
On Sat, 04 Aug 2012 08:40:16 +0200, Stefan Behnel wrote: And not to forget Cython, which is the only static Python compiler that is widely used. Compiles and optimises Python to C code that uses the CPython runtime and allows for easy manual optimisations to get C-like performance out of it.

Re: python pynotify with textbox input

2012-08-04 Thread Mark Lawrence
On 03/08/2012 23:50, dark.k...@gmail.com wrote: how can i made a notification for gnome-shell with a textbox input ?? library: pynotify? Write some code and when you get problems with it post the code here and we'll gladly answer your questions. -- Cheers. Mark Lawrence. --

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Steven D'Aprano, 04.08.2012 09:49: On Sat, 04 Aug 2012 08:40:16 +0200, Stefan Behnel wrote: And not to forget Cython, which is the only static Python compiler that is widely used. Compiles and optimises Python to C code that uses the CPython runtime and allows for easy manual optimisations to

Re: On-topic: alternate Python implementations

2012-08-04 Thread Mark Lawrence
On 04/08/2012 08:49, Steven D'Aprano wrote: On Sat, 04 Aug 2012 08:40:16 +0200, Stefan Behnel wrote: And not to forget Cython, which is the only static Python compiler that is widely used. Compiles and optimises Python to C code that uses the CPython runtime and allows for easy manual

Re: On-topic: alternate Python implementations

2012-08-04 Thread Steven D'Aprano
On Sat, 04 Aug 2012 16:34:17 +1000, Chris Angelico wrote: On Sat, Aug 4, 2012 at 4:15 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: CLPython, an implementation of Python written in Common Lisp. Berp - a compiler which works by translating Python to Haskell and compiling

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Mark Lawrence, 04.08.2012 12:05: I agree so it's off topic and can't be discussed here. Isn't that right, Stefan? Hmm, in case you are referring to a recent friendly and diplomatic request of mine regarding a couple of people who were burdening a public high volume mailing list with a purely

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Krah
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Who would want to deal with C's idiosyncrasies, low-powered explicit type system, difficult syntax, and core-dumps, when you could use something better? In the free software world, apparently many people like C. C is also quite

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Steven D'Aprano, 04.08.2012 12:54: Berp is based on the Glasgow Haskell Compiler, which is a modern, efficient, optimizing compiler capable of producing excellent quality machine code on Windows, Mac, Linux and many Unixes. It gives you all the advantages of a high-level language with

Re: On-topic: alternate Python implementations

2012-08-04 Thread Thomas Rachel
Am 04.08.2012 11:10 schrieb Stefan Behnel: As long as you don't use any features of the Cython language, it's plain Python. That makes it a Python compiler in my eyes. Tell that the C++ guys. C++ is mainly a superset of C. But nevertheless, C and C++ are distinct languages and so are Python

Re: On-topic: alternate Python implementations

2012-08-04 Thread Ramchandra Apte
The first time I did reply not 'reply all', so I'm posting again. ;-) I think Cython is a Python implementation because you can only use the Python features, not the extra features. C++ is different because of the different rules (C was in a time of assembly and costly computers, C++ was made in

Re: avlhqw avlhqeavlhqino ovfqalmw avlhqei avlhqeaivscunqw

2012-08-04 Thread Ramchandra Apte
Is this spam? If not, can you please explain the message better (I don't get it) and *Please* change the title, it look like spam. On 3 August 2012 21:58, Martin Michael Musatov musatovatattdot...@gmail.com wrote: Thanks to technology, a memorandum of understanding (thanks from Tel Aviva / s,

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Thomas Rachel, 04.08.2012 14:51: Am 04.08.2012 11:10 schrieb Stefan Behnel: As long as you don't use any features of the Cython language, it's plain Python. That makes it a Python compiler in my eyes. Tell that the C++ guys. C++ is mainly a superset of C. But nevertheless, C and C++ are

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Stefan Behnel, 04.08.2012 15:53: Thomas Rachel, 04.08.2012 14:51: Am 04.08.2012 11:10 schrieb Stefan Behnel: As long as you don't use any features of the Cython language, it's plain Python. That makes it a Python compiler in my eyes. Tell that the C++ guys. C++ is mainly a superset of C. But

Re: trouble with pyplot in os x

2012-08-04 Thread William R. Wing (Bill Wing)
On Aug 3, 2012, at 11:12 PM, Eric einazaki...@yahoo.com wrote: I'm just starting to futz around with matplotlib and I tried to run this example from the matplotlib doc page (it's the imshow() example): import numpy as np import matplotlib.cm as cm import matplotlib.mlab as mlab import

keyerror '__repr__'

2012-08-04 Thread vijay shanker
hi i have this class book class book: def __init__(self,name,price): self.name = name self.price = price def __getattr__(self,attr): if attr == '__str__': print 'intercepting in-built method call ' return '%s:%s' %

Re: keyerror '__repr__'

2012-08-04 Thread Chris Rebert
On Sat, Aug 4, 2012 at 7:48 AM, vijay shanker vshanker...@gmail.com wrote: hi i have this class book class book: def __init__(self,name,price): self.name = name self.price = price def __getattr__(self,attr): if attr == '__str__': print

[newbie] Looking for a good introduction to object oriented programming with Python

2012-08-04 Thread Jean Dubois
I'm looking for a good introduction to object oriented programming with Python. I am looking for an introduction which only refers to Python. I have seen introductions where the authors make comparisons to other languages such as C++ and Java, but as I don't know these languages that doesn't help

Re: On-topic: alternate Python implementations

2012-08-04 Thread Paul Rubin
Stefan Krah stefan-use...@bytereef.org writes: In the free software world, apparently many people like C. C is also quite popular in the zero-fault software world: Several verification tools do exist and Leroy et al. are writing a certified compiler for C to plug the hole between the verified

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Paul Rubin, 04.08.2012 17:59: Stefan Krah writes: In the free software world, apparently many people like C. C is also quite popular in the zero-fault software world: Several verification tools do exist and Leroy et al. are writing a certified compiler for C to plug the hole between the

Re: python pynotify with textbox input

2012-08-04 Thread Miki Tebeka
how can i made a notification for gnome-shell with a textbox input ?? library: pynotify? You can do it in many ways. You can use one of the Python GUI frameworks - Qt, wx, GTK ... You can use utilities like zenity ... -- http://mail.python.org/mailman/listinfo/python-list

Re: On-topic: alternate Python implementations

2012-08-04 Thread Paul Rubin
Stefan Behnel stefan...@behnel.de writes: C is pretty poor as a compiler target: how would you translate Python generators into C, for example? Depends. If you have CPython available, that'd be a straight forward extension type. Calling CPython hardly counts as compiling Python into C. For

Re: On-topic: alternate Python implementations

2012-08-04 Thread Mark Lawrence
On 04/08/2012 11:59, Stefan Behnel wrote: Mark Lawrence, 04.08.2012 12:05: I agree so it's off topic and can't be discussed here. Isn't that right, Stefan? Hmm, in case you are referring to a recent friendly and diplomatic request of mine regarding a couple of people who were burdening a

Re: On-topic: alternate Python implementations

2012-08-04 Thread Temia Eszteri
On Sat, 04 Aug 2012 19:24:12 +0100, Mark Lawrence breamore...@yahoo.co.uk wrote: On 04/08/2012 11:59, Stefan Behnel wrote: Mark Lawrence, 04.08.2012 12:05: I agree so it's off topic and can't be discussed here. Isn't that right, Stefan? Hmm, in case you are referring to a recent friendly

Re: On-topic: alternate Python implementations

2012-08-04 Thread Zero Piraeus
: On 4 August 2012 14:24, Mark Lawrence breamore...@yahoo.co.uk wrote: With arrogance like that German by any chance? I didn't give a monkeys about the beer conversation personally, but can we leave the national stereotypes out of it? -[]z. --

Re: On-topic: alternate Python implementations

2012-08-04 Thread Mark Lawrence
From: Zero Piraeus sche...@gmail.com To: Mark Lawrence breamore...@yahoo.co.uk Cc: python-list@python.org Sent: Saturday, 4 August 2012, 19:42 Subject: Re: On-topic: alternate Python implementations : On 4 August 2012 14:24, Mark Lawrence

Re: On-topic: alternate Python implementations

2012-08-04 Thread Zero Piraeus
: On 4 August 2012 14:50, Mark Lawrence breamore...@yahoo.co.uk wrote: No. Next question? *plonk* -[]z. -- http://mail.python.org/mailman/listinfo/python-list

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Paul Rubin, 04.08.2012 20:18: Stefan Behnel writes: C is pretty poor as a compiler target: how would you translate Python generators into C, for example? Depends. If you have CPython available, that'd be a straight forward extension type. Calling CPython hardly counts as compiling Python

Re: On-topic: alternate Python implementations

2012-08-04 Thread MRAB
On 04/08/2012 20:06, Stefan Behnel wrote: Paul Rubin, 04.08.2012 20:18: Stefan Behnel writes: C is pretty poor as a compiler target: how would you translate Python generators into C, for example? Depends. If you have CPython available, that'd be a straight forward extension type. Calling

when an iterable object is exhausted or not

2012-08-04 Thread Franck Ditter
Two similar iterable objects but with a different behavior : $$$ i = range(2,5) $$$ for x in i : print(x,end=' ') 2 3 4 $$$ for x in i : print(x,end=' ')# i is not exhausted 2 3 4 - Compare with : $$$ i = filter(lambda c : c.isdigit(), 'a1b2c3') $$$ for x in i :

Re: when an iterable object is exhausted or not

2012-08-04 Thread Tim Roberts
Franck Ditter fra...@ditter.org wrote: Two similar iterable objects but with a different behavior : $$$ i = range(2,5) $$$ for x in i : print(x,end=' ') 2 3 4 $$$ for x in i : print(x,end=' ')# i is not exhausted 2 3 4 - Compare with : $$$ i = filter(lambda c :

Re: On-topic: alternate Python implementations

2012-08-04 Thread Tim Roberts
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Most people are aware, if only vaguely, of the big Four Python implementations: CPython, or just Python, the reference implementation written in C. IronPython, written in .NET. Technicality: .NET is not a language, it is a run-time

Re: when an iterable object is exhausted or not

2012-08-04 Thread MRAB
On 04/08/2012 20:20, Franck Ditter wrote: Two similar iterable objects but with a different behavior : $$$ i = range(2,5) $$$ for x in i : print(x,end=' ') 2 3 4 $$$ for x in i : print(x,end=' ')# i is not exhausted 2 3 4 - Compare with : $$$ i = filter(lambda c :

Re: when an iterable object is exhausted or not

2012-08-04 Thread Tim Chase
On 08/04/12 14:20, Franck Ditter wrote: Two similar iterable objects but with a different behavior : $$$ i = range(2,5) $$$ for x in i : print(x,end=' ') 2 3 4 $$$ for x in i : print(x,end=' ')# i is not exhausted 2 3 4 - Compare with : $$$ i = filter(lambda

Re: On-topic: alternate Python implementations

2012-08-04 Thread Paul Rubin
Stefan Behnel stefan...@behnel.de writes: Calling CPython hardly counts as compiling Python into C. CPython is written in C, though. So anything that CPython does can be done in C. It's not like the CPython project used a completely unusual way of writing C code. CPython is a relatively

Re: trouble with pyplot in os x

2012-08-04 Thread Eric
On Saturday, August 4, 2012 8:11:44 AM UTC-5, William R. Wing (Bill Wing) wrote: On Aug 3, 2012, at 11:12 PM, Eric wrote: I'm just starting to futz around with matplotlib and I tried to run this example from the matplotlib doc page (it's the imshow() example): import numpy

Re: when an iterable object is exhausted or not

2012-08-04 Thread Terry Reedy
On 8/4/2012 4:24 PM, Tim Chase wrote: On 08/04/12 14:20, Franck Ditter wrote: Two similar iterable objects but with a different behavior : $$$ i = range(2,5) $$$ for x in i : print(x,end=' ') 2 3 4 $$$ for x in i : print(x,end=' ')# i is not exhausted 2 3 4 - Compare with :

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Paul Rubin, 04.08.2012 22:43: Stefan Behnel writes: Calling CPython hardly counts as compiling Python into C. CPython is written in C, though. So anything that CPython does can be done in C. It's not like the CPython project used a completely unusual way of writing C code. CPython is a

Re: On-topic: alternate Python implementations

2012-08-04 Thread jwp
On Friday, August 3, 2012 11:15:20 PM UTC-7, Steven D'Aprano wrote: WPython - another optimizing version of Python with wordcodes instead of bytecodes. http://code.google.com/p/wpython/ I remember reading about this a while ago. I thought this was eventually going to be committed to

Re: On-topic: alternate Python implementations

2012-08-04 Thread Jürgen A . Erhard
On Sat, Aug 04, 2012 at 08:40:16AM +0200, Stefan Behnel wrote: Steven D'Aprano, 04.08.2012 08:15: Most people are aware, if only vaguely, of the big Four Python implementations: And not to forget Cython, which is the only static Python compiler that is widely used. Compiles and

Object Models - decoupling data access - good examples ?

2012-08-04 Thread shearichard
I'm interested in best practice approaches to : decoupling data access code from application code; and translations between database structures and domain objects. For some time I've done database access by in a particular way and while I think it's OK it's not very pythonic so I'd be

Re: [newbie] Looking for a good introduction to object oriented programming with Python

2012-08-04 Thread shearichard
One reason you may be having difficulty is that unlike some languages (C++/Java) object-orientation is not a be all and end all in Python, in fact you could work with Python for a long time without really 'doing it' at all (well other than calling methods/properties on existing API's). Having

Re: when an iterable object is exhausted or not

2012-08-04 Thread Steven D'Aprano
On Sat, 04 Aug 2012 12:44:07 -0700, Tim Roberts wrote: $$$ i = filter(lambda c : c.isdigit(), 'a1b2c3') $$$ for x in i : print(x,end=' ') 1 2 3 $$$ for x in i : print(x,end=' ')# i is exhausted $$$ IMHO, this should not happen in Py3k. It's interesting that it DOESN'T happen in

Re: On-topic: alternate Python implementations

2012-08-04 Thread Steven D'Aprano
On Sat, 04 Aug 2012 08:59:18 -0700, Paul Rubin wrote: C isn't so great for high-assurance stuff either, compared to (say) Ada. People do use it in critical apps, but that's just because it is (or anyway used to be) so ubiquitous. And then they are shocked, SHOCKED I say!, when their app has

Re: Object Models - decoupling data access - good examples ?

2012-08-04 Thread Roy Smith
In article ebb88ade-7598-46b1-8fb6-fd7f7430b...@googlegroups.com, shearich...@gmail.com wrote: I should say I'm talking relational database here and, for various reasons, ORMs are not involved. Just out of curiosity, why do you eschew ORMs? On the other hand, you really haven't. All you've

Re: On-topic: alternate Python implementations

2012-08-04 Thread Paul Rubin
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: Runtime optimizations that target the common case, but fall back to unoptimized code in the rare cases that the optimization doesn't apply, offer the opportunity of big speedups for most code at the cost of trivial slowdowns when

Re: when an iterable object is exhausted or not

2012-08-04 Thread Steven D'Aprano
On Sat, 04 Aug 2012 21:20:36 +0200, Franck Ditter wrote: Two similar iterable objects but with a different behavior : [...] IMHO, this should not happen in Py3k. What is the rationale of this (bad ?) design, which forces the programmer to memorize which one is exhaustable and which one is not

Re: On-topic: alternate Python implementations

2012-08-04 Thread Steven D'Aprano
On Sat, 04 Aug 2012 18:38:33 -0700, Paul Rubin wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: Runtime optimizations that target the common case, but fall back to unoptimized code in the rare cases that the optimization doesn't apply, offer the opportunity of big speedups

Re: dbf.py API question

2012-08-04 Thread Ole Martin Bjørndalen
On Thu, Aug 2, 2012 at 5:55 PM, Ethan Furman et...@stoneleaf.us wrote: SQLite has a neat feature where if you give it a the file-name of ':memory:' the resulting table is in memory and not on disk. I thought it was a cool feature, but expanded it slightly: any name surrounded by colons results

Re: Object Models - decoupling data access - good examples ?

2012-08-04 Thread shearichard
Just out of curiosity, why do you eschew ORMs? Good question ! I'm not anti-ORM (in fact in many circs I'm quite pro-ORM) but for some time I've been working with a client who doesn't want ORMs used (they do have quite good reasons for this although probably not as good as they think).

conditional running of code portion

2012-08-04 Thread JW Huang
Hi, How can I implement something like C++'s conditional compile. if VERBOSE_MODE: print debug information else: do nothing But I don't want this condition to be checked during runtime as it will slow down the code. Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: conditional running of code portion

2012-08-04 Thread Ramchandra Apte
Try pypreprocessor http://code.google.com/p/pypreprocessor/ . Better idea: You should be using the logginghttp://docs.python.org/library/logging.htmlmodule if you want to print debug information quickly.It uses threads and is optimized to run fast. On 5 August 2012 09:46, JW Huang

Re: when an iterable object is exhausted or not

2012-08-04 Thread Ramchandra Apte
An important use of range repeating. one_to_10 = range(1,10) one_to_5 = range(1,5) for x in one_to_5: for x in one_to_10:pass if range wasn't repeatable, range would have to be called 5 times compared with 1! On 5 August 2012 07:43, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote:

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Paul Rubin, 05.08.2012 03:38: Steven D'Aprano writes: Runtime optimizations that target the common case, but fall back to unoptimized code in the rare cases that the optimization doesn't apply, offer the opportunity of big speedups for most code at the cost of trivial slowdowns when you do

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Jürgen A. Erhard, 05.08.2012 01:25: On Sat, Aug 04, 2012 at 08:40:16AM +0200, Stefan Behnel wrote: Steven D'Aprano, 04.08.2012 08:15: Most people are aware, if only vaguely, of the big Four Python implementations: And not to forget Cython, which is the only static Python compiler that is

[issue15546] Iteration breaks with bz2.open(filename,'rt')

2012-08-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I encountered this when implemented bzip2 support in zipfile (issue14371). I solved this also by rewriting read and read1 to make as many reads from the underlying file as necessary to return a non-empty result. -- nosy: +storchaka

[issue15522] impove 27 percent performance on stringpbject.c( by prefetch and loop optimization)

2012-08-04 Thread abael
abael added the comment: added my implement( with some enhancement, got better performance, at less for my apps. ). test result: with small chunk of str, got double performanc, and 111% for big chunks; it ## Util funcion for text definition: def pf(f,n): a=time() for i in xrange(n):

[issue15522] impove 27 percent performance on stringpbject.c( by prefetch and loop optimization)

2012-08-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please port your code to Python 3.3 and compare with it. Python 3.3 implementation of str.join() already more than twice faster then Python 2.7. Maybe your optimization will have no effect. -- nosy: +storchaka

[issue13498] os.makedirs exist_ok documentation is incorrect, as is some of the behavior

2012-08-04 Thread Hynek Schlawack
Hynek Schlawack added the comment: do you want it by default or a new flag? default sounds like a source for obscure bugs to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13498 ___

[issue12655] Expose sched.h functions

2012-08-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch removing cpu_set and using sets of integers instead. -- Added file: http://bugs.python.org/file26682/cpuset.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12655

[issue12655] Expose sched.h functions

2012-08-04 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file26682/cpuset.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12655 ___

[issue12655] Expose sched.h functions

2012-08-04 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Added file: http://bugs.python.org/file26683/cpuset.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12655 ___

[issue14565] is_cgi doesn't function as documented for cgi_directories

2012-08-04 Thread Oscar Campos
Oscar Campos added the comment: Greetings, I did a diff patch based on the previous work of Glenn Linderman and Pierre Quentel. I did some test and is working well so now the implementation is doing what the docstring says. I already passed the full test suite without problems. I add two

[issue14565] is_cgi doesn't function as documented for cgi_directories

2012-08-04 Thread Oscar Campos
Changes by Oscar Campos oscar.cam...@member.fsf.org: Added file: http://bugs.python.org/file26685/http-server.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14565 ___

[issue12655] Expose sched.h functions

2012-08-04 Thread STINNER Victor
STINNER Victor added the comment: sched_getaffinity() does not fail if the set is smaller than the number of CPU. Try with an initial value of ncpus=1. So we cannot start the heuristic with ncpus=16, because it would only return 16 even if the computer has more cpus. Instead of this heuristic,

[issue14565] is_cgi doesn't function as documented for cgi_directories

2012-08-04 Thread Oscar Campos
Changes by Oscar Campos oscar.cam...@member.fsf.org: Added file: http://bugs.python.org/file26686/http-server.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14565 ___

[issue12655] Expose sched.h functions

2012-08-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Try with an initial value of ncpus=1. Well, I've tried and it works: os.sched_getaffinity(0) {0, 1, 2, 3} I don't know if CPU_SETSIZE is part of the standard (POSIX?). These are Linux-specific functions. --

[issue12655] Expose sched.h functions

2012-08-04 Thread STINNER Victor
STINNER Victor added the comment: Try with an initial value of ncpus=1. Well, I've tried and it works: Oh, you're right :-) I only checked ncpus (1), not the final result. It works because CPU_ALLOC_SIZE() rounds the size using sizeof(unsigned long) (64 bits on my CPU). So CPU_ALLOC_SIZE(1)

[issue12655] Expose sched.h functions

2012-08-04 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: +1 for Antoine's patch/approach: it's more usable and pythonic. I think documentation should mention and link the existence of: http://docs.python.org/library/multiprocessing.html#multiprocessing.cpu_count -- ___

[issue15546] Iteration breaks with bz2.open(filename,'rt')

2012-08-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset cdf27a213bd2 by Nadeem Vawda in branch 'default': #15546: Fix BZ2File.read1()'s handling of pathological input data. http://hg.python.org/cpython/rev/cdf27a213bd2 -- nosy: +python-dev ___ Python tracker

[issue15546] Iteration breaks with bz2.open(filename,'rt')

2012-08-04 Thread Nadeem Vawda
Nadeem Vawda added the comment: OK, BZ2File should now be fixed. It looks like LZMAFile and GzipFile may be susceptible to the same problem; I'll push fixes for them shortly. -- ___ Python tracker rep...@bugs.python.org

[issue12655] Expose sched.h functions

2012-08-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You may also use a constant size (CPU_SETSIZE) of the set used by sched_setaffinity() to simplify the code. As Antoine pointed out to me (and I was convinced itself, experimented with an example from man:CPU_SET(3)) the cpu_set functions work with a sets of

[issue1859] textwrap doesn't linebreak on \n

2012-08-04 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1859 ___ ___ Python-bugs-list mailing list

[issue12655] Expose sched.h functions

2012-08-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset d6745ddbccbd by Antoine Pitrou in branch 'default': Issue #12655: Instead of requiring a custom type, os.sched_getaffinity and http://hg.python.org/cpython/rev/d6745ddbccbd -- ___ Python tracker

[issue12655] Expose sched.h functions

2012-08-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, I've improved the default ncpus value and committed. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12655

[issue1859] textwrap doesn't linebreak on \n

2012-08-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I believe that the method of work with newlines is too application specific. Someone may prefer empty line separated paragraphs, here is another recipe: def wrap_paragraphs(text, width=70, **kwargs): return [line for para in re.split(r'\n\s*\n', text)

[issue15555] Default newlines of io.TextIOWrapper

2012-08-04 Thread Atsuo Ishimoto
New submission from Atsuo Ishimoto: In http://docs.python.org/dev/library/io.html: if newline is None, any '\n' characters written are translated to the system default line separator, os.linesep. But os.linesep is not referred at all. On Windows default newline is always '\r\n' on

[issue15556] os.stat fails for file pending delete on Windows

2012-08-04 Thread Jeremy Kloth
New submission from Jeremy Kloth: os.stat fails when called on a file that is pending delete but is still in the directory listing. This in turn causes os.path.exists to return the wrong result. Attached is a test case demonstrating this broken behavior. -- components: Library (Lib),

[issue15556] os.stat fails for file pending delete on Windows

2012-08-04 Thread Jeremy Kloth
Changes by Jeremy Kloth jeremy.kloth+python-trac...@gmail.com: -- nosy: +brian.curtin, loewis, pitrou, tim.golden -jkloth ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15556 ___

[issue15556] os.stat fails for file pending delete on Windows

2012-08-04 Thread Jeremy Kloth
Changes by Jeremy Kloth jeremy.kloth+python-trac...@gmail.com: -- nosy: +jkloth ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15556 ___ ___

[issue15556] os.stat fails for file pending delete on Windows

2012-08-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: How does it fail? Please paste the precise exception. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15556 ___

[issue15556] os.stat fails for file pending delete on Windows

2012-08-04 Thread Jeremy Kloth
Jeremy Kloth added the comment: Traceback (most recent call last): File stat-bug.py, line 12, in module print('stat', os.stat(pathname)) PermissionError: [Error 5] Access is denied: '\\Users\\Jeremy\\test.tmp' -- ___ Python tracker

[issue15556] os.stat fails for file pending delete on Windows

2012-08-04 Thread Martin v . Löwis
Martin v. Löwis added the comment: Why do you think the behavior is broken? It looks right to me - it's not possible to get file information for a file that is scheduled for deletion. ISTM that rather os.path.exists has non-intuitive behavior; it shouldn't infer from the PermissionError that

[issue15528] Better support for finalization with weakrefs

2012-08-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't quite understand the purpose of your suggestions. What can you do with it help, what you can not do with contextlib.ExitStack, atexit, __del__ method, weakref.WeakKeyDictionary or weakref.ref? I read the documentation, but the meaning eludes me.

[issue15556] os.stat fails for file pending delete on Windows

2012-08-04 Thread Jeremy Kloth
Jeremy Kloth added the comment: Why do you think the behavior is broken? It looks right to me - it's not possible to get file information for a file that is scheduled for deletion. However you can when using MSVCRT's stat() function or even FindFirstFile directly. -- nosy:

[issue14565] is_cgi doesn't function as documented for cgi_directories

2012-08-04 Thread Glenn Linderman
Glenn Linderman added the comment: Thanks for the patch, Oscar, I've not had more time to follow up on this issue, and haven't yet learned how to generate the patches. While you dropped the return False line, which surprised me, the implicit return None is sufficiently false, that there no

[issue15556] os.stat fails for file pending delete on Windows

2012-08-04 Thread Chris Jerdonek
Changes by Chris Jerdonek chris.jerdo...@gmail.com: -- nosy: +cjerdonek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15556 ___ ___

[issue15550] Trailing white spaces

2012-08-04 Thread Chris Jerdonek
Chris Jerdonek added the comment: There already is a hook in place for the main python.org repository that checks for and rejects changesets that include files with space issues: If there is already a hook, then why do some files have spurious white space (i.e. at the end of a line)? Is

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-04 Thread Mark Dickinson
Mark Dickinson added the comment: Why not add a is_nan() method to float numbers instead? That could work. The duplication of float.is_nan and math.isnan (not to mention the different spellings) would be a bit ugly, but perhaps worth it. It would make sense to add float.is_infinite and

[issue15557] Tests for webbrowser module

2012-08-04 Thread Anton Barkovsky
New submission from Anton Barkovsky: Attaching a patch with some tests for webbrowser module. The tests fail unless #15509 is fixed. They also print lots of warnings unless #15447 is fixed. -- components: Tests files: test_webbrowser.patch keywords: patch messages: 167423 nosy:

[issue15447] A file is not properly closed by webbrowser._invoke

2012-08-04 Thread Anton Barkovsky
Anton Barkovsky added the comment: Added tests in #15557. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15447 ___ ___ Python-bugs-list mailing

[issue15509] webbrowser.open sometimes passes zero-length argument to the browser.

2012-08-04 Thread Anton Barkovsky
Anton Barkovsky added the comment: Added tests in #15557. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15509 ___ ___ Python-bugs-list mailing

[issue13052] IDLE: replace ending with '\' causes crash

2012-08-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0f38948cc6df by Andrew Svetlov in branch '3.2': Issue #13052: Fix IDLE crashing when replace string in Search/Replace dialog ended with '\'. http://hg.python.org/cpython/rev/0f38948cc6df New changeset 9dcfba4d0357 by Andrew Svetlov in branch

[issue15544] math.isnan fails with some Decimal NaNs

2012-08-04 Thread Stefan Krah
Stefan Krah added the comment: Mark Dickinson rep...@bugs.python.org wrote: Looks like we've got two separate issues here, that should probably be split into two separate bug reports. The first issue is that Decimal.__float__ is brain-dead when it comes to NaNs with payloads; I consider

[issue12655] Expose sched.h functions

2012-08-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset fb975cb8fb45 by Victor Stinner in branch 'default': Issue #12655: Mention multiprocessing.cpu_count() in os.sched_getaffinity() doc http://hg.python.org/cpython/rev/fb975cb8fb45 -- ___ Python tracker

  1   2   >