[issue9800] Fast path for small int-indexing of lists and tuples

2010-10-04 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: A disadvantage of the patch is that ceval.c needs to know about the internal implementation of a PyLong. At the moment, this information is encapsulated only in Objects/longobject.c and a couple of other places (I think marshal.c).

[issue10016] shutil.copyfile -- allow sparse copying

2010-10-04 Thread Tarek Ziadé
Changes by Tarek Ziadé ziade.ta...@gmail.com: -- assignee: - tarek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10016 ___ ___ Python-bugs-list

[issue10016] shutil.copyfile -- allow sparse copying

2010-10-04 Thread Tom Potts
Tom Potts karake...@gmail.com added the comment: @pitrou Hmm... the online docs and the contents of the doc directory on the trunk branch say differently: Resize the stream to the given *size* in bytes (or the current position if *size* is not specified). The current stream position isn't

[issue9873] urllib.parse: Allow bytes in some APIs that use string literals internally

2010-10-04 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Yeah, I'll have to time it to see how much difference latin-1 vs surrogateescape makes when the MSB is set in any bytes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9873

[issue10016] shutil.copyfile -- allow sparse copying

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Ok, after experimenting, I now understand what the truncate() call is for. However, your heuristic for detecting sparse files is wrong. The unit for st_blocks is undefined as per the POSIX standard, although it gives recommendations: “The unit

[issue4775] Incorrect documentation - UTC time

2010-10-04 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: Based on the discussion so far, I am going to close this as invalid. -- assignee: georg.brandl - belopolsky resolution: - invalid status: open - pending ___ Python tracker

[issue7789] Issue using datetime with format()

2010-10-04 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: The original bug report is invalid and the documentation issue is a duplicate of #8913. -- nosy: +belopolsky resolution: - duplicate superseder: - Document that datetime.__format__ is datetime.strftime

[issue7789] Issue using datetime with format()

2010-10-04 Thread Alexander Belopolsky
Changes by Alexander Belopolsky belopol...@users.sourceforge.net: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7789 ___

[issue10016] shutil.copyfile -- allow sparse copying

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: By the way: Thanks for your comments -- I'm trying to put together some unit tests and documentation, against the Subversion trunk. Please ignore trunk; all development (new features) should be done against branches/py3k. --

