Help with loading file into an array

2013-05-05 Thread peter berrett
Hi all I am trying to build a program that can find comets in a series of astronomical images. I have already written functions to find the comet in a series of images, the data of which is stored in embedded lists. The area I am having difficulty with is take a standard gif file (1024 x 1024)

Re: Help with loading file into an array

2013-05-05 Thread Fábio Santos
Using a nested array should waste a lot of memory. I think you should use PIL to load and read the image. I want to read the data from that gif file taking the red data (excluding the green and blue data) and store that in an array called Image[][] which is a nested array length 1024 with a

Re: Help with loading file into an array

2013-05-05 Thread Colin J. Williams
On 05/05/2013 3:43 AM, Fábio Santos wrote: Using a nested array should waste a lot of memory. I think you should use PIL to load and read the image. I want to read the data from that gif file taking the red data (excluding the green and blue data) and store that in an array called Image[][]

Re: Help with loading file into an array

2013-05-05 Thread Jens Thoms Toerring
peter berrett pwberr...@gmail.com wrote: I am trying to build a program that can find comets in a series of astronomical images. I have already written functions to find the comet in a series of images, the data of which is stored in embedded lists. The area I am having difficulty with is

Python not starting

2013-05-05 Thread rama29065
I was using python from over an year and half.Suddenly from yesterday i'm unable to run it. The error is as follows Traceback (most recent call last): File C:\Python27\lib\site.py, line 563, in module main() File C:\Python27\lib\site.py, line 546, in main known_paths =

Re: Python not starting

2013-05-05 Thread Roy Smith
In article 9ace60b8-a07d-41bc-ac9f-507f6c61f...@googlegroups.com, rama29...@gmail.com wrote: I was using python from over an year and half.Suddenly from yesterday i'm unable to run it. The error is as follows Traceback (most recent call last): File C:\Python27\lib\site.py, line 563, in

Re: Python not starting

2013-05-05 Thread DRJ Reddy
On Sunday, May 5, 2013 7:21:59 PM UTC+5:30, Roy Smith wrote: In article 9ace60b8-a07d-41bc-ac9f-507f6c61f...@googlegroups.com, rama29...@gmail.com wrote: I was using python from over an year and half.Suddenly from yesterday i'm unable to run it. The error is as follows

Re: Python not starting

2013-05-05 Thread Roy Smith
On Sunday, May 5, 2013 7:21:59 PM UTC+5:30, Roy Smith wrote: In article 9ace60b8-a07d-41bc-ac9f-507f6c61f...@googlegroups.com, Just a wild guess, but did you happen to create a module of your own named stat, which is getting imported instead of the one from the library? In article

Re: Python not starting

2013-05-05 Thread Mark Lawrence
On 05/05/2013 15:00, DRJ Reddy wrote: On Sunday, May 5, 2013 7:21:59 PM UTC+5:30, Roy Smith wrote: In article 9ace60b8-a07d-41bc-ac9f-507f6c61f...@googlegroups.com, rama29...@gmail.com wrote: I was using python from over an year and half.Suddenly from yesterday i'm unable to run it. The

Re: Python not starting

2013-05-05 Thread DRJ Reddy
On Sunday, May 5, 2013 7:46:48 PM UTC+5:30, Roy Smith wrote: On Sunday, May 5, 2013 7:21:59 PM UTC+5:30, Roy Smith wrote: In article 9ace60b8-a07d-41bc-ac9f-507f6c61f...@googlegroups.com, Just a wild guess, but did you happen to create a module of your own named stat, which

Re: Python not starting

2013-05-05 Thread DRJ Reddy
On Sunday, May 5, 2013 7:56:58 PM UTC+5:30, Mark Lawrence wrote: On 05/05/2013 15:00, DRJ Reddy wrote: On Sunday, May 5, 2013 7:21:59 PM UTC+5:30, Roy Smith wrote: In article 9ace60b8-a07d-41bc-ac9f-507f6c61f...@googlegroups.com, rama29...@gmail.com wrote: I was using

Re: Python not starting

2013-05-05 Thread Chris Angelico
On Mon, May 6, 2013 at 12:16 AM, Roy Smith r...@panix.com wrote: In article c7c26e78-b786-4205-9ffa-5eb290064...@googlegroups.com, DRJ Reddy rama29...@gmail.com wrote: Even from command prompt i can't start python.The error is coming up.Python in Windows7 box. I don't know Windows, but my

