Sala 1.1 released

2011-02-03 Thread Petri Lehtinen
Sala 1.1 has been released. This release adds ~/.config/sala.conf (or, more specifically, $XDG_CONFIG_HOME/sala.conf) to the list of configuration locations that are read, as per the XDG Base Directory Specification. Python 2.5 is also now supported. Install: pip install sala Docs download:

parse GET/POST data on simple http server

2011-02-03 Thread Markus
Hi, As a beginner in python, I am looking for example code that would help me understand how to code following idea: 1. Start minimal http server 2. Send GET or POST data (url encoded, or from form) - example Name=Foo 3. Analyze the GET/POST variable value on server and match to different value

Re: parse GET/POST data on simple http server

2011-02-03 Thread Corey Richardson
On 02/03/2011 03:15 AM, Markus wrote: Hi, As a beginner in python, I am looking for example code that would help me understand how to code following idea: 1. Start minimal http server 2. Send GET or POST data (url encoded, or from form) - example Name=Foo 3. Analyze the GET/POST variable

Re: parse GET/POST data on simple http server

2011-02-03 Thread Corey Richardson
On 02/03/2011 03:15 AM, Markus wrote: Hi, As a beginner in python, I am looking for example code that would help me understand how to code following idea: 1. Start minimal http server 2. Send GET or POST data (url encoded, or from form) - example Name=Foo 3. Analyze the GET/POST variable

Re: parse GET/POST data on simple http server

2011-02-03 Thread Chris Rebert
On Thu, Feb 3, 2011 at 12:15 AM, Markus markus...@gmail.com wrote: Hi, As a beginner in python, I am looking for example code that would help me understand how to code following idea: 1. Start minimal http server http://docs.python.org/library/basehttpserver.html

Re: parse GET/POST data on simple http server

2011-02-03 Thread Markus
On Feb 3, 9:35 am, Chris Rebert c...@rebertia.com wrote: On Thu, Feb 3, 2011 at 12:15 AM, Markus markus...@gmail.com wrote: Hi, As a beginner in python, I am looking for example code that would help me understand how to code following idea: 1. Start minimal http server

Re: IDLE: A cornicopia of mediocrity and obfuscation.

2011-02-03 Thread Red John
On Feb 2, 9:03 pm, alex23 wuwe...@gmail.com wrote: rantingrick rantingr...@gmail.com wrote: Hmm, that coming from someone who has two posts in this group. And the last he posted was a year ago! Wait, I thought you had the approval of the silent majority? So once anyone actually posts,

Re: DRY and static attribute for multiple classes.

2011-02-03 Thread Peter Otten
Marc Aymerich wrote: On Feb 2, 12:11 am, Peter Otten __pete...@web.de wrote: Marc Aymerich wrote: Hi!, Unfortunately per_class attribute losses the independence when I try to mix it with django models.Model . from django.db import models class Plugin(models.base.ModelBase): class

Re: Reassign or discard Popen().stdout from a server process

2011-02-03 Thread Nobody
On Tue, 01 Feb 2011 08:30:19 +, John O'Hagan wrote: I can't keep reading because that will block - there won't be any more output until I send some input, and I don't want it in any case. To try to fix this I added: proc.stdout = os.path.devnull which has the effect of stopping the

Re: os.path.join doubt

2011-02-03 Thread Nobody
On Thu, 03 Feb 2011 06:31:49 +, Steven D'Aprano wrote: On Wed, 02 Feb 2011 20:46:12 -0800, harryos wrote: In windows ,I tried this p1 = C:\Users\me\Documents p2 = ..\Pictures\images\my.jpg Don't do this; backslash is significant within Python string literals. If want to use literal

Re: DRY and static attribute for multiple classes.

2011-02-03 Thread Marc Aymerich
On Feb 3, 10:24 am, Peter Otten __pete...@web.de wrote: Marc Aymerich wrote: On Feb 2, 12:11 am, Peter Otten __pete...@web.de wrote: Marc Aymerich wrote: Hi!, Unfortunately per_class attribute losses the independence when I try to mix it with django models.Model . from django.db

locale settings and date parsing under windows

