To make a method or attribute private

2013-01-20 Thread iMath
To make a method or attribute private (inaccessible from the outside), simply start its name with two underscores 《Beginning Python From Novice to Professional》 but there is another saying goes: Beginning a variable name with a single underscore indicates that the variable should be

Re: To make a method or attribute private

2013-01-20 Thread Chris Angelico
On Sun, Jan 20, 2013 at 8:17 PM, iMath redstone-c...@163.com wrote: so what is your opinion about single leading underscore and private methods or attributes? Didn't this get discussed recently? http://mail.python.org/pipermail/python-list/2013-January/638687.html ChrisA --

Re: Parent module adsite.adsiteviews.mainhanlder does not exist

2013-01-20 Thread Jason Friedman
I created a django project using django 1.4.2. There is one 'app'(adsite) in this project. And It works. But when I copied some 'py' files into the 'app' folder, I got Parent module adsite.adsiteviews.mainhanlder does not exist. Should I register the new files to __init__ in the 'app'? Did

Re: To make a method or attribute private

2013-01-20 Thread iMath
在 2013年1月17日星期四UTC+8上午9时04分00秒,alex23写道: On Jan 17, 10:34 am, iMath 2281570...@qq.com wrote: To make a method or attribute private (inaccessible from the outside), simply start its name with two underscores but there is another saying goes: Beginning a variable name with a

Re: To make a method or attribute private

2013-01-20 Thread Steven D'Aprano
On Sun, 20 Jan 2013 06:52:32 -0800, iMath wrote: [snip many dozens of lines of irrelevant text] what's the meaning of 'object' in class A(object) and class B(object) ? Please trim your replies. We don't need to scroll past page after page of irrelevant text which we have already read.

Re: PyWart: Exception error paths far too verbose

2013-01-20 Thread Terry Reedy
On 1/20/2013 1:08 AM, Steven D'Aprano wrote: On Sat, 19 Jan 2013 19:15:55 -0800, Ramchandra Apte wrote: [snip dozens of irrelevant quoted lines] Right-click the file in the traceback and there is an Go to file/line option. Please trim your replies so that the reader doesn't have to scroll

Re: ANN: Python training text movies

2013-01-20 Thread Franck Ditter
In article mailman.696.1358622153.2939.python-l...@python.org, Mitya Sirenef msire...@lightbird.net wrote: On 01/19/2013 04:32 AM, Franck Ditter wrote: In article mailman.488.1358146579.2939.python-l...@python.org, Mitya Sirenef msire...@lightbird.net wrote: On 01/14/2013 01:34 AM,

Re: ANN: Python training text movies

2013-01-20 Thread Franck Ditter
In article nobody-b6cd7f.18373820012...@news.free.fr, Franck Ditter nob...@nowhere.org wrote: In article mailman.696.1358622153.2939.python-l...@python.org, Mitya Sirenef msire...@lightbird.net wrote: On 01/19/2013 04:32 AM, Franck Ditter wrote: In article

Re: ANN: Python training text movies

2013-01-20 Thread Franck Ditter
In article nobody-a71b2d.18413120012...@news.free.fr, Franck Ditter nob...@nowhere.org wrote: In article nobody-b6cd7f.18373820012...@news.free.fr, Franck Ditter nob...@nowhere.org wrote: In article mailman.696.1358622153.2939.python-l...@python.org, Mitya Sirenef

Re: ANN: Python training text movies

2013-01-20 Thread Mitya Sirenef
On 01/20/2013 12:54 PM, Franck Ditter wrote: In article nobody-a71b2d.18413120012...@news.free.fr, Franck Ditter nob...@nowhere.org wrote: In article nobody-b6cd7f.18373820012...@news.free.fr, Franck Ditter nob...@nowhere.org wrote: In article

Re: Messing with the GC