Re: Python not starting

2013-05-05 Thread DRJ Reddy
On Sunday, May 5, 2013 8:30:59 PM UTC+5:30, Chris Angelico wrote: On Mon, May 6, 2013 at 12:16 AM, Roy Smith r...@panix.com wrote: In article c7c26e78-b786-4205-9ffa-5eb290064...@googlegroups.com, DRJ Reddy rama29...@gmail.com wrote: Even from command prompt i can't start python.The

Re: Python not starting

2013-05-05 Thread Chris Angelico
On Mon, May 6, 2013 at 1:11 AM, DRJ Reddy rama29...@gmail.com wrote: On Sunday, May 5, 2013 8:30:59 PM UTC+5:30, Chris Angelico wrote: On Mon, May 6, 2013 at 12:16 AM, Roy Smith r...@panix.com wrote: In article c7c26e78-b786-4205-9ffa-5eb290064...@googlegroups.com, DRJ Reddy

How to avoid PEP8 'imported but unused'

2013-05-05 Thread Adam Jiang
I am new to python. Now, I am woring on an application within Django framework. When I checked my code with pep8 and pyflakes, some warning messages show up-'Foobar imported but unused'. Obviously, it indicates that some modules are imprted to current module but never get references. However, it

learning python

2013-05-05 Thread leonardo selmi
hi guys i need to find a good book to learn python with exercises and solutions, any suggestions? thanks! best regards leonardo-- http://mail.python.org/mailman/listinfo/python-list

Re: How to avoid PEP8 'imported but unused'

2013-05-05 Thread Fábio Santos
I usually do this on pyflakes: import whatever assert whatever # silence pyflakes Pyflakes and pep8 have no way of knowing django will import and use your module, or whether you are just importing a module for the side effects, so they issue a warning anyway. Assert'ing counts as using the

Re: How to avoid PEP8 'imported but unused'

2013-05-05 Thread MRAB
On 05/05/2013 17:00, Adam Jiang wrote: I am new to python. Now, I am woring on an application within Django framework. When I checked my code with pep8 and pyflakes, some warning messages show up-'Foobar imported but unused'. Obviously, it indicates that some modules are imprted to current

Re: Python not starting

2013-05-05 Thread DRJ Reddy
Chris i have seen stat.__file__. It gives me 'C:\\Python27\\lib\\stat.pyc'. What should i do now. -- http://mail.python.org/mailman/listinfo/python-list

Re: learning python

2013-05-05 Thread DRJ Reddy
A byte of python with learning python by Mark Lutz is a good combination. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to avoid PEP8 'imported but unused'

2013-05-05 Thread Peter Otten
Adam Jiang wrote: I am new to python. Now, I am woring on an application within Django framework. When I checked my code with pep8 and pyflakes, some warning messages show up-'Foobar imported but unused'. Obviously, it indicates that some modules are imprted to current module but never get

Re: How to avoid PEP8 'imported but unused'

2013-05-05 Thread Adam Jiang
Thanks. It works very well. One more question. In this particular case it seems 'assert' should be safe as a workaround, doesn't it? 'assert' will check if the symbol is imported and not NULL. Is there side effect if I just applied this rule as a generic one. /Adam On Sun, May 05, 2013 at

Re: [Python-Help] learning python

2013-05-05 Thread Eric Brunson
On 05/05/2013 10:08 AM, leonardo selmi wrote: hi guys i need to find a good book to learn python with exercises and solutions, any suggestions? thanks! Leonardo, There are several good online tutorials available, many listed here: http://wiki.python.org/moin/BeginnersGuide There is

Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Ignoramus16992
According to CIO.com, Python programmers make only $83,000 per year, while Perl programmers make $93,000 per year. http://www.cio.com/slideshow/detail/97819?source=ifwartcio#slide10 http://www.cio.com/slideshow/detail/97819?source=ifwartcio#slide11 I would like to know, what explains the

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Stephan Vladimir Bugaj
Most likely more legacy Perl code in mission critical systems S Sent from my pocket UNIVAC. On May 5, 2013, at 10:11 AM, Ignoramus16992 ignoramus16992@NOSPAM.16992.invalid wrote: According to CIO.com, Python programmers make only $83,000 per year, while Perl programmers make $93,000 per

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Fábio Santos
I wouldn't touch perl code with a ten foot pole. On the other hand, python is pleasing to the eye and easy to write, read and modify. This means that you can easily be replaced with someone else who also knows python, so your company doesn't care much about paying you well and keeping you there.