2011-02-03 Thread AlienBaby
Hi, I'm attempting to convert some date-time strings from a text file under windows into a datetime object as returned by strptime() However, the strings can represent dates in various formats based on the country of origin, for example shortened month names etc.. are different between

Re: IDLE: A cornicopia of mediocrity and obfuscation.

2011-02-03 Thread flebber
On Feb 1, 11:38 pm, rantingrick rantingr...@gmail.com wrote: On Feb 1, 4:20 am, flebber flebber.c...@gmail.com wrote: Sorry Rick too boringtrying to get bored people to bite at your ultra lame post yawn... Well reality and truth both has a tendency to be boring. Why? Well

Re: Style question: Nicknames for deeply nested objects

2011-02-03 Thread Jean-Michel Pichavant
Gerald Britton wrote: however, considering what import a.module.that.is.quite.nested as myModule Won't work since I get the objects at run time myModule = __import__('whatever.module.imported.at.run.time', globals(), locals(), [], -1) See

Re: locale settings and date parsing under windows

2011-02-03 Thread AlienBaby
On Feb 3, 10:22 am, AlienBaby matt.j.war...@gmail.com wrote: Hi, I'm attempting to convert some date-time strings from a text file under windows into a datetime object as returned by strptime() However, the strings can represent dates in various formats based on the country of origin, for

Re: locale settings and date parsing under windows

2011-02-03 Thread Martin P. Hellwig
On 02/03/11 10:59, AlienBaby wrote: On Feb 3, 10:22 am, AlienBabymatt.j.war...@gmail.com wrote: Hi, I'm attempting to convert some date-time strings from a text file under windows into a datetime object as returned by strptime() However, the strings can represent dates in various formats

Re: locale settings and date parsing under windows

2011-02-03 Thread AlienBaby
On Feb 3, 12:13 pm, Martin P. Hellwig martin.hell...@dcuktec.org wrote: On 02/03/11 10:59, AlienBaby wrote: On Feb 3, 10:22 am, AlienBabymatt.j.war...@gmail.com  wrote: Hi, I'm attempting to convert some date-time strings from a text file under windows into a datetime object as

Re: IDLE: A cornicopia of mediocrity and obfuscation.

2011-02-03 Thread Benjamin Kaplan
On Thu, Feb 3, 2011 at 5:29 AM, flebber flebber.c...@gmail.com wrote: On Feb 1, 11:38 pm, rantingrick rantingr...@gmail.com wrote: On Feb 1, 4:20 am, flebber flebber.c...@gmail.com wrote: Sorry Rick too boringtrying to get bored people to bite at your ultra lame post yawn...

Re: locale settings and date parsing under windows

2011-02-03 Thread python
Matt, I'm now just using a handbuilt dict that holds translations like 'fr_FR' : 'French_France' 'da_DK' : 'Danish_Denmark' What sources are you using for your dict keys and dict values? I'm struggling with the same issue and I'm looking for master references for both sets of code. Thank

Re: os.path.join doubt

2011-02-03 Thread Westley Martínez
'C:\\Users\\me\\Documents\\..\\Pictures\\images\\my.jpg' is a valid path. .. means parent, not 'go back a directory'. But you should really be trying this: p1 = os.environ['HOMEPATH'] p2 = os.path.join(p1, 'Pictures', 'images', 'my.jpg') On Wed, 2011-02-02 at 20:46 -0800, harryos wrote: In

Errors while using strip and remove on a variable.

2011-02-03 Thread anand jeyahar
Hi, I am trying to strip a string and then remove on the resulting list to remove a set of characters. It works fine with the python shell. But after remove the list becomes None, when i am running it from within a script. I am guessing it has something to do with the way python handles

Re: Errors while using strip and remove on a variable.

2011-02-03 Thread Benjamin Kaplan
On Thu, Feb 3, 2011 at 10:21 AM, anand jeyahar anand.ibm...@gmail.com wrote: Hi,     I am trying to strip a string and then remove on the resulting list to remove a set of characters. It works fine with the python shell. But after remove the list becomes None, when i am running it from within

Re: Errors while using strip and remove on a variable.