[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Hello, I added some extra verification to Mercurial (http://www.selenic.com/hg/rev/f2937d6492c5). Feel free to use the following under the Python license in Python or elsewhere. It could be a separate method/function or it could integrated in

[issue9725] urllib.request.FancyURLopener won't connect to pages requiring username and password

2010-10-04 Thread Senthil Kumaran
Changes by Senthil Kumaran orsent...@gmail.com: -- assignee: - orsenthil nosy: +orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9725 ___

[issue9800] Fast path for small int-indexing of lists and tuples

2010-10-04 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: In the past, we've allow ceval.c to peer through encapsulation in order to have fast paths. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9800

[issue9884] The 4th parameter of method always None or 0 on x64 Windows.

2010-10-04 Thread Hirokazu Yamamoto
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment: I don't have x64 machine, so I cannot test this. So this is just an idea. It seems Modules/_ctypes/libffi_msvc is a bit old. Modules/_ctypes/libffi/src/x86 is newer. Maybe this issue can be fixed by using newer one? Thank you.

[issue7768] raw_input should encode unicode prompt with std.stdout.encoding.

2010-10-04 Thread Florent Xicluna
Florent Xicluna florent.xicl...@gmail.com added the comment: annoying stuff, indeed... $ python -c 'print uLa cl\xe9: ' La clé: $ python -c 'raw_input(uLa cl\xe9: )' Traceback (most recent call last): File string, line 1, in module UnicodeEncodeError: 'ascii' codec can't encode character

[issue9960] test_structmembers fails on s390x (bigendian 64-bit): int/Py_ssize_t issue

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Is this 2.7-specific? Otherwise, it would be better to provide a patch for 3.2 first, and then svnmerge to other branches. My reading of Python/getargs.c is that this macro does affect u# in a manner analogous to s#; does this documentation

[issue9800] Fast path for small int-indexing of lists and tuples

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: As I mentioned, the speedup is invisible anyway, so it's not really a fast path ;) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9800 ___

[issue8913] Document that datetime.__format__ is datetime.strftime

2010-10-04 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Alexander closed issue 7789 in favor of this one, which is fine, but I want to respond to Eric's rejection there of including info about datetime in the 'format mini language' section of the docs. His point was that only the builtin

[issue8913] Document that datetime.__format__ is datetime.strftime

2010-10-04 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: I'm okay with that. Grepping Lib shows that date/datetime/time and Decimal are the only types that implement __format__. Decimal largely implements the same language as float. -- ___ Python tracker

[issue1078919] email.Header (via add_header) encodes non-ASCII content incorrectly

2010-10-04 Thread Barry A. Warsaw
Barry A. Warsaw ba...@python.org added the comment: RDM, I wonder if it wouldn't be better (in email6) to use an instance to represent the 3-tuple instead? It might make for clearer client code, and would allow you to default things you might generally not care about. E.g. class

[issue6302] email.header.decode_header data types are inconsistent and incorrectly documented

2010-10-04 Thread Barry A. Warsaw
Barry A. Warsaw ba...@python.org added the comment: In email6, can we at least make tuple returning methods return namedtuples instead? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6302

[issue6302] email.header.decode_header data types are inconsistent and incorrectly documented

2010-10-04 Thread Barry A. Warsaw
Barry A. Warsaw ba...@python.org added the comment: I agree that it makes sense to have consistent types in the output. As for whether to add a new method or fix the existing one, I'm a bit torn, but I'd probably opt for fixing the existing function rather than adding a new one, just because

[issue6302] email.header.decode_header data types are inconsistent and incorrectly documented

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I agree that it makes sense to have consistent types in the output. As for whether to add a new method or fix the existing one, I'm a bit torn, but I'd probably opt for fixing the existing function rather than adding a new one, just because I

[issue6302] email.header.decode_header data types are inconsistent and incorrectly documented

2010-10-04 Thread Barry A. Warsaw
Barry A. Warsaw ba...@python.org added the comment: The point of a new method is to return the header as a human-readable string, rather than a list of tuples. It has added value besides leaving the old method alone ;) +1 then! :) -- ___ Python

[issue9065] tarfile: default root:root ownership is incorrect.

2010-10-04 Thread Lars Gustäbel
Lars Gustäbel l...@gustaebel.de added the comment: Fixed in r85211 (py3k), r85212 (release31-maint), r85213 (release27-maint). Thank you for the report. -- resolution: - accepted stage: - committed/rejected status: open - closed type: - behavior

[issue10021] Format parser is too permissive

2010-10-04 Thread Alexander Belopolsky
New submission from Alexander Belopolsky belopol...@users.sourceforge.net: According to the Format String Syntax section [1], attribute_name must be an identifier. However, the parser does not catch a violation of this rule and happily passes non-indentifier strings to getattribute: class

[issue10021] Format parser is too permissive

2010-10-04 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10021 ___ ___ Python-bugs-list

[issue10022] Emit more information in decoded SSL certificates

2010-10-04 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: There's some code in _ssl.c which exports more information in decoded SSL certificates (such as notBefore or issuer), but it is only enabled when the hidden function _ssl._test_decode_cert is used. It would be nice to export all this