Re: How to avoid PEP8 'imported but unused'

2013-05-05 Thread Fábio Santos
That assert will never fail. If the symbol is not imported, the import statement raises ImportError. And actually assert makes sure that the value is not false-ish, not None/Null. And AFAIK a module object is *always* true. One more question. In this particular case it seems 'assert' should be

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Stephan Vladimir Bugaj
And seniority combined with annual cost of living raises, due to Perl being in use longer S Sent from my pocket UNIVAC. On May 5, 2013, at 10:11 AM, Ignoramus16992 ignoramus16992@NOSPAM.16992.invalid wrote: According to CIO.com, Python programmers make only $83,000 per year, while Perl

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Chris Angelico
On Mon, May 6, 2013 at 3:11 AM, Ignoramus16992 ignoramus16992@nospam.16992.invalid wrote: According to CIO.com, Python programmers make only $83,000 per year, while Perl programmers make $93,000 per year. http://www.cio.com/slideshow/detail/97819?source=ifwartcio#slide10

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread rusi
On May 5, 10:11 pm, Ignoramus16992 ignoramus16...@NOSPAM. 16992.invalid wrote: According to CIO.com, Python programmers make only $83,000 per year, while Perl programmers make $93,000 per year.

Re: Python not starting

2013-05-05 Thread Roy Smith
In article 9d2513ed-2738-4b6f-92af-82c1faa54...@googlegroups.com, DRJ Reddy rama29...@gmail.com wrote: If you're using GoogleCrap� please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence Sorry for double spaced stuff,how can i get rid of it. I

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Fábio Santos
Most likely more legacy Perl code in mission critical systems Which is unfair because when Python is ever surpassed by an even better language/technology then we get paid more to work Python and not move the industry forward by moving to the new technology and hacking on it. -- Fábio Santos --

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Roy Smith
In article zrodnzu2u6sydxvmnz2dnuvz_v2dn...@giganews.com, Ignoramus16992 ignoramus16992@NOSPAM.16992.invalid wrote: According to CIO.com, Python programmers make only $83,000 per year, while Perl programmers make $93,000 per year. It's amazing the depths to which people are willing to sink

Re: [Python-Help] learning python

2013-05-05 Thread leonardo selmi
thanks! Il giorno 05/mag/2013, alle ore 18:58, Eric Brunson brun...@brunson.com ha scritto: On 05/05/2013 10:08 AM, leonardo selmi wrote: hi guys i need to find a good book to learn python with exercises and solutions, any suggestions? thanks! Leonardo, There are several

Re: Python not starting

2013-05-05 Thread DRJ Reddy
I did read and understood that while replying if is there we will get a blank line unnecessarily. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Mark Lawrence
On 05/05/2013 18:35, rusi wrote: On May 5, 10:11 pm, Ignoramus16992 ignoramus16...@NOSPAM. 16992.invalid wrote: According to CIO.com, Python programmers make only $83,000 per year, while Perl programmers make $93,000 per year.

Re: Python not starting