2011-02-03 Thread Gary Herron
On 02/03/2011 07:21 AM, anand jeyahar wrote: Hi, I am trying to strip a string and then remove on the resulting list to remove a set of characters. It works fine with the python shell. But after remove the list becomes None, when i am running it from within a script. I am guessing it

Re: Perl Hacker, Python Initiate

2011-02-03 Thread Hrvoje Niksic
Gary Chambers gwch...@gwcmail.com writes: Will someone please provide some insight on how to accomplish that task in Python? I am unable to continually (i.e. it stops after displaying a single line) loop through the output while testing for the matches on the two regular expressions. Thank

Re: os.path.join doubt

2011-02-03 Thread Ethan Furman
Steven D'Aprano wrote: BTW, Windows accepts / as well as \ as a path separator. You will have far fewer headaches if you use that. Just because Windows accepts / doesn't make it a good idea... Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type help,

Re: IDLE: A cornicopia of mediocrity and obfuscation.

2011-02-03 Thread rantingrick
On Feb 3, 4:29 am, flebber flebber.c...@gmail.com wrote: For an example of a brilliant beginners ide racket has it covered with DrRackethttp://racket-lang.org/, it has selectable language levels beginner, intermediate, advanced that allows the learner to adjust the level of language features

Re: Perl Hacker, Python Initiate

2011-02-03 Thread sturlamolden
On 2 Feb, 05:36, Gary Chambers gwch...@gwcmail.com wrote: Given the following Perl script: (...) Let me quote the deceased Norwegian lisp hacker Erik Naggum: Excuse me while I barf in Larry Wall's general direction. Sturla -- http://mail.python.org/mailman/listinfo/python-list

Re: Perl Hacker, Python Initiate

2011-02-03 Thread waku
you've already got a hint on how to do it using library functions in python. below is a more literal suggestion. On Feb 1, 10:36 pm, Gary Chambers gwch...@gwcmail.com wrote: All, Given the following Perl script: #!/usr/bin/perl %dig = (      solaris = /usr/sbin/dig,      linux   =

'Upload a valid image' errors with PIL 1.1.7/ Python 2.6/ Mac 10.6.2

2011-02-03 Thread Anjali Arora
Hi, I am struggling with this for the past 2 days: first I got the above error, googled around to find that I needed the libjpeg module as well, so I re-installed the lot, first libjpeg then PIL; got a couple errors like JPEG decoder not available etc, fixed that. Now it passes the selftest,

Re: Perl Hacker, Python Initiate

2011-02-03 Thread Jorgen Grahn
On Wed, 2011-02-02, Gary Chambers wrote: All, Given the following Perl script: #!/usr/bin/perl I'm a Perl user, but I generally refuse to read Perl code which doesn't utilize 'use warnings/-w' and 'use strict'. There are just too many crazy bugs and 1980s constructs which go unnoticed

Fwd: 'Upload a valid image' errors with PIL 1.1.7/ Python 2.6/ Mac 10.6.2/ Django 1.2.3

2011-02-03 Thread Anjali Arora
I'm sorry, by admin site below, I mean Django Admin site. Hi, I am struggling with this for the past 2 days: first I got the above error, googled around to find that I needed the libjpeg module as well, so I re-installed the lot, first libjpeg then PIL; got a couple errors like JPEG decoder

Re: Style question: Nicknames for deeply nested objects

2011-02-03 Thread Jean-Michel Pichavant
Gerald Britton wrote: Nope. it's nothing to do with imports. It's about objects passed to methods at run time. Complicated objects with many levels. Not about modules at all. Who is providing these objects ? - Your code ? = as said before, you can fix your design with a proper object

Re: IDLE: A cornicopia of mediocrity and obfuscation.

2011-02-03 Thread rantingrick
If anyone would like to see a good example of how IDLE code should be written. I highly suggest you check out the source for PyShell and PyCrust which is located in roughly... HOME\PythonXX\Lib\site-packages\wx-2.8-msw-ansi\wx\py: * shell.py * crust.py * filling.py Also run these scripts to

Re: Errors while using strip and remove on a variable.

