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

2010-10-04 Thread Mark Dickinson
Mark Dickinson 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é : -- assignee: -> tarek ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue10016] shutil.copyfile -- allow sparse copying

2010-10-04 Thread Tom Potts
Tom Potts 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 changed. This resi

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

2010-10-04 Thread Nick Coghlan
Nick Coghlan 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 __

[issue10016] shutil.copyfile -- allow sparse copying

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou 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 for the st_blo

[issue4775] Incorrect documentation - UTC time

2010-10-04 Thread Alexander Belopolsky
Alexander Belopolsky 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 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 : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue10016] shutil.copyfile -- allow sparse copying

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou 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 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 wrap_socke

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

2010-10-04 Thread Senthil Kumaran
Changes by Senthil Kumaran : -- assignee: -> orsenthil nosy: +orsenthil ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

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

2010-10-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: In the past, we've allow ceval.c to peer through encapsulation in order to have fast paths. -- ___ Python tracker ___ __

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

2010-10-04 Thread Hirokazu Yamamoto
Hirokazu Yamamoto 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 added the comment: annoying stuff, indeed... $ python -c 'print u"La cl\xe9: "' La clé: $ python -c 'raw_input(u"La cl\xe9: ")' Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 5: ordinal no

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

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou 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 need cla

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

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: As I mentioned, the speedup is invisible anyway, so it's not really a "fast path" ;) -- ___ Python tracker ___

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

2010-10-04 Thread R. David Murray
R. David Murray 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 types were documented th

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

2010-10-04 Thread Eric Smith
Eric Smith 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 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 NonASCIIParameter: # XXX com

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

2010-10-04 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: In email6, can we at least make tuple returning methods return namedtuples instead? -- ___ Python tracker ___

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

2010-10-04 Thread Barry A. Warsaw
Barry A. Warsaw 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 think there ar

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

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou 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 think there

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

2010-10-04 Thread Barry A. Warsaw
Barry A. Warsaw 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 tracker

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

2010-10-04 Thread Lars Gustäbel
Lars Gustäbel 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 ___ Python tra

[issue10021] Format parser is too permissive

2010-10-04 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : 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 X: ...def __getattribute__(

[issue10021] Format parser is too permissive

2010-10-04 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue10022] Emit more information in decoded SSL certificates

2010-10-04 Thread Antoine Pitrou
New submission from Antoine Pitrou : 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 information by default;

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

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou 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: http://bugs.python.org/file19128/sslcheck.patch _

[issue10021] Format parser is too permissive

2010-10-04 Thread Alexander Belopolsky
Alexander Belopolsky 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 the getattr function of th

[issue10021] Format parser is too permissive

2010-10-04 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: -> d...@python components: +Documentation -Interpreter Core nosy: +d...@python ___ Python tracker ___

[issue10021] Format parser is too permissive

2010-10-04 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +eric.smith, mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10021] Format parser is too permissive

2010-10-04 Thread Eric Smith
Eric Smith 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' ... >>> getattr(X(),

[issue10021] Format parser is too permissive

2010-10-04 Thread Benjamin Peterson
Benjamin Peterson added the comment: 2010/10/4 Eric Smith : > > Eric Smith 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. You can always use "str.isidentifier()" (I don't remembe

[issue10021] Format parser is too permissive

2010-10-04 Thread Eric Smith
Eric Smith added the comment: Ah, but I don't need to in order to comply with the PEP! -- ___ Python tracker ___ ___ Python-bugs-list

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

2010-10-04 Thread Devin Cook
Devin Cook 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. http://tools.ietf.org/html/draft-saintandre-tl

[issue10021] Format parser is too permissive

2010-10-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Oct 4, 2010 at 1:02 PM, Eric Smith 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 remember this having been discussed before, but I cannot

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

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou 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 "error" (a

[issue10021] Format parser is too permissive

2010-10-04 Thread Eric Smith
Eric Smith 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 tracker

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

2010-10-04 Thread Devin Cook
Devin Cook 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 though. -- __

[issue5088] optparse: inconsistent default value for append actions

2010-10-04 Thread Sandro Tosi
Sandro Tosi 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 (either written or not :

[issue5501] Update multiprocessing docs re: freeze_support

2010-10-04 Thread Sandro Tosi
Sandro Tosi 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 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 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 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. > contrary to what one ca

[issue5088] optparse: inconsistent default value for append actions

2010-10-04 Thread Sandro Tosi
Sandro Tosi added the comment: On Mon, Oct 4, 2010 at 20:18, Éric Araujo wrote: > Éric Araujo 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 emph

[issue5088] optparse: inconsistent default value for append actions

2010-10-04 Thread Éric Araujo
Éric Araujo 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 more corre

[issue5088] optparse: inconsistent default value for append actions

2010-10-04 Thread Éric Araujo
Changes by Éric Araujo : -- resolution: -> accepted status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing list U

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

2010-10-04 Thread Raymond Hettinger
Raymond Hettinger 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' 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 ___

[issue9935] Faster pickling of instances

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Alexandre, do you have opinion on this? -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue10023] test_lib2to3 leaks under 3.1

2010-10-04 Thread Antoine Pitrou
New submission from Antoine Pitrou : 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 priority: nor

[issue10024] Outdated advice in C-API tutorial?

2010-10-04 Thread Antoine Pitrou
New submission from Antoine Pitrou : 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 PyType_GenericNew(). We’d like

[issue1731717] race condition in subprocess module

2010-10-04 Thread Gregory P. Smith
Gregory P. Smith 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 are, you can ke

[issue9962] GzipFile doesn't have peek()

2010-10-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: I've committed the improvements in r85221. Thank you! -- status: open -> closed ___ Python tracker ___ _

[issue9935] Faster pickling of instances

2010-10-04 Thread Alexandre Vassalotti
Alexandre Vassalotti 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 ___

[issue10025] random.seed not initialized as advertised

2010-10-04 Thread Tom Goddard
New submission from Tom Goddard : 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 casts the signed has

[issue9042] Gettext cache and classes

2010-10-04 Thread Éric Araujo
Éric Araujo 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 : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue10025] random.seed not initialized as advertised

2010-10-04 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue1104021] wishlist: os.feed_urandom(input)

2010-10-04 Thread R. David Murray
Changes by R. David Murray : -- nosy: -BreamoreBoy resolution: out of date -> ___ Python tracker ___ ___ Python-bugs-list mailing

[issue1104021] wishlist: os.feed_urandom(input)

2010-10-04 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- resolution: -> rejected ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

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

2010-10-04 Thread Tony Meyer
Changes by Tony Meyer : -- nosy: +anadelonbrin ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

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

2010-10-04 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : -- title: test_os failures on XP-4 buildbot -> Better wait for slow machine in test_os (_kill_with_event) ___ Python tracker ___ __

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

2010-10-04 Thread Ned Deily
Ned Deily 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 is already

[issue9907] interactive mode TAB does not insert on OS X built with editline instead of GNU readline

2010-10-04 Thread Ned Deily
Ned Deily added the comment: The modified patch looks OK to me and tests OK. The rl_read_init_file call seems like a reasonable thing for users who are used to using libedit's .editrc. As a practical matter, though, I think the only thing that would be affected is an .editrc TAB binding. S