2013-05-05 Thread Steven D'Aprano
On Sun, 05 May 2013 06:43:25 -0700, rama29065 wrote: I was using python from over an year and half.Suddenly from yesterday i'm unable to run it. Well, the obvious question is, what did you do yesterday to change your system? Did you install any new packages? Run a Windows update? Delete

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Steven D'Aprano
On Sun, 05 May 2013 12:11:11 -0500, Ignoramus16992 wrote: According to CIO.com, Python programmers make only $83,000 per year, while Perl programmers make $93,000 per year. http://www.cio.com/slideshow/detail/97819?source=ifwartcio#slide10

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Steven D'Aprano
On Sun, 05 May 2013 13:58:51 -0400, Roy Smith wrote: In article zrodnzu2u6sydxvmnz2dnuvz_v2dn...@giganews.com, Ignoramus16992 ignoramus16992@NOSPAM.16992.invalid wrote: According to CIO.com, Python programmers make only $83,000 per year, while Perl programmers make $93,000 per year.

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Jens Thoms Toerring
In comp.lang.python Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sun, 05 May 2013 12:11:11 -0500, Ignoramus16992 wrote: According to CIO.com, Python programmers make only $83,000 per year, while Perl programmers make $93,000 per year.

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Petite Abeille
On May 5, 2013, at 9:13 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sun, 05 May 2013 13:58:51 -0400, Roy Smith wrote: In article zrodnzu2u6sydxvmnz2dnuvz_v2dn...@giganews.com, Ignoramus16992 ignoramus16992@NOSPAM.16992.invalid wrote: According to CIO.com, Python

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Rainer Weikusat
j...@toerring.de (Jens Thoms Toerring) writes: In comp.lang.python Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sun, 05 May 2013 12:11:11 -0500, Ignoramus16992 wrote: According to CIO.com, Python programmers make only $83,000 per year, while Perl programmers make $93,000

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Roy Smith
In article 5186af75$0$29997$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Right now, I'd consider learning PHP for an extra $100 a month. Or peddling my arse down at the docks for twenty cents a time, which will be less embarrassing and

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Paul Rubin
Ignoramus16992 ignoramus16992@NOSPAM.16992.invalid writes: I would like to know, what explains the discrepancy. I see New York listed as a location for Perl but not for Python. That implies: 1) some general skew because of the very high cost of living in NY (even compared to San Francisco or

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Paul Rubin
Paul Rubin no.email@nospam.invalid writes: I see New York listed as a location for Perl but not for Python. Whaat? It's there for Python, though in the #3 position rather than #2. I must have flipped through the slides too fast. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Jens Thoms Toerring
In comp.lang.python Rainer Weikusat rweiku...@mssgmbh.com wrote: j...@toerring.de (Jens Thoms Toerring) writes: In comp.lang.python Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sun, 05 May 2013 12:11:11 -0500, Ignoramus16992 wrote: According to CIO.com, Python

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread 88888 Dihedral
Steven D'Aprano於 2013年5月6日星期一UTC+8上午3時10分47秒寫道: On Sun, 05 May 2013 12:11:11 -0500, Ignoramus16992 wrote: According to CIO.com, Python programmers make only $83,000 per year, while Perl programmers make $93,000 per year.

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Roy Smith
In article auo1hgfmri...@mid.uni-berlin.de, j...@toerring.de (Jens Thoms Toerring) wrote: Well, that didn't have a happy ending:-( Should have listened to my parents when they told me again and again Never use Perl, just say no!. Seems I'm doomed - what's the proper way to apply for a job

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Jens Thoms Toerring
In comp.lang.python Roy Smith r...@panix.com wrote: In article auo1hgfmri...@mid.uni-berlin.de, j...@toerring.de (Jens Thoms Toerring) wrote: Well, that didn't have a happy ending:-( Should have listened to my parents when they told me again and again Never use Perl, just say no!. Seems

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Roy Smith
In article mailman.1310.1367789840.3114.python-l...@python.org, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Sun, 05 May 2013 17:07:41 -0400, Roy Smith r...@panix.com declaimed the following in gmane.comp.python.general: In article 5186af75$0$29997$c3e8da3$54964...@news.astraweb.com,

Re: Python not starting

2013-05-05 Thread Andrew Berg
On 2013.05.05 13:55, Steven D'Aprano wrote: (you might need to use /S on Windows instead, I'm not sure.) That is only a convention among Microsoft's CLI utilities. Very few others follow it (even for programs written specifically for Windows), and it is certainly not a necessity on Windows. --

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Chris Angelico
On Mon, May 6, 2013 at 7:09 AM, Rainer Weikusat rweiku...@mssgmbh.com wrote: j...@toerring.de (Jens Thoms Toerring) writes: Now you got me badly worried, using both Perl and Python (and other, unspeakable languages, but not VB I promise!) Will I end up as a Python hacker for the mob or worse

Re: Python not starting

2013-05-05 Thread Chris Angelico
On Mon, May 6, 2013 at 4:15 AM, DRJ Reddy rama29...@gmail.com wrote: I did read and understood that while replying if is there we will get a blank line unnecessarily. If you read that page, you'll know that it does NOT advocate the total elimination of quoted text, which is what you've now

Re: Why do Perl programmers make more money than Python programmers

2013-05-05 Thread Ignoramus16992
On 2013-05-05, Paul Rubin no.email@nospam.invalid wrote: Paul Rubin no.email@nospam.invalid writes: I see New York listed as a location for Perl but not for Python. Whaat? It's there for Python, though in the #3 position rather than #2. I must have flipped through the slides too fast. My

(Learner-here) Lists + Functions = headache