2011-02-03 Thread Stephen Hansen
On 2/3/11 7:21 AM, anand jeyahar wrote: Hi, I am trying to strip a string and then remove on the resulting list to remove a set of characters. It works fine with the python shell. But after remove the list becomes None, when i am running it from within a script. I am guessing it has

socket.rcv timeout while-loop

2011-02-03 Thread Dwayne Blind
Hi everybody, I am using Python 3.0. I have such a code : b=time.clock() while time.clock()-b3 : data=s.recv(1024) However I would like to set timeout on the socket rcv method, so that the while loop stops exactly after 3 seconds. Is this possible ? Thanks a lot, Dwayne --

Re: socket.rcv timeout while-loop

2011-02-03 Thread Stephen Hansen
On 2/3/11 9:56 AM, Dwayne Blind wrote: However I would like to set timeout on the socket rcv method, so that the while loop stops exactly after 3 seconds. Is this possible ? I rarely do low-level socket stuff -- but I think s.settimeout() is what you're looking for. It applies to the whole

New article on grabbing city points from geonames, processing with Python, and rendering in MapPoint

2011-02-03 Thread Eric Frost
Add City Coverage to MapPoint using the GeoNames Database by Richard Marsden http://www.mapforums.com/add-city-coverage-mappoint-using-geonames-database-15244.html -- m: 312-399-1586 http://www.MapForums.com http://www.MP2Kmag.com -- http://mail.python.org/mailman/listinfo/python-list

Re: socket.rcv timeout while-loop

2011-02-03 Thread Dwayne Blind
Thanks for your answer. I don't want to reset my socket. I want to apply the timeout to the rcv method only. What about select ? http://docs.python.org/library/select.html#select.select How to implement it ? Thanks a lot, Dwayne 2011/2/3 Stephen Hansen me+list/pyt...@ixokai.io On 2/3/11

Pydev 1.6.5 Released

2011-02-03 Thread Fabio Zadrozny
Hi All, Pydev 1.6.5 has been released Details on Pydev: http://pydev.org Details on its development: http://pydev.blogspot.com Release Highlights: --- * Syntax highlighting now has options to have {}, [] and () as well as operators in different colors * Code

Re: socket.rcv timeout while-loop

2011-02-03 Thread Stephen Hansen
On 2/3/11 10:13 AM, Dwayne Blind wrote: Thanks for your answer. I don't want to reset my socket. I want to apply the timeout to the rcv method only. Setting the timeout does not reset [your] socket, I don't think. And I get that you want to only timeout recv... that's why I pointed out its a

ptrace vs. python-ptrace

2011-02-03 Thread Grant Edwards
I'd like to do some experimentation with the Linux ptrace facility. Before I jump in, I was wondering if anybody has any comments they'd like to offer on the relative merits of ptrace vs. python-ptrace: http://pypi.python.org/pypi/ptrace http://pypi.python.org/pypi/python-ptrace Ptrace

returning all matching groups with re.search()

2011-02-03 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
Here's a scenario: import re m = re.search('e','fredbarneybettywilma') Now, here's a stupid question: why doesn't m.groups() return ('e','e','e'). I'm trying to figure out how to match ALL of the instances of a pattern in one call - the group() and groups() return subgroups... how do I get my

Re: returning all matching groups with re.search()

2011-02-03 Thread Chris Rebert
On Thu, Feb 3, 2011 at 12:32 PM, mhearne808[insert-at-sign-here]gmail[insert-dot-here]com mhearne...@gmail.com wrote: Here's a scenario: import re m = re.search('e','fredbarneybettywilma') Now, here's a stupid question: why doesn't m.groups() return ('e','e','e'). Straight from the docs

Re: returning all matching groups with re.search()

2011-02-03 Thread Benjamin Kaplan
On Thu, Feb 3, 2011 at 3:32 PM, mhearne808[insert-at-sign-here]gmail[insert-dot-here]com mhearne...@gmail.com wrote: Here's a scenario: import re m = re.search('e','fredbarneybettywilma') Now, here's a stupid question: why doesn't m.groups() return ('e','e','e'). I'm trying to figure out

JSONBOT 0.6.1 RELEASED