[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Here is a patch against py3k. It adds a single ssl.match_hostname method, with rules from RFC 2818 (that is, tailored for HTTPS). Review welcome. -- keywords: +patch stage: - patch review Added file:

[issue10021] Format parser is too permissive

2010-10-04 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: PEP 3101 has the following Implementation note: The implementation of this proposal is not required to enforce the rule about a simple or dotted name being a valid Python identifier. Instead, it will rely on

[issue10021] Format parser is too permissive

2010-10-04 Thread Alexander Belopolsky
Changes by Alexander Belopolsky belopol...@users.sourceforge.net: -- assignee: - d...@python components: +Documentation -Interpreter Core nosy: +d...@python ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10021

[issue10021] Format parser is too permissive

2010-10-04 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +eric.smith, mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10021 ___ ___

[issue10021] Format parser is too permissive

2010-10-04 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: Right. It seemed like a hassle to have the str.format parser try to figure out what a valid identifier is, so it just passes it through. I don't see this as any different from: class X: ...def __getattribute__(self, a): return 'foo' ...

[issue10021] Format parser is too permissive

2010-10-04 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2010/10/4 Eric Smith rep...@bugs.python.org: Eric Smith e...@trueblade.com added the comment: Right. It seemed like a hassle to have the str.format parser try to figure out what a valid identifier is, so it just passes it through.

[issue10021] Format parser is too permissive

2010-10-04 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: Ah, but I don't need to in order to comply with the PEP! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10021 ___

[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-10-04 Thread Devin Cook
Devin Cook devin.c.c...@gmail.com added the comment: I think it looks good except for the wildcard checking. According to the latest draft of that TLS id-checking RFC, you aren't supposed to allow the wildcard as part of a fragment. Of course this contradicts RFC 2818.

[issue10021] Format parser is too permissive

2010-10-04 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: On Mon, Oct 4, 2010 at 1:02 PM, Eric Smith rep...@bugs.python.org wrote: .. Ah, but I don't need to in order to comply with the PEP! This is true and this is the reason I changed this issue from bug to doc. I seem to

[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I think it looks good except for the wildcard checking. According to the latest draft of that TLS id-checking RFC, you aren't supposed to allow the wildcard as part of a fragment. Of course this contradicts RFC 2818. Well, since it is then an

[issue10021] Format parser is too permissive

2010-10-04 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: I agree it should be documented as a CPython specific behavior. I should also add a CPython specific test for it, modeled on your code (if one doesn't already exist). I'll look into it. -- ___ Python

[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-10-04 Thread Devin Cook
Devin Cook devin.c.c...@gmail.com added the comment: I'm also assuming RFC 2818 is in wider use than the id-checking draft; am I wrong? Yeah, since RFC 2818 has been accepted since 2000 and the id-checking draft was started in 2009, I'd say it's a safe bet. I'm in no way authoritative

[issue5088] optparse: inconsistent default value for append actions

2010-10-04 Thread Sandro Tosi
Sandro Tosi sandro.t...@gmail.com added the comment: Hi Éric, thanks a lot for your review. Your comments are just fine, so I'm attaching a new patch that contains them. Yes, it's really nice to see one's work being accepted, and I do recognize I have a lot to learn about python procedures

[issue5501] Update multiprocessing docs re: freeze_support

2010-10-04 Thread Sandro Tosi
Sandro Tosi sandro.t...@gmail.com added the comment: Sorry Éric, I don't get it: do you mean that the fact that freeze_support() can be called without issues on Unix or OS X is a new feature? or I misread it completely? -- ___ Python tracker

[issue5501] Update multiprocessing docs re: freeze_support

2010-10-04 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Rephrased: Is this relevant for 3.1? (Bug and doc fixes go into 3.2, 3.1 and 2.7, but here only 3.2 and 2.7 are selected, so I asked if the bugfix/new feature/behavior in question was something new in 3.2 and thus not in 3.1.) --

[issue9093] Tools/README is out of date

2010-10-04 Thread Sandro Tosi
Sandro Tosi sandro.t...@gmail.com added the comment: Hello Georg, is this bug been fixed with r83608-10 ? from the commit diffs it seems so, but maybe there's something else you want to do. Regards, Sandro -- nosy: +sandro.tosi ___ Python tracker

[issue5088] optparse: inconsistent default value for append actions

2010-10-04 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Forgot this one: `appended` I don’t remember the default reST role being used in the Python docs; I don’t even remember what it is. Your example makes me suspect emphasis, so using *appended* would do the same thing and be explicit.

[issue5088] optparse: inconsistent default value for append actions

2010-10-04 Thread Sandro Tosi
Sandro Tosi sandro.t...@gmail.com added the comment: On Mon, Oct 4, 2010 at 20:18, Éric Araujo rep...@bugs.python.org wrote: Éric Araujo mer...@netwok.org added the comment: Forgot this one: `appended` I don’t remember the default reST role being used in the Python docs; I don’t even

[issue5088] optparse: inconsistent default value for append actions

2010-10-04 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: I think I looked in other part of the optparse.rst file how it's done and used that Alright, let’s leave it alone then. contrary to what one can think Still not a native speaker, but wouldn’t “may think” be more suited here? ah ok, it might me

[issue5088] optparse: inconsistent default value for append actions

2010-10-04 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- resolution: - accepted status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5088 ___

[issue9800] Fast path for small int-indexing of lists and tuples

2010-10-04 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: At any rate, I believe this used to be a fast-path. IIRC, Aahz put it in after demonstrating a considerable speed boost for common cases. Aahz, do you have any institutional memory around this one? -- nosy: +aahz

[issue6706] asyncore's accept() is broken

2010-10-04 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: Python 3.2 changes committed in r85220. Still have to commit EWOULDBLOCK/ECONNABORTED changes for 3.1 and 2.7. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6706

[issue9935] Faster pickling of instances

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Alexandre, do you have opinion on this? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9935 ___

[issue10023] test_lib2to3 leaks under 3.1

2010-10-04 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: test_lib2to3 beginning 5 repetitions 12345 No handlers could be found for logger RefactoringTool . test_lib2to3 leaked [32, 32] references, sum=64 -- components: Library (Lib), Tests messages: 117983 nosy: benjamin.peterson, pitrou

[issue10024] Outdated advice in C-API tutorial?

2010-10-04 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: In http://docs.python.org/dev/extending/newtypes.html, you can read: “To enable object creation, we have to provide a tp_new implementation. In this case, we can just use the default implementation provided by the API function

[issue1731717] race condition in subprocess module

2010-10-04 Thread Gregory P. Smith
Gregory P. Smith g...@krypto.org added the comment: A workaround for those still having problems with this: stub out subprocess._cleanup with a no-op method. It it only useful if your app is ever using subprocess and forgetting to call wait() on Popen objects before they are deleted. If you

[issue9962] GzipFile doesn't have peek()

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I've committed the improvements in r85221. Thank you! -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9962 ___

[issue9935] Faster pickling of instances

2010-10-04 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: Sorry Antoine, I have been busy with school work lately. I like the general idea and I will try to look at your patch ASAP. -- ___ Python tracker rep...@bugs.python.org

[issue10025] random.seed not initialized as advertised

2010-10-04 Thread Tom Goddard
New submission from Tom Goddard godd...@cgl.ucsf.edu: In Python 2.7, random.seed() with a string argument is documented as being equivalent to random.seed() with argument equal to the hash of the string argument. This is not the actual behavior. Reading the _random C code reveals it in fact

[issue9042] Gettext cache and classes

2010-10-04 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Committed in r85223, r85224, r85225 (resp. 3.2, 3.1, 2.7). Thanks again! -- resolution: accepted - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker

[issue10025] random.seed not initialized as advertised

2010-10-04 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10025 ___ ___

[issue10025] random.seed not initialized as advertised

2010-10-04 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10025 ___

[issue1104021] wishlist: os.feed_urandom(input)

2010-10-04 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: -BreamoreBoy resolution: out of date - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1104021 ___

[issue1104021] wishlist: os.feed_urandom(input)

2010-10-04 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- resolution: - rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1104021 ___ ___

[issue4661] email.parser: impossible to read messages encoded in a different encoding

2010-10-04 Thread Tony Meyer
Changes by Tony Meyer anadelonb...@users.sourceforge.net: -- nosy: +anadelonbrin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4661 ___ ___

[issue9978] Better wait for slow machine in test_os (_kill_with_event)

2010-10-04 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp: -- title: test_os failures on XP-4 buildbot - Better wait for slow machine in test_os (_kill_with_event) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9978

[issue9899] tkinter test_font fails on OS X with Aqua Tk

2010-10-04 Thread Ned Deily
Ned Deily n...@acm.org added the comment: After further investigation, on OS X at least, there is a difference in behavior between Tk 8.4 (the system default on OS X 10.4 and 10.5) and Tk 8.5 (the default on 10.6). Lib/tkinter/font.py calls the Tk font names commands to check whether a font