2013-05-05 Thread Bradley Wright
Hey guys and gals doing this tutorial(codecademy) and needed a bit help from the experienced. I'm writing a function that takes a list(one they supply during runtime) here's what my function is supposed to do 1. for each instance of the string fizz make a count 2. Finally return that count

Re: (Learner-here) Lists + Functions = headache

2013-05-05 Thread alex23
On May 6, 10:59 am, Bradley Wright bradley.wright@gmail.com wrote: def fizz_cout(x):     count = 0     for item in x:         while item == fizz:             count += 1             return count Please remember that i am a eager beginner, where am i going wrong? There are several

Re: (Learner-here) Lists + Functions = headache

2013-05-05 Thread Bradley Wright
On Sunday, May 5, 2013 9:21:33 PM UTC-4, alex23 wrote: On May 6, 10:59 am, Bradley Wright bradley.wright@gmail.com wrote: def fizz_cout(x):     count = 0     for item in x:         while item == fizz:             count += 1             return count Please

Re: (Learner-here) Lists + Functions = headache

2013-05-05 Thread Terry Jan Reedy
On 5/5/2013 8:59 PM, Bradley Wright wrote: Hey guys and gals doing this tutorial(codecademy) and needed a bit help from the experienced. I'm writing a function that takes a list(one they supply during runtime) here's what my function is supposed to do Do they supply an example so you can

Re: (Learner-here) Lists + Functions = headache

2013-05-05 Thread Steven D'Aprano
On Sun, 05 May 2013 17:59:15 -0700, Bradley Wright wrote: Hey guys and gals doing this tutorial(codecademy) and needed a bit help from the experienced. I'm writing a function that takes a list(one they supply during runtime) here's what my function is supposed to do 1. for each instance

Re: (Learner-here) Lists + Functions = headache

2013-05-05 Thread Bradley Wright
On Sunday, May 5, 2013 9:24:44 PM UTC-4, Bradley Wright wrote: On Sunday, May 5, 2013 9:21:33 PM UTC-4, alex23 wrote: On May 6, 10:59 am, Bradley Wright bradley.wright@gmail.com wrote: def fizz_cout(x):     count = 0     for item in x:      

Re: (Learner-here) Lists + Functions = headache

2013-05-05 Thread Steven D'Aprano
On Mon, 06 May 2013 01:31:48 +, Steven D'Aprano wrote: So your function always returns either 0 (if there are no fizz in the list at all) or 1 (if there is any fizz). Correction: (thanks to Terry for pointing this out). It will return None or 1, not 0. How easy it is to fall into the

Re: Python not starting

2013-05-05 Thread drjreddy7
import nt print nt.__file__ I have done above ones as you stated. I'm getting an error Traceback (most recent call last): File stdin, line 1, in module AttributeError: 'module' object has no attribute '__file__' -- http://mail.python.org/mailman/listinfo/python-list

Re: How to avoid PEP8 'imported but unused'

2013-05-05 Thread Adam Jiang
Thank you. Problem solved. /Adam On Sun, May 05, 2013 at 06:27:44PM +0100, Fábio Santos wrote: That assert will never fail. If the symbol is not imported, the import statement raises ImportError. And actually assert makes sure that the value is not false-ish, not None/Null. And AFAIK a module

Re: Python not starting

2013-05-05 Thread drjreddy7
On Monday, May 6, 2013 3:59:01 AM UTC+5:30, Chris Angelico wrote: On Mon, May 6, 2013 at 4:15 AM, DRJ Reddy rama29...@gmail.com wrote: I did read and understood that while replying if is there we will get a blank line unnecessarily. If you read that page, you'll know that it does NOT

Re: Python not starting

2013-05-05 Thread Chris Angelico
On Mon, May 6, 2013 at 1:15 PM, drjred...@gmail.com wrote: On Monday, May 6, 2013 3:59:01 AM UTC+5:30, Chris Angelico wrote: On Mon, May 6, 2013 at 4:15 AM, DRJ Reddy rama29...@gmail.com wrote: I did read and understood that while replying if is there we will get a blank line unnecessarily.

Re: (Learner-here) Lists + Functions = headache

2013-05-05 Thread 88888 Dihedral
Bradley Wright於 2013年5月6日星期一UTC+8上午8時59分15秒寫道: Hey guys and gals doing this tutorial(codecademy) and needed a bit help from the experienced. I'm writing a function that takes a list(one they supply during runtime) here's what my function is supposed to do 1. for each instance

[issue17408] second python execution fails when embedding