2011-02-03 Thread Bart Thate
Hello every human out there ! i'm pleased to announce the release of JSONBOT 0.6.1 FINAL, a release that saw a lot of work into the shell side of things and no changes to GAE. 0.6.1 has the following changes: * the ! char is not used instead of | in a pipeline. This is to make it easier to use

Download an attachment from an IMAP email

2011-02-03 Thread Vincent Davis
I have a few emails I am trying to download from my google account. I seem to be getting the message but each of these messages have an attachment. I don't understand what I ned to do to get and save the attachment to a local file. Here is what I have so far. M = imaplib.IMAP4_SSL(IMAP_SERVER,

Re: socket.rcv timeout while-loop

2011-02-03 Thread Dwayne Blind
Thanks Stephen. It's really nice of you. I have not understood everything though. (I have never used a context manager before.) Here are some comments : timeout = s.gettimeout()# Is that the default timeout ? s.settimeout(3) # I guess this is a 3 second timeout s.recv(1024)

Re: os.path.join doubt

2011-02-03 Thread Steven D'Aprano
On Thu, 03 Feb 2011 07:58:55 -0800, Ethan Furman wrote: Steven D'Aprano wrote: BTW, Windows accepts / as well as \ as a path separator. You will have far fewer headaches if you use that. Just because Windows accepts / doesn't make it a good idea... No. Windows accepting slashes as the

Re: socket.rcv timeout while-loop

2011-02-03 Thread Dwayne Blind
The solution would be timeout = s.gettimeout() s.settimeout(3) b=time.clock() while time.clock()-b3 : try : data=s.recv(1024) except : break s.settimeout(timeout) Am I right ? Dwayne 2011/2/4 Dwayne Blind

Re: os.path.join doubt

2011-02-03 Thread Westley Martínez
On Thu, 2011-02-03 at 23:11 +, Steven D'Aprano wrote: On Thu, 03 Feb 2011 07:58:55 -0800, Ethan Furman wrote: Steven D'Aprano wrote: BTW, Windows accepts / as well as \ as a path separator. You will have far fewer headaches if you use that. Just because Windows accepts / doesn't

Re: os.path.join doubt

2011-02-03 Thread Thomas L. Shinnick
At 05:33 PM 2/3/2011, Westley Martínez wrote: On Thu, 2011-02-03 at 23:11 +, Steven D'Aprano wrote: On Thu, 03 Feb 2011 07:58:55 -0800, Ethan Furman wrote: Steven D'Aprano wrote: [snip] Yes. Is there a problem? All those paths should be usable from Windows. If you find it ugly to see

8-Day Python Power Course in Leipzig/Germany

2011-02-03 Thread Mike Müller
Eight Days of Python Training - Can't get enough of Python? Then this course is for you. A three day introduction to Python as a warm-up, followed by five days of advanced Python training. All courses given in English. May 13 - 15, 2011 Python for Programmers

Re: os.path.join doubt

2011-02-03 Thread Westley Martínez
On Thu, 2011-02-03 at 17:57 -0600, Thomas L. Shinnick wrote: At 05:33 PM 2/3/2011, Westley Martínez wrote: On Thu, 2011-02-03 at 23:11 +, Steven D'Aprano wrote: On Thu, 03 Feb 2011 07:58:55 -0800, Ethan Furman wrote: Steven D'Aprano wrote: [snip] Yes. Is there a

Re: socket.rcv timeout while-loop

2011-02-03 Thread Dwayne Blind
or rather timeout = s.gettimeout() b=time.clock() while time.clock()-b3 : s.settimeout(3-time.clock()+b) try : data=s.recv(1024) except : break s.settimeout(timeout) Sorry for all these messages Dwayne 2011/2/4

Re: socket.rcv timeout while-loop

2011-02-03 Thread Stephen Hansen
On 2/3/11 3:02 PM, Dwayne Blind wrote: Thanks Stephen. It's really nice of you. I have not understood everything though. (I have never used a context manager before.) Here are some comments : timeout = s.gettimeout()# Is that the default timeout ? s.settimeout(3) # I

Re: Download an attachment from an IMAP email

2011-02-03 Thread Kushal Kumaran
On Fri, Feb 4, 2011 at 3:44 AM, Vincent Davis vinc...@vincentdavis.net wrote: I have a few emails I am trying to download from my google account. I seem to be getting the message but each of these messages have an attachment. I don't understand what I ned to do to get and save the attachment to