2013-01-20 Thread Jens Thoms Toerring
Hi, thank you for the explanations. I had overlooked the cyclic nature of what I had produced here and, of course, the GC can't be blamed for not collecting objects that are part of a cycle. The other question about the last refe- rence to an object vanishing within a method call (which, as

RE Help splitting CVS data

2013-01-20 Thread Garry
I'm trying to manipulate family tree data using Python. I'm using linux and Python 2.7.3 and have data files saved as Linux formatted cvs files The data appears in this format: Marriage,Husband,Wife,Date,Place,Source,Note0x0a Note: the Source field or the Note field can contain quoted data (same

Re: RE Help splitting CVS data

2013-01-20 Thread Mitya Sirenef
On 01/20/2013 05:04 PM, Garry wrote: I'm trying to manipulate family tree data using Python. I'm using linux and Python 2.7.3 and have data files saved as Linux formatted cvs files The data appears in this format: Marriage,Husband,Wife,Date,Place,Source,Note0x0a Note: the Source field or the

Re: Messing with the GC

2013-01-20 Thread Terry Reedy
On 1/20/2013 3:09 PM, Jens Thoms Toerring wrote: thank you for the explanations. I had overlooked the cyclic nature of what I had produced here and, of course, the GC can't be blamed for not collecting objects that are part of a cycle. The other question about the last refe- rence to an

Re: RE Help splitting CVS data

2013-01-20 Thread Terry Reedy
On 1/20/2013 5:04 PM, Garry wrote: I'm trying to manipulate family tree data using Python. I'm using linux and Python 2.7.3 and have data files saved as Linux formatted cvs files ... I'm stuck, comments and solutions greatly appreciated. Why are you not using the cvs module? -- Terry Jan

Re: Help splitting CVS data

2013-01-20 Thread Dave Angel
On 01/20/2013 05:04 PM, Garry wrote: I'm trying to manipulate family tree data using Python. I'm using linux and Python 2.7.3 and have data files saved as Linux formatted cvs files The data appears in this format: Marriage,Husband,Wife,Date,Place,Source,Note0x0a Note: the Source field or the

Re: To make a method or attribute private

2013-01-20 Thread alex23
On Jan 20, 7:23 pm, Chris Angelico ros...@gmail.com wrote: On Sun, Jan 20, 2013 at 8:17 PM, iMath redstone-c...@163.com wrote: so what is your opinion about single leading underscore and private methods or attributes? Didn't this get discussed recently?

Re: To make a method or attribute private

2013-01-20 Thread Dave Angel
On 01/20/2013 06:14 PM, alex23 wrote: On Jan 20, 7:23 pm, Chris Angelico ros...@gmail.com wrote: On Sun, Jan 20, 2013 at 8:17 PM, iMath redstone-c...@163.com wrote: so what is your opinion about single leading underscore and private methods or attributes? Didn't this get discussed recently?

Re: RE Help splitting CVS data

2013-01-20 Thread Tim Chase
On 01/20/13 16:16, Terry Reedy wrote: On 1/20/2013 5:04 PM, Garry wrote: I'm trying to manipulate family tree data using Python. I'm using linux and Python 2.7.3 and have data files saved as Linux formatted cvs files ... I'm stuck, comments and solutions greatly appreciated. Why are you

Re: ANN: Python training text movies

2013-01-20 Thread Steven D'Aprano
On Sun, 20 Jan 2013 18:54:03 +0100, Franck Ditter wrote: [snip quoting NINE levels deep] When executing jstmovie.py, it complains : 'template.html' not found in tmovies... Please trim unnecessary quoted text out of your replies. We don't need to read page after page of irrelevant comments

Re: RE Help splitting CVS data

2013-01-20 Thread Garry
On Sunday, January 20, 2013 3:04:39 PM UTC-7, Garry wrote: I'm trying to manipulate family tree data using Python. I'm using linux and Python 2.7.3 and have data files saved as Linux formatted cvs files The data appears in this format:

Re: How do functions get access to builtins?

2013-01-20 Thread Rouslan Korneychuk
On 01/19/2013 09:59 PM, Steven D'Aprano wrote: I've been playing around with ChainedMap in Python 3.3, and run into something which perplexes me. Let's start with an ordinary function that accesses one global and one builtin. x = 42 def f(): print(x) If you call f(), it works as

Re: Messing with the GC

2013-01-20 Thread Jens Thoms Toerring
Terry Reedy tjre...@udel.edu wrote: On 1/20/2013 3:09 PM, Jens Thoms Toerring wrote: thank you for the explanations. I had overlooked the cyclic nature of what I had produced here and, of course, the GC can't be blamed for not collecting objects that are part of a cycle. The other

Re: To make a method or attribute private

2013-01-20 Thread iMath
在 2013年1月17日星期四UTC+8上午8时34分22秒,iMath写道: To make a method or attribute private (inaccessible from the outside), simply start its  name with two underscores 《Beginning Python From Novice to Professional》 but there is another saying goes: Beginning a variable name with a single

Re: To make a method or attribute private

2013-01-20 Thread Chris Angelico
On Mon, Jan 21, 2013 at 12:14 PM, iMath redstone-c...@163.com wrote: so there is no REAL private variable in Python but conversion exists in it that python programmer should follow and recognize .right ? That's about it. If you think about C++ public members as the interface and

Re: RE Help splitting CVS data

2013-01-20 Thread Chris Angelico
On Mon, Jan 21, 2013 at 11:41 AM, Garry ggkrae...@gmail.com wrote: Thanks everyone for your comments. I'm new to Python, but can get around in Perl and regular expressions. I sure was taking the long way trying to get the cvs data parsed. As has been hinted by Tim, you're actually talking

Re: To make a method or attribute private

2013-01-20 Thread alex23
On Jan 21, 9:32 am, Dave Angel d...@davea.name wrote: On 01/20/2013 06:14 PM, alex23 wrote: On Jan 20, 7:23 pm, Chris Angelico ros...@gmail.com wrote: On Sun, Jan 20, 2013 at 8:17 PM, iMath redstone-c...@163.com wrote: so what is your opinion about single leading underscore and private

Re: To make a method or attribute private

2013-01-20 Thread Mitya Sirenef
On 01/20/2013 09:24 PM, alex23 wrote: On Jan 21, 9:32 am, Dave Angel d...@davea.name wrote: On 01/20/2013 06:14 PM, alex23 wrote: On Jan 20, 7:23 pm, Chris Angelico ros...@gmail.com wrote: On Sun, Jan 20, 2013 at 8:17 PM, iMath redstone-c...@163.com wrote: so what is your opinion about

Re: To make a method or attribute private

2013-01-20 Thread Steven D'Aprano
On Sun, 20 Jan 2013 17:14:36 -0800, iMath wrote: [...] so there is no REAL private variable in Python but conversion exists in it that python programmer should follow and recognize .right ? There are no REAL private variables in most languages. Consider the C++ trick #define private public.

Else statement executing when it shouldnt

2013-01-20 Thread eli m
an else statement is running when it shouldnt be. It is on the last line. Whenever i am in the math or game function, when i type in main, it goes back to the start of the program, but it also says not a valid function. I am stumped! Here is my code: #Cmd #Created By Eli M. #import modules

Re: To make a method or attribute private

2013-01-20 Thread Chris Angelico
On Mon, Jan 21, 2013 at 2:27 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sun, 20 Jan 2013 17:14:36 -0800, iMath wrote: [...] so there is no REAL private variable in Python but conversion exists in it that python programmer should follow and recognize .right ? There

Re: Else statement executing when it shouldnt

2013-01-20 Thread Roy Smith
In article 2cc6791f-ba56-406c-a5b0-b23023caf...@googlegroups.com, eli m techgeek...@gmail.com wrote: an else statement is running when it shouldnt be. It is on the last line. Whenever i am in the math or game function, when i type in main, it goes back to the start of the program, but it

Re: Else statement executing when it shouldnt

2013-01-20 Thread Chris Angelico
On Mon, Jan 21, 2013 at 3:40 PM, eli m techgeek...@gmail.com wrote: an else statement is running when it shouldnt be. It is on the last line. Whenever i am in the math or game function, when i type in main, it goes back to the start of the program, but it also says not a valid function. I am

Re: Else statement executing when it shouldnt

2013-01-20 Thread eli m
On Sunday, January 20, 2013 8:54:13 PM UTC-8, René Klačan wrote: You have to break while loop not to execute else branch Rene Can you explain in more detail please. -- http://mail.python.org/mailman/listinfo/python-list

Re: Else statement executing when it shouldnt

2013-01-20 Thread René Klačan
You have to break while loop not to execute else branch Rene On Mon, Jan 21, 2013 at 5:40 AM, eli m techgeek...@gmail.com wrote: an else statement is running when it shouldnt be. It is on the last line. Whenever i am in the math or game function, when i type in main, it goes back to the

Re: Else statement executing when it shouldnt

2013-01-20 Thread eli m
Your else is lined up with while, not with if. -m -- Lark's Tongue Guide to Python: http://lightbird.net/larks/ When a friend succeeds, I die a little. Gore Vidal Its lined up. It got messed up when i copied the code into the post. --

Re: Else statement executing when it shouldnt

2013-01-20 Thread eli m
On Sunday, January 20, 2013 8:40:47 PM UTC-8, eli m wrote: hint: Use the comments in the code to find out where my error is. Here is my code: #Cmd #Created By Eli M. #import modules import random import math gtn = 0 print (Type in help for a list of cmd functions)

Re: Else statement executing when it shouldnt

2013-01-20 Thread eli m
On Sunday, January 20, 2013 8:52:12 PM UTC-8, Chris Angelico wrote: On Mon, Jan 21, 2013 at 3:40 PM, eli m techgeek...@gmail.com wrote: an else statement is running when it shouldnt be. It is on the last line. Whenever i am in the math or game function, when i type in main, it goes back

Re: Else statement executing when it shouldnt

2013-01-20 Thread Mitya Sirenef
On 01/20/2013 11:40 PM, eli m wrote: an else statement is running when it shouldnt be. It is on the last line. Whenever i am in the math or game function, when i type in main, it goes back to the start of the program, but it also says not a valid function. I am stumped! Here is my code:

Re: Else statement executing when it shouldnt

2013-01-20 Thread René Klačan
Examples: # else branch will be executed i = 0 while i 5: i += 1 else: print('loop is over') # else branch will be executed i = 0 while i 5: i += 1 if i == 7: print('i == 7') break else: print('loop is over') # else branch wont be executed i = 0 while i

Re: Else statement executing when it shouldnt

2013-01-20 Thread René Klačan
Examples: # else branch will be executed i = 0 while i 5: i += 1 else: print('loop is over') # else branch will be executed i = 0 while i 5: i += 1 if i == 7: print('i == 7') break else: print('loop is over') # else branch wont be executed i = 0 while i

Re: To make a method or attribute private

2013-01-20 Thread alex23
On Jan 21, 2:46 pm, Chris Angelico ros...@gmail.com wrote: These aren't proofs that something doesn't exist, they're proofs that trying to enforce privacy is bound to fail But if you can't enforce it, can you really say it exists? Semantics, they are fun! I feel another PyWart post coming

Re: Else statement executing when it shouldnt

2013-01-20 Thread alex23
On Jan 21, 2:59 pm, eli m techgeek...@gmail.com wrote: Its lined up. It got messed up when i copied the code into the post. Sorry, we're not going to take your word for it. Reduce it to the minimal amount of code that reproduces your error and post that. --

Re: Else statement executing when it shouldnt

2013-01-20 Thread alex23
On Jan 21, 2:40 pm, eli m techgeek...@gmail.com wrote: an else statement is running when it shouldnt be. It is on the last line. Whenever i am in the math or game function, when i type in main, it goes back to the start of the program, but it also says not a valid function. I am stumped!

Re: Else statement executing when it shouldnt

2013-01-20 Thread alex23
On Jan 21, 2:54 pm, eli m techgeek...@gmail.com wrote: hint: Use the comments in the code to find out where my error is. Pro-tip: when people you're asking for help tell you how you can make it easier for them to help you, a snide response isn't the correct approach. --

Re: Else statement executing when it shouldnt

2013-01-20 Thread Mitya Sirenef
On 01/20/2013 11:59 PM, eli m wrote: Your else is lined up with while, not with if. -m -- Lark's Tongue Guide to Python: http://lightbird.net/larks/ When a friend succeeds, I die a little. Gore Vidal Its lined up. It got messed up when i copied the code into the post. I

Re: Forcing Python to detect DocumentRoot

2013-01-20 Thread Ferrous Cranus
Τη Σάββατο, 19 Ιανουαρίου 2013 10:01:15 μ.μ. UTC+2, ο χρήστης Piet van Oostrum έγραψε: Ferrous Cranus nikos.gr...@gmail.com writes: This is addon domain's counter.py snippet tried to load an image mail.png and failed because it cant see past its document root

Re: Uniquely identifying each every html template

2013-01-20 Thread Ferrous Cranus
Τη Σάββατο, 19 Ιανουαρίου 2013 11:32:41 μ.μ. UTC+2, ο χρήστης Dennis Lee Bieber έγραψε: On Sat, 19 Jan 2013 00:39:44 -0800 (PST), Ferrous Cranus nikos.gr...@gmail.com declaimed the following in gmane.comp.python.general: We need to find a way so even IF: (filepath gets

Re: Uniquely identifying each every html template

2013-01-20 Thread Ferrous Cranus
Τη Σάββατο, 19 Ιανουαρίου 2013 11:00:15 π.μ. UTC+2, ο χρήστης Dave Angel έγραψε: On 01/19/2013 03:39 AM, Ferrous Cranus wrote: Τη Σάββατο, 19 Ιανουαρίου 2013 12:09:28 π.μ. UTC+2, ο χρήστης Dave Angel έγραψε: I don't understand the problem. A trivial Python script could scan

Re: Uniquely identifying each every html template

2013-01-20 Thread Chris Angelico
On Mon, Jan 21, 2013 at 6:08 PM, Ferrous Cranus nikos.gr...@gmail.com wrote: An .html page must retain its database counter value even if its: (renamed moved contents altered) Then you either need to tag them in some external way, or have some kind of tracking operation - for instance, if

Re: ANN: Python training text movies

2013-01-20 Thread rusi
On Jan 13, 12:08 pm, Mitya Sirenef msire...@lightbird.net wrote: Sure: they play back a list of instructions on use of string methods and list comprehensions along with demonstration in a mock-up of the interpreter with a different display effect for commands typed into (and printed out by)

[issue16998] Lost updates with multiprocessing.Value

2013-01-20 Thread Jens Lechtenboerger
Jens Lechtenboerger added the comment: Loads and stores are both atomic. But += is made up of two operations, a load followed by a store, and the lock is dropped between the two. I see. Then this is a documentation bug. The examples in the documentation use such non-thread-safe

[issue4153] Unicode HOWTO up to date?

2013-01-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 260a9afd999a by Ezio Melotti in branch '3.2': #4153: update the Unicode howto. http://hg.python.org/cpython/rev/260a9afd999a New changeset 572ca3d35c2f by Ezio Melotti in branch '3.3': #4153: merge with 3.2.

[issue4153] Unicode HOWTO up to date?

2013-01-20 Thread Ezio Melotti
Ezio Melotti added the comment: I committed the attached patch with some minor modifications, but there are still comments that should be addressed on Rietveld. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4153

[issue17002] html.entities ImportError in distutils2/pypi/simple.py on Python2.7

2013-01-20 Thread Cillian de Róiste
New submission from Cillian de Róiste: I guess it should be wrapped in a try, except: try: from html.entities import name2codepoint except ImportError: from htmlentitydefs import name2codepoint This works locally Here's a sample traceback: Traceback (most recent call last): File

[issue16998] Lost updates with multiprocessing.Value

2013-01-20 Thread Richard Oudkerk
Richard Oudkerk added the comment: I see. Then this is a documentation bug. The examples in the documentation use such non-thread-safe assignments (combined with the statement These shared objects will be process and thread safe.). Are you talking about this documentation: If lock is

[issue17002] html.entities ImportError in distutils2/pypi/simple.py on Python2.7

2013-01-20 Thread Ezio Melotti
Ezio Melotti added the comment: htmlentitydefs was renamed to html.entities in Python 3. If this is supposed to run with Python 2 it should use the former, otherwise the latter (unless it has the same codebase on both). -- nosy: +ezio.melotti type: crash - behavior

[issue1159051] Handle corrupted gzip files with unexpected EOF

2013-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is an updated patch addressing Nadeem Vawda's comments. Thank you. -- Added file: http://bugs.python.org/file28795/gzip_eof-3.4_2.patch ___ Python tracker rep...@bugs.python.org

[issue1159051] Handle corrupted gzip files with unexpected EOF

2013-01-20 Thread Nadeem Vawda
Nadeem Vawda added the comment: The updated patch looks good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1159051 ___ ___

[issue16997] subtests

2013-01-20 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16997 ___

[issue13598] string.Formatter doesn't support empty curly braces {}

2013-01-20 Thread Vinay Sajip
Vinay Sajip added the comment: Looking at Phil Elson's patch: I didn't see a test case relating to the example in his comment, namely f.format({0:{}}, 'foo', 5) Did I miss it? The documentation also needs to be updated. -- ___ Python tracker

[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-20 Thread Ramchandra Apte
Changes by Ramchandra Apte maniandra...@gmail.com: Removed file: http://bugs.python.org/file28794/issue-v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17001 ___

[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-20 Thread Ramchandra Apte
Ramchandra Apte added the comment: Oh darn, I included another bugs changes in it. I unlinked the v2 patch and have attached issue17001-v2.patch -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17001

[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Except for mistakenly included functional.rst changes, the patch looks good for me. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17001

[issue16557] PEP 380 isn't reflected in the Functional Programming HOWTO

2013-01-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset e0de6e6e992e by Ezio Melotti in branch '3.3': #16557: update functional howto -- return value is valid after PEP 380. Initial patch by Ramchandra Apte. http://hg.python.org/cpython/rev/e0de6e6e992e New changeset 81b2a30da853 by Ezio Melotti in

[issue16557] PEP 380 isn't reflected in the Functional Programming HOWTO

2013-01-20 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks for the report and the patch! -- assignee: docs@python - ezio.melotti nosy: +ezio.melotti resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker

[issue16042] smtplib: unlimited readline() from connection

2013-01-20 Thread Christian Heimes
Christian Heimes added the comment: Yes, I'm going to work on this issue for 2.7 and 3.3. -- assignee: - christian.heimes priority: normal - critical stage: - needs patch versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org

[issue16041] poplib: unlimited readline() from connection

2013-01-20 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: -- assignee: - christian.heimes priority: normal - critical stage: - needs patch versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16041

[issue16040] nntplib: unlimited readline() from connection

2013-01-20 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: -- assignee: - christian.heimes priority: normal - critical versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16040 ___

[issue16039] imaplib: unlimited readline() from connection

2013-01-20 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: -- assignee: - christian.heimes priority: normal - critical stage: - needs patch versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org

[issue16038] ftplib: unlimited readline() from connection

2013-01-20 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: -- assignee: - christian.heimes priority: normal - critical stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16038 ___

[issue16037] httplib: header parsing is not delimited

2013-01-20 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: -- assignee: - christian.heimes priority: normal - critical stage: - needs patch versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16037

[issue16043] xmlrpc: gzip_decode has unlimited read()

2013-01-20 Thread Christian Heimes
Christian Heimes added the comment: The attached patch adds a limitation to xmlrpclib.gzip_decode(). -- assignee: - christian.heimes dependencies: -gzip, bz2, lzma: add option to limit output size keywords: +patch priority: normal - critical stage: - patch review versions: +Python

[issue1470548] Bugfix for #1470540 (XMLGenerator cannot output UTF-16)

2013-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Patch updated. Now I get rid of __del__ to prevent hanging on reference cicles as Antoine suggested on IRC. Added test for check that XMLGenerator doesn't close the file passed as argument. -- Added file:

[issue17003] Unification of read() and readline() argument names

2013-01-20 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: read() and readline() optional parameter which limit the amount of read data has different names in different classes. All this classes mimic (less or more) io classes. Keyword parameter name is a part of method specification. Therefore it will be good

[issue7353] cporting docs recommend using Include/intobject.h, which was removed in 3.1?

2013-01-20 Thread Christian Heimes
Christian Heimes added the comment: Go ahead! The intobject header file used to make porting to Python 3 easier. Nowadays it's no longer required. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7353

[issue17003] Unification of read() and readline() argument names

2013-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Looks as size is most common parameter name for both read() and readline(). First, we can change the io documentation and _pyio signatures (it shouldn't break anything because _io doesn't support keyword arguments). --

[issue16273] f.tell() returning negative number on Windows build

2013-01-20 Thread Catalin Iacob
Catalin Iacob added the comment: Could it be that Raymond's file had Unix line endings? I tried to reproduce this, picked a file on my disk and indeed I got a negative number, but that file has Unix line endings. This is documented at http://docs.python.org/2/library/stdtypes.html#file.tell

[issue17003] Unification of read() and readline() argument names

2013-01-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: n is the best choice IMO. size is ok too, although it may be confused with the byte-size of the result. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17003

[issue17003] Unification of read() and readline() argument names

2013-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which changes name of optional parameter of read(), read1(), peek(), and readline() methods to most common name size in the documentation and _pyio module. truncate() in _pyio fixed to conform with documentation. This changes are safe.

[issue17003] Unification of read() and readline() argument names

2013-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: n is the best choice IMO. Unfortunately most stdlib modules vote for size. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17003 ___

[issue15881] multiprocessing 'NoneType' object is not callable

2013-01-20 Thread Tres Seaver
Tres Seaver added the comment: I can reproduce the bug against the 2.7 tip. Reviewing the 2.7 patch: - The 2.7 tip has 'Misc/ACKS' instead of 'Doc/ACKS.txt'. - In 'Misc/ACKS', the line adding 'Chris McDonough' should add it in alpha order. - The remainder of the patch looks correct, and

[issue16042] smtplib: unlimited readline() from connection

2013-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: mock_socket violates readline() contract. It can return more than size bytes, and this can break SMTP.readline(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16042

[issue17004] Expand zipimport to include other compression methods

2013-01-20 Thread Raymond Hettinger
New submission from Raymond Hettinger: Only a little of the existing logic is tied to the zipfile format. Consider adding support for xz, tar, tar.gz, tar.bz2, etc. In particular, xz has better compression, resulting in both space savings and faster load times. -- messages: 180307

[issue17004] Expand zipimport to include other compression methods

2013-01-20 Thread Brian Curtin
Changes by Brian Curtin br...@python.org: -- components: +Library (Lib) nosy: +brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17004 ___

[issue17002] html.entities ImportError in distutils2/pypi/simple.py on Python2.7

2013-01-20 Thread Éric Araujo
Éric Araujo added the comment: Good call. All function-level imports are avoided in d2 unless absolutely necessary, and this one slipped through the cracks. distutils2 went from Python 2 to 3 to 2 and 3 again, so these things happen (and it’s one of the reasons why I’ve always insisted on

[issue8745] zipimport is a bit slow

2013-01-20 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8745 ___ ___

[issue16507] Patch selectmodule.c to support WSAPoll on Windows

2013-01-20 Thread Guido van Rossum
Guido van Rossum added the comment: Oh, it needs a new patch -- the patch fails to apply in the 3.4 (default) branch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16507 ___

[issue17004] Expand zipimport to include other compression methods

2013-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: tar.* is not a good choice because it doesn't allow random access. Bare tar better than zip only in case when you need to save additional file attributes (Unix file access mode, times, owner, group, links). ZIP format supports all this too, but not zipfile

[issue17004] Expand zipimport to include other compression methods

2013-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here are some tests. time 7z a -tzip -mx=0 python-0.zip $(find Lib -type f -name '*.py') /dev/null time 7z a -tzip python.zip $(find Lib -type f -name '*.py') /dev/null time 7z a -tzip -mx=9 python-9.zip $(find Lib -type f -name '*.py') /dev/null time 7z a

[issue8745] zipimport is a bit slow

2013-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, Brian. Raymond is an initiator of issue17004. -- nosy: +rhettinger -brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8745 ___

[issue13405] Add DTrace probes

2013-01-20 Thread Trent Nelson
Changes by Trent Nelson tr...@snakebite.org: -- nosy: +trent ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___ ___ Python-bugs-list mailing

[issue17004] Expand zipimport to include other compression methods

2013-01-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here are some tests. I think you want to put pyc files in the zip file as well. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17004 ___

[issue17004] Expand zipimport to include other compression methods

2013-01-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: xz will likely be the best win -- it is purported to compress smaller than bz2 while retaining the decompression speed of zip. As Antoine says, the usual practice is to add py, pyc, and pyo files to the compressed library; otherwise, there is an added cost

[issue16507] Patch selectmodule.c to support WSAPoll on Windows

2013-01-20 Thread Guido van Rossum
Guido van Rossum added the comment: Here's a new version of the patch. (Will test on Windows next.) -- Added file: http://bugs.python.org/file28799/runtime_wsapoll.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16507

[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: I recommend against this patch. The code generated by functools.total_ordering is less efficient than the existing code and it doesn't handle the NotImplemented logic very well. total_ordering() is a shortcut, not a best practice. -- nosy:

[issue16507] Patch selectmodule.c to support WSAPoll on Windows

2013-01-20 Thread Guido van Rossum
Guido van Rossum added the comment: That compiles (after hacking the line endings). One Tulip test fails, PollEventLooptests.testSockClientFail. But that's probably because the PollSelector class hasn't been adjusted for Windows yet (need to dig this out of the Pollster code that was

[issue16507] Patch selectmodule.c to support WSAPoll on Windows

2013-01-20 Thread Guido van Rossum
Guido van Rossum added the comment: That compiles (after hacking the line endings). One Tulip test fails, PollEventLooptests.testSockClientFail. But that's probably because the PollSelector class hasn't been adjusted for Windows yet (need to dig this out of the Pollster code that was

[issue17005] Add a topological sort algorithm

2013-01-20 Thread Raymond Hettinger
New submission from Raymond Hettinger: I suggest adding a topological sort algorithm to the standard library. In addition to being a fundamental algorithm, it is immediately useful in demonstrating how the MRO computation works and for pure Python implementations of MRO logic. IIRC, the

[issue15050] Python 3.2.3 fail to make

2013-01-20 Thread Ezio Melotti
Ezio Melotti added the comment: I'm going to close this as out of date. Feel free to reopen if it turns out that this is indeed a Python issue. -- nosy: +ezio.melotti resolution: - out of date stage: - committed/rejected status: open - closed ___

  1   2   >