2013-05-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: Should be fixed in 7de9852cdc0e, sorry. -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17408

[issue17809] FAIL: test_expanduser when $HOME ends with /

2013-05-05 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- assignee: - ezio.melotti stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17809 ___

[issue17894] Edits to descriptor howto

2013-05-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: in contrast to an authoritative document closely tied to the actually implementation details I fail to understand why a HOWTO should be an authoritative document closely tied to implementation details. If you don't want this document to be

[issue17809] FAIL: test_expanduser when $HOME ends with /

2013-05-05 Thread koobs
koobs added the comment: Thanks Antoine, I'm removing the 'Library' component on this one given the proposed resolution. Additionally, given the trivial nature and isolation of the change strictly to the test, I'd like to request this go into 3.2 as well. For any future security fixes to

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-05 Thread Charles-François Natali
Charles-François Natali added the comment: I'd slightly prefer the name iterdir_stat(), as that almost makes the (name, stat) return values explicit in the name. But that's kind of bikeshedding -- scandir() works too. I find iterdir_stat() ugly :-) I like the scandir name, which has some

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-05 Thread Ben Hoyt
Ben Hoyt added the comment: I find iterdir_stat() ugly :-) I like the scandir name, which has some precedent with POSIX. Fair enough. I'm cool with scandir(). scandir() cannot return (name, stat), because on POSIX, readdir() only returns d_name and d_type (the type of the entry): to

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-05 Thread Nick Coghlan
Nick Coghlan added the comment: I think os.scandir is a case where we *want* a low level call that exposes everything we can retrieve efficiently about the directory entries given the underlying platform - not everything written in Python is written to be portable, especially when it comes to

[issue1545463] New-style classes fail to cleanup attributes

2013-05-05 Thread Armin Rigo
Changes by Armin Rigo ar...@users.sourceforge.net: -- nosy: -arigo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1545463 ___ ___ Python-bugs-list

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-05 Thread Charles-François Natali
Charles-François Natali added the comment: We could document any platform-specific stuff, and places you'd users could get bitten. But can you give me an example of where the stat_result-with-st_mode-or-None approach falls over completely? Well, that's easy: size = 0 for name, st in

[issue17908] Unittest runner needs an option to call gc.collect() after each test

2013-05-05 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17908 ___ ___

[issue1545463] New-style classes fail to cleanup attributes

2013-05-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is an updated patch after the latest changes on default. -- Added file: http://bugs.python.org/file30129/gcshutdown2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1545463

[issue17908] Unittest runner needs an option to call gc.collect() after each test