code structure advise for a model

2011-02-03 Thread Martin De Kauwe
Hi, I am translating some c++ code to python and just wanted to ask some advise on structure. The original has everything declared globally and nothing passed via function (I assume, but don't know, that this isn't just standard c++ practice!). So given this, I have a pretty much clean slate as I

Re: socket.rcv timeout while-loop

2011-02-03 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Dwayne Blind wrote: or rather timeout = s.gettimeout() b=time.clock() while time.clock()-b3 : s.settimeout(3-time.clock()+b) try : data=s.recv(1024) except : break

[issue7678] subprocess.Popen pipeline example code in the documentation is lacking

2011-02-03 Thread Ross Lagerwall
Ross Lagerwall rosslagerw...@gmail.com added the comment: The docs should be updated. This has been noted in msg54949 and http://www.enricozini.org/2009/debian/python-pipes/ Perhaps this example will make it clear: import subprocess p1 = subprocess.Popen([yes], stdout=subprocess.PIPE) p2 =

[issue11098] syntax error at end of line in interactive python -u

2011-02-03 Thread Alexey Luchko
Alexey Luchko l...@ank-sia.com added the comment: I reported the issue just because I didn't find it is already known. I don't think it is worth backporting. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11098

[issue11079] Make OS X entry in Applications like that in Windows

2011-02-03 Thread Ned Deily
Ned Deily n...@acm.org added the comment: After discussions with Raymond, I now agree that it would be better to not copy the Tools into the Applications/Python 3.x directory since everything else there is of the double-clickable nature, i.e. aimed at the user more comfortable with a GUI

[issue11079] Make OS X entry in Applications like that in Windows

2011-02-03 Thread Ned Deily
Changes by Ned Deily n...@acm.org: Added file: http://bugs.python.org/file20662/issue11079_extras_py3k.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11079 ___

[issue10227] Improve performance of MemoryView slicing

2011-02-03 Thread Stefan Behnel
Stefan Behnel sco...@users.sourceforge.net added the comment: Here are some real micro benchmarks (note that the pybench benchmarks actually do lots of other stuff besides slicing): base line: $ ./python -m timeit -s 'l = list(range(100)); s=slice(None)' 'l[s]' 100 loops, best of 3: 0.464

[issue11079] Make OS X entry in Applications like that in Windows

2011-02-03 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- keywords: -after moratorium, buildbot, easy, gsoc, patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11079 ___

[issue10227] Improve performance of MemoryView slicing

2011-02-03 Thread Stefan Behnel
Stefan Behnel sco...@users.sourceforge.net added the comment: Here's another base line test: slicing an empty list patched: $ ./python -m timeit -s 'l = []' 'l[:]' 1000 loops, best of 3: 0.0847 usec per loop original: $ ./python -m timeit -s 'l = []' 'l[:]' 1000 loops, best of 3:

[issue10227] Improve performance of MemoryView slicing

2011-02-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I find it interesting that the base line is way below the other timings. That makes me think it's actually worth caching constant slice instances, as CPython already does for tuples. Indeed. I have never touched it, but I suppose it needs an

[issue1757072] Zipfile robustness

2011-02-03 Thread Ernst Sjöstrand
Changes by Ernst Sjöstrand ern...@gmail.com: -- nosy: +Ernst.Sjöstrand ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1757072 ___ ___

[issue11098] syntax error at end of line in interactive python -u

2011-02-03 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Great. Thanks for reporting it, and I'm glad we managed to already have it fixed :) -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker

[issue11087] Speeding up the interpreter with a few lines of code

2011-02-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Ok, things are at best 3-4% faster here (often unchanged). -- versions: -Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org

[issue10227] Improve performance of MemoryView slicing

2011-02-03 Thread Stefan Behnel
Stefan Behnel sco...@users.sourceforge.net added the comment: of course, this will not help for other common cases such as l[x:x+2] ... which is exactly what this slice caching patch is there for. ;-) -- ___ Python tracker rep...@bugs.python.org