2013-05-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: OTOH it's a useful option to have in case you're tracking down something that happens (or doesn't happen) when an object is collected IMO this is a good reason to implement your specific tearDown method (or call addCleanup if you prefer), possibly in a

[issue17906] JSON should accept lone surrogates

2013-05-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: After investigating the problem deeper, I see that new parameter is not needed. RFC 4627 does not make exceptions for the range 0xD800-0xDFFF, and the decoder must accept lone surrogates, both escaped and unescaped. Non-BMP characters may be represented as

[issue17906] JSON should accept lone surrogates

2013-05-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file30131/json_decode_lone_surrogates-2.7.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17906 ___

[issue995907] memory leak with threads and enhancement of the timer class

2013-05-05 Thread Yael
Yael added the comment: Can you please review the patch? thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue995907 ___ ___ Python-bugs-list

[issue17907] Deprecate imp.new_module() in favour of types.ModuleType

2013-05-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: If so, then at least the constructor should be documented. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17907 ___

[issue15902] imp.load_module won't accept None for the file argument for a C extension

2013-05-05 Thread Brett Cannon
Brett Cannon added the comment: http://hg.python.org/cpython/rev/996a937cdf81 also applies to this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15902 ___

[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2013-05-05 Thread Brett Cannon
Brett Cannon added the comment: Don't be distracted when trying to write tests is the lesson learned. Fixed basic and rebinding and just deleted indirect. -- Added file: http://bugs.python.org/file30132/import_from_tests.diff ___ Python tracker

[issue17909] Autodetecting JSON encoding

2013-05-05 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: RFC 4627 specifies a method to determine an encoding (one of UTF-8, UTF-16(BE|LE) or UTF-32(BE|LE)) of encoded JSON text. The proposed preliminary patch (it doesn't include the documentation yet) allows load() and loads() functions accept bytes data when

[issue17909] Autodetecting JSON encoding

2013-05-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- dependencies: +UTF-16 and UTF-32 codecs should reject (lone) surrogates, disallow the surrogatepass handler for non utf-* encodings ___ Python tracker rep...@bugs.python.org

[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-05-05 Thread STINNER Victor
STINNER Victor added the comment: I really like scandir() - (name: str, stat: stat structure using None for unknown fields). I expect that this API to optimize use cases like: - glob.glob(*.jpg) in a big directory with few JPEG picture - os.walk(.) in a directory with many files: should reduce

[issue12634] Random Remarks in class documentation

2013-05-05 Thread Yogesh Chaudhari
Yogesh Chaudhari added the comment: Similar changes for 2.7 branch -- hgrepos: +188 Added file: http://bugs.python.org/file30135/issue12634-27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12634

[issue12634] Random Remarks in class documentation

2013-05-05 Thread Yogesh Chaudhari
Yogesh Chaudhari added the comment: Based on Teery's comments, this patch makes the changes to the random remarks section of the class documentation -- keywords: +patch nosy: +Yogesh.Chaudhari Added file: http://bugs.python.org/file30134/issue12634.patch

[issue17732] distutils.cfg Can Break venv

2013-05-05 Thread Nick Sloan
Nick Sloan added the comment: Just checking to see if anything else is needed from me on this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17732 ___

[issue17798] IDLE: can not edit new file names when using -e

2013-05-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset c8cdc2400643 by Roger Serwy in branch '3.3': #17798: Allow IDLE to edit new files when specified on command line. http://hg.python.org/cpython/rev/c8cdc2400643 New changeset a64a3da996ed by Roger Serwy in branch 'default': #17798: merge with 3.3.

[issue17798] IDLE: can not edit new file names when using -e

2013-05-05 Thread Roger Serwy
Roger Serwy added the comment: I'm closing this issue as fixed. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17798

[issue17903] Python launcher for windows should search path for #!/usr/bin/env

2013-05-05 Thread Paul Moore
Paul Moore added the comment: There is a patch for this (against the standalone pylauncher project) at https://bitbucket.org/pmoore/pylauncher. -- keywords: +patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17903

[issue17858] Different documentation for identical methods

2013-05-05 Thread Andriy Mysyk
Andriy Mysyk added the comment: Made changes suggested by Ezio Melotti in the attached patch. -- Added file: http://bugs.python.org/file30136/issue17858.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17858

[issue17908] Unittest runner needs an option to call gc.collect() after each test

2013-05-05 Thread Guido van Rossum
Guido van Rossum added the comment: On Sun, May 5, 2013 at 4:29 AM, Antoine Pitrou rep...@bugs.python.org wrote: Antoine Pitrou added the comment: OTOH it's a useful option to have in case you're tracking down something that happens (or doesn't happen) when an object is collected IMO this

[issue17094] sys._current_frames() reports too many/wrong stack frames

2013-05-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is an updated patch which doesn't hold the lock while calling PyThreadState_Clear(). It looks like it should be ok. Also, I've added some comments. -- Added file: http://bugs.python.org/file30137/tstates-afterfork2.patch

[issue16518] add buffer protocol to glossary

2013-05-05 Thread Ezio Melotti
Ezio Melotti added the comment: Updated patch to include getargs.c too. -- stage: patch review - commit review Added file: http://bugs.python.org/file30138/issue16518-4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16518

[issue9682] socket.create_connection error message for domain subpart with invalid length is very confusing

2013-05-05 Thread Mike Milkin
Mike Milkin added the comment: Moved the conditional logic out of the method. There are no tests for ToASCII function and I was not comfortable making changes to it without adding tests. -- Added file: http://bugs.python.org/file30139/Issue9682-5513.patch

[issue15528] Better support for finalization with weakrefs

2013-05-05 Thread Richard Oudkerk
Richard Oudkerk added the comment: Here is an updated patch. It is only really the example in the docs which is different, plus a note about daemon threads. Antoine, do think this is ready to be committed? -- Added file: http://bugs.python.org/file30140/finalize.patch

[issue17883] Fix buildbot testing of Tkinter

2013-05-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3c58fa7dc7f1 by Ezio Melotti in branch '2.7': #17883: Fix buildbot testing of Tkinter on Windows. Patch by Zachary Ware. http://hg.python.org/cpython/rev/3c58fa7dc7f1 -- nosy: +python-dev ___ Python

  1   2   >