[issue10227] Improve performance of MemoryView slicing

2011-02-03 Thread Stefan Behnel
Stefan Behnel sco...@users.sourceforge.net added the comment: A quick test against the py3k stdlib: find -name *.py | while read file; do egrep '\[[-0-9]*:[-0-9]*\]' $file; done | wc -l This finds 2096 lines in 393 files. -- ___ Python tracker

[issue11105] Compiling evil ast crashes interpreter

2011-02-03 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: Looks like a stack overflow caused by an infinite recursion. I am not sure if it is possible to add cycle detection code without sacrificing performance or setting some arbitrary limits. I wonder: Why ast nodes need to

[issue11105] Compiling evil ast crashes interpreter

2011-02-03 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2011/2/3 Alexander Belopolsky rep...@bugs.python.org: Alexander Belopolsky belopol...@users.sourceforge.net added the comment: Looks like a stack overflow caused by an infinite recursion.  I am not sure if it is possible to add cycle

[issue11105] Compiling evil ast crashes interpreter

2011-02-03 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: On Thu, Feb 3, 2011 at 12:08 PM, Benjamin Peterson rep...@bugs.python.org wrote: .. I wonder: Why ast nodes need to be mutable? So people can change them. Well, they are hashable, so this needs to be done carefully. Is

[issue11105] Compiling evil ast crashes interpreter

2011-02-03 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2011/2/3 Alexander Belopolsky rep...@bugs.python.org: Alexander Belopolsky belopol...@users.sourceforge.net added the comment: On Thu, Feb 3, 2011 at 12:08 PM, Benjamin Peterson rep...@bugs.python.org wrote: .. I wonder: Why ast

[issue11106] python 2.6.6 and python 2.7.1 cannot be built successfully because of an segment fault on NetBSD-5.1-sparc

2011-02-03 Thread H Xu
New submission from H Xu xuh...@gmail.com: Build python 2.6.6 and python 2.7.1 on a NetBSD-5.1-sparc machine. 1. Run './configure'; 2. Run 'make'; 3. Run 'make install'. There will be a problem after run 'make install'. The last few lines of error messages are like the following: Compiling

[issue7111] abort when stderr is closed

2011-02-03 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: That's an interesting point. Do you know of places where we use fd 2 instead of sys.stderr? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7111

[issue11107] Cache constant slice instances

2011-02-03 Thread Stefan Behnel
New submission from Stefan Behnel sco...@users.sourceforge.net: Follow-up to ticket 10227. The following facts seem to indicate that it would be worth caching constant instances of the slice type, such as in [:] or [:-1]. with cached slice instance: $ ./python -m timeit -s 'l =

[issue10227] Improve performance of MemoryView slicing

2011-02-03 Thread Stefan Behnel
Stefan Behnel sco...@users.sourceforge.net added the comment: Created follow-up issue 11107 for caching constant slice objects. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10227 ___

[issue11107] Cache constant slice instances

2011-02-03 Thread Stefan Behnel
Stefan Behnel sco...@users.sourceforge.net added the comment: Erm, issue 10227. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11107 ___ ___

[issue8914] Run clang's static analyzer

2011-02-03 Thread Brett Cannon
Brett Cannon br...@python.org added the comment: This was just dead assignments. I have not tackled Idempotent operations, dead increments, dead initializations, dead nested assignments, possible deref of NULL, deref of unassigned pointer, division by zero, undefined/garbage results, or

[issue11107] Cache constant slice instances

2011-02-03 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: Similar idea has been rejected in issue2268 because the win was too small to justify the number of changes that had to be made. -- nosy: +belopolsky ___ Python tracker

[issue7111] abort when stderr is closed

2011-02-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: That's an interesting point. Do you know of places where we use fd 2 instead of sys.stderr? We normally don't. One reason is that buffering inside sys.stderr can make ordering of output incorrect. There are some places in C code where we do

[issue11107] Cache constant slice instances

2011-02-03 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11107 ___ ___ Python-bugs-list mailing

[issue11107] Cache constant slice instances

2011-02-03 Thread Stefan Behnel
Stefan Behnel sco...@users.sourceforge.net added the comment: Hmm, ok, but AFAICT, your patch was rejected rather because of the way it approached the problem, not so much because of the issue itself. Plus, the fact that Python 3 requires slices in more places than Python 2 (which had the

[issue7111] abort when stderr is closed

2011-02-03 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: On Thu, Feb 3, 2011 at 2:44 PM, Antoine Pitrou rep...@bugs.python.org wrote: .. Do you know of places where we use fd 2 instead of sys.stderr? We normally don't. One reason is that buffering inside sys.stderr can make

[issue7111] abort when stderr is closed

2011-02-03 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: On Thu, Feb 3, 2011 at 2:44 PM, Antoine Pitrou rep...@bugs.python.org wrote: .. Do you know of places where we use fd 2 instead of sys.stderr? We normally don't. Hmm, grep fprintf(stderr, returned 122 hits in the py3k

[issue7111] abort when stderr is closed

2011-02-03 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +exarkun, loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7111 ___ ___ Python-bugs-list

[issue7111] abort when stderr is closed

2011-02-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: We normally don't. One reason is that buffering inside sys.stderr can make ordering of output incorrect. There are some places in C code where we do fprintf(stderr, ...) but that's for specialized debugging (disabled in normal builds) or

[issue7111] abort when stderr is closed

2011-02-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Le jeudi 03 février 2011 à 19:59 +, Alexander Belopolsky a écrit : Alexander Belopolsky belopol...@users.sourceforge.net added the comment: On Thu, Feb 3, 2011 at 2:44 PM, Antoine Pitrou rep...@bugs.python.org wrote: .. Do you know

[issue7111] abort when stderr is closed

2011-02-03 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: On Thu, Feb 3, 2011 at 11:56 AM, Alexander Belopolsky rep...@bugs.python.org wrote: 3rd party extensions.    What is the use case for python -?    Is it important enough to justify the risk of accidental data loss? I don't think closing

[issue11105] Compiling evil ast crashes interpreter

2011-02-03 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Alex: If the node attributes were not mutable, it would be extremely awkward, not to say inefficient, to mutate an already existing AST as returned by ast.parse(). The AST objects in the _ast module aren't what Python works with internally,

[issue7111] abort when stderr is closed

2011-02-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I don't think so. One more important use case is when running a Unix daemon, which has (AFAIK) to close all std handles. I just took a look at http://pypi.python.org/pypi/python-daemon/, and it uses dup2() to redirect standard streams, which is

[issue11107] Cache constant slice instances

2011-02-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Hmm, ok, but AFAICT, your patch was rejected rather because of the way it approached the problem, not so much because of the issue itself. I would be rather for the patch myself. The bytecode currently generated for sliced indexing is awfully

[issue8914] Run clang's static analyzer

2011-02-03 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Am looking forward to the rest. This will be a nice cleanup. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8914 ___

[issue8914] Run clang's static analyzer

2011-02-03 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: Removed file: http://bugs.python.org/file20660/clang_analyzer.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8914 ___

[issue8914] Run clang's static analyzer

2011-02-03 Thread Brett Cannon
Brett Cannon br...@python.org added the comment: New patch which covers dead assignments and increments. -- Added file: http://bugs.python.org/file20663/clang_analyzer.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8914

[issue7111] abort when stderr is closed

2011-02-03 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: On Thu, Feb 3, 2011 at 12:18 PM, Antoine Pitrou rep...@bugs.python.org wrote: I just took a look at http://pypi.python.org/pypi/python-daemon/, and it uses dup2() to redirect standard streams, which is far nicer. I'm more worried about

[issue11108] Intermittent AttributeError when using time.strptime in threads

2011-02-03 Thread Carlos Corbacho
New submission from Carlos Corbacho cathec...@gmail.com: time.strptime() intermittently (and I mean _really_ intermittently) throws an AttributeError. Steps to reproduce: Run the attached script (you may have to do this quite a lot of times; in an evening of trying, I could only trigger this

[issue11106] python 2.6.6 and python 2.7.1 cannot be built successfully because of an segment fault on NetBSD-5.1-sparc

2011-02-03 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Can you debug this, e.g. by inspecting the core file? -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11106 ___

  1   2   >