[issue5088] optparse: inconsistent default value for append actions

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Note, the :attr:`~Option.dest` variable is a list which includes default values if any are defined. Options on the command-line are appended to this list. Accordingly, the list may contain both the default value and the value passed on the command-line. --

[issue10594] Typo in PyList_New doc.

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: This is fine. Go ahead and backport if you feel so inclined. -- assignee: d...@python -> eli.bendersky nosy: +rhettinger priority: normal -> low resolution: -> accepted versions: -Python 2.6 ___ Python tracker

[issue10592] pprint module doesn't work well with OrderedDicts

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'll discuss with Benjamin. This could be construed as a simple bug fix. The code is already in Py3.1. Line 155: - items = _sorted(object.items()) + items = (list if issubclass(typ, OrderedDict) else _sorted)(object.items()) -- assignee: -> benj

[issue10592] pprint module doesn't work well with OrderedDicts

2010-11-30 Thread Elias Zamaria
Elias Zamaria added the comment: I forgot to mention, someone came up with this suggestion (http://stackoverflow.com/questions/4301069/any-way-to-properly-pretty-print-ordered-dictionaries-in-python/4303996#4303996). It is not the best, but the output is better than how it is now. Can it be s

[issue10594] Typo in PyList_New doc.

2010-11-30 Thread INADA Naoki
INADA Naoki added the comment: OK, please. On Wed, Dec 1, 2010 at 12:46 PM, Eli Bendersky wrote: > > Eli Bendersky added the comment: > > Thanks for the report, > > Attaching a patch for Doc/c-api/list.rst in Python 3.2 > If this is OK, I can backport the patch to other versions as well. > >

[issue5088] optparse: inconsistent default value for append actions

2010-11-30 Thread Eli Bendersky
Eli Bendersky added the comment: Éric, also re your previous message, I personally would prefer seeing "contrary to what one can think" removed altogether. IMHO it's too chatty for an official document and doesn't really add new information over the sentence it follows. -- __

[issue5088] optparse: inconsistent default value for append actions

2010-11-30 Thread Eli Bendersky
Eli Bendersky added the comment: I fuzzily recall there was somewhere a decision to use the American spelling of some words, like s/behaviour/behavior/ appearing in this patch. Is this right, or was it decided that it doesn't matter? -- nosy: +eli.bendersky status: pending -> open __

[issue10594] Typo in PyList_New doc.

2010-11-30 Thread Eli Bendersky
Eli Bendersky added the comment: Thanks for the report, Attaching a patch for Doc/c-api/list.rst in Python 3.2 If this is OK, I can backport the patch to other versions as well. -- keywords: +patch nosy: +eli.bendersky Added file: http://bugs.python.org/file19889/issue10594.py32.1.patc

[issue10593] LRU Cache with maxsize=None

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Applied in r86911. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Py

[issue10594] Typo in PyList_New doc.

2010-11-30 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue10594] Typo in PyList_New doc.

2010-11-30 Thread INADA Naoki
INADA Naoki added the comment: http://docs.python.org/c-api/list.html#PyList_GetItem > Return the object at position pos in the list pointed to by p s/pos/index/ -- ___ Python tracker _

[issue10594] Typo in PyList_New doc.

2010-11-30 Thread INADA Naoki
INADA Naoki added the comment: http://docs.python.org/c-api/list.html#PyList_GetItem > Return the object at position pos in the list pointed to by p s/p/list/ -- ___ Python tracker

[issue10594] Typo in PyList_New doc.

2010-11-30 Thread INADA Naoki
New submission from INADA Naoki : http://docs.python.org/c-api/list.html#PyList_New > Note: If length is greater than zero, ... s/length/len/ -- assignee: d...@python components: Documentation messages: 122974 nosy: d...@python, naoki priority: normal severity: normal status: open title

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: > just to confirm: we WANT array.array("I", [1,2,3]) to have a content- > length of 12, right? Yes, since it will emit 12 bytes in the body (you could actually have a test for it). -- ___ Python tracker

[issue6594] json C serializer performance tied to structure depth on some systems

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Raymond, I'll follow up in private with Shawn. All the recent performance improvements done on JSON (in 3.2) mean the issue can be closed IMO. -- resolution: -> out of date status: open -> closed ___ Python tracker

[issue10273] Clean-up Unittest API

2010-11-30 Thread Ezio Melotti
Ezio Melotti added the comment: s/regexp/regex/ done in r86910. -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Xuanji Li
Xuanji Li added the comment: So, reading all your comments, I gather that my proposed patch for client.py which is try: self.sock.sendall(data) except TypeError: if isinstance(data, collections.Iterable): for d in t: self.sock.sendall(d) else:

[issue10593] LRU Cache with maxsize=None

2010-11-30 Thread Nick Coghlan
Nick Coghlan added the comment: Nice! You may still need to use the lock even for the simple unbounded case though - incrementing hits and misses isn't atomic, so the statistics may be miscounted if you get a hit or miss in different threads at the same time. Alternatively, we could just doc

[issue7434] general pprint rewrite

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Attaching a rough concept of how to make the existing pprint module extendible without doing a total rewrite. The actual handler is currently bogus (no thought out), so focus on the @guard decorator and the technique for scanning for handlers. --

[issue10593] LRU Cache with maxsize=None

2010-11-30 Thread Raymond Hettinger
Changes by Raymond Hettinger : Removed file: http://bugs.python.org/file19886/cache.diff ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue10593] LRU Cache with maxsize=None

2010-11-30 Thread Raymond Hettinger
Changes by Raymond Hettinger : Added file: http://bugs.python.org/file19887/cache2.diff ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue10593] LRU Cache with maxsize=None

2010-11-30 Thread Raymond Hettinger
New submission from Raymond Hettinger : Nick, I may have found a straight-forward way to incorporate your idea for the cache to support maxsize=None. Let me know what you think. -- assignee: ncoghlan components: Library (Lib) files: cache.diff keywords: patch messages: 122967 nosy: nco

[issue10535] Enable warnings by default in unittest

2010-11-30 Thread Ezio Melotti
Ezio Melotti added the comment: Committed in r86908. I'll leave this open because there still a few things (proposed in the previous message) that can be changed/improved. -- ___ Python tracker __

[issue10592] pprint module doesn't work well with OrderedDicts

2010-11-30 Thread Éric Araujo
Éric Araujo added the comment: I’m afraid there is no way, but a robust solution will be designed. See #7434. -- nosy: +eric.araujo resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> general pprint rewrite ___

[issue1649329] Extract file-finding and language-handling code from gettext.find

2010-11-30 Thread Éric Araujo
Éric Araujo added the comment: Congratulations. Take the time you’ll need, if this doesn’t go into 3.2 it’ll just be in 3.3. -- ___ Python tracker ___ __

[issue10592] pprint module doesn't work well with OrderedDicts

2010-11-30 Thread Elias Zamaria
New submission from Elias Zamaria : If I try to pretty-print an ordered dictionary, it doesn't show nicely. Instead of having each key-value pair on its own line, the whole thing shows up on one long line, which wraps many times and is hard to read. I can provide an example if you want. Is th

[issue8743] set() operators don't work with collections.Set instances

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: No need to rush this for the beta. It's a bug fix and can go in at any time. The important thing is that we don't break the C code. The __ror__ magic method would still need to do the right thing and the C code needs to defend against the interpreter sw

[issue8743] set() operators don't work with collections.Set instances

2010-11-30 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Yes, I can take a stab at it. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue10591] test_os failure in refleak runs

2010-11-30 Thread Brian Curtin
Brian Curtin added the comment: Fixed in r86906. Split the shared setUp/tearDown into individual methods for each part. -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker

[issue8743] set() operators don't work with collections.Set instances

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Daniel, do you have time to work on this one? If so, go ahead an make setobject.c accept any instance of collections.Set and make the corresponding change to the ABCs: def __or__(self, other): if not isinstance(other, Set): return N

[issue6594] json C serializer performance tied to structure depth on some systems

2010-11-30 Thread Shawn
Shawn added the comment: I specifically mentioned *SPARC* as the performance problem area, but the reply about "0.5s to dump" fails to mention on what platform they tested My problem is not "undiagnosable". I'll be happy to provide you with even more data files. But I believe that there is

[issue8425] a -= b should be fast if a is a small set and b is a large set

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Any new logic should make maximum use of existing tools: def __isub__(self, other) if len(other) > len(self)*8: other = self & other . . . # rest of isub unchanged -- stage: patch review -> needs patch __

[issue6594] json C serializer performance tied to structure depth on some systems

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Antoine, what do you want to do with the one? Without a good test case the OP's original issue is undiagnosable. -- assignee: rhettinger -> pitrou versions: +Python 3.1 ___ Python tracker

[issue6422] timeit called from within Python should allow autoranging

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: This does not conflict with the other proposed changes to timeit and it is in-line with Guido's desire that to expose useful parts currently buried in the command-line logic. Amaury, you've shown an interest. Would you like to apply it? -- assign

[issue8425] a -= b should be fast if a is a small set and b is a large set

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Deferring to 3.3. -- priority: normal -> low versions: +Python 3.3 -Python 2.7, Python 3.2 ___ Python tracker ___ ___

[issue1649329] Extract file-finding and language-handling code from gettext.find

2010-11-30 Thread Shannon -jj Behrens
Shannon -jj Behrens added the comment: Sorry, I just had a baby on Saturday. Hence, I'm a bit late getting to this. It might take me a couple weeks. -- ___ Python tracker _

[issue10478] Ctrl-C locks up the interpreter

2010-11-30 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +stutzbach ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Other suggestions for a better name for that column are certainly welcome. :-) > > "Stub Methods"? Fine with me. -- ___ Python tracker ___

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Other suggestions for a better name for that column are certainly welcome. :-) "Stub Methods"? -- ___ Python tracker ___ ___

[issue10464] netrc module not parsing passwords containing #s.

2010-11-30 Thread Ned Deily
Changes by Ned Deily : Removed file: http://bugs.python.org/file19666/issue_10231_testcase.diff ___ Python tracker ___ ___ Python-bugs-list ma

[issue10464] netrc module not parsing passwords containing #s.

2010-11-30 Thread Ned Deily
Ned Deily added the comment: Patch looks good to me. Supplied test fails before and works after fix applied. -- nosy: +ned.deily stage: patch review -> commit review ___ Python tracker

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > What does "unsupported" mean? "Abstract" would look more exact. > > It means they raise io.UnsupportedOperation when called (unless the > subclass overrides them to do something else). > > They are not marked with @abstractmethod, so "Abstract" would be

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > What does "unsupported" mean? "Abstract" would look more exact. It means they raise io.UnsupportedOperation when called (unless the subclass overrides them to do something else). They are not marked with @abstractmethod, so "Abstract" would be wrong. I

[issue10262] Add --soabi option to `configure`

2010-11-30 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Let's test Linux at least, then. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue10262] Add --soabi option to `configure`

2010-11-30 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Nov 30, 2010, at 10:12 PM, Amaury Forgeot d'Arc wrote: >The value of get_config_var("SO") is the same as before, something like >".cpython-32.so" by default on Linux. (see, I just moved the line >SO=.$SOABI$SO at the bottom of the patch). Cool, thanks. >I

[issue10591] test_os failure in refleak runs

2010-11-30 Thread Antoine Pitrou
New submission from Antoine Pitrou : $ ./python -m test.regrtest -R 3:2 test_os [1/1] test_os [35351 refs] [35351 refs] [35352 refs] beginning 5 repetitions 12345 [35351 refs] [35351 refs] [35352 refs] test test_os failed -- Traceback (most recent call last): File "/home/antoine/py3k/__svn__/Li

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Georg Brandl
Georg Brandl added the comment: Not sure what "unsupported methods" means. E.g. "readinto" is listed as provided by RawIOBase in the doc text. -- ___ Python tracker ___ __

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: What does "unsupported" mean? "Abstract" would look more exact. -- ___ Python tracker ___ ___ Pytho

[issue8685] set(range(100000)).difference(set()) is slow

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Modified patch committed in r86905. Thanks! -- resolution: accepted -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Fred L. Drake, Jr.
Changes by Fred L. Drake, Jr. : -- nosy: +d...@python, fdrake ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue9915] speeding up sorting with a key

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 on the basic idea of moving elements in the keys and values arrays at the same time thereby eliminating the fragmented memory overhead of the sortwrapper indirection. I would like the patch to be restricted to just that change. The other tweaks are no

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: +io and doc people Attached is a simple patch to add a table to the documentation summarizing the I/O ABCs. -- keywords: +patch nosy: +benjamin.peterson, ezio.melotti, georg.brandl Added file: http://bugs.python.org/file19885/io-abc.diff __

[issue10262] Add --soabi option to `configure`

2010-11-30 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The value of get_config_var("SO") is the same as before, something like ".cpython-32.so" by default on Linux. (see, I just moved the line SO=.$SOABI$SO at the bottom of the patch). In the C file dynload_shlib.c, I chose the names SO_BASE for the "simple

[issue10262] Add --soabi option to `configure`

2010-11-30 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Of course, you don't change configure directly, you change configure.in and let autoconf update the configure (but you already know that I'm sure :). The patch looks fairly reasonable, though I haven't tried it. One question: does $SO have the same value af

[issue8685] set(range(100000)).difference(set()) is slow

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thx. -- assignee: rhettinger -> pitrou resolution: -> accepted ___ Python tracker ___ ___ Python

[issue8685] set(range(100000)).difference(set()) is slow

2010-11-30 Thread Philip Jenvey
Changes by Philip Jenvey : -- nosy: +pjenvey ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue8685] set(range(100000)).difference(set()) is slow

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Raymond, unless you object, I'd like to commit this before beta1. -- ___ Python tracker ___ ___ Pyth

[issue8084] pep-0370 on osx duplicates existing functionality

2010-11-30 Thread Glyph Lefkowitz
Glyph Lefkowitz added the comment: Would it be possible to have this reverted for 2.7.2 / 3.2.1, and restore ~/.local _and_ ~/Library as equally valid locations for python code? As I tried to explain on the mailing list, this change basically introduces a regression, and nothing else. Sorry

[issue7830] Flatten nested functools.partial

2010-11-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The original motivation for the patch was that if partial() objects are guaranteed to be flat, it would simplify code that deals with them. See issue4331 for one example. With a "conservative" patch, however, it will still be possible to create nested

[issue10590] Parameter type error for xml.sax.parseString(string, ...)

2010-11-30 Thread Thomas Ryan
New submission from Thomas Ryan : In 3.1.3, 3.1.2, maybe earlier... xml.sax.parseString(string, handler, error_handler=handler.ErrorHandler()) Source code requires bytes, not a string as implied by function name and by the documentation. Exception thrown for strings. Since the name includes

[issue7830] Flatten nested functools.partial

2010-11-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Alexander, I don't see anything wrong with patch, nor anything compelling about it either. It's your choice whether or not to apply. -- ___ Python tracker ___

[issue10587] Document the meaning of str methods

2010-11-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Nov 30, 2010 at 1:53 PM, Martin v. Löwis wrote: .. > What is the issue that you are reporting? that the status quo should be > documented, or that isalpha is wrong? > These are independent - don't mix them. This is a documentation issue. I don'

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : The I/O ABC documentation has a blanket disclaimer at the top: "The abstract base classes also provide default implementations of some methods in order to help implementation of concrete stream classes. For example, BufferedIOBase provides unoptimized

[issue1170] shlex have problems with parsing unicode

2010-11-30 Thread Martin v . Löwis
Martin v. Löwis added the comment: The key requirement to consider for in POSIX compatible mode is, well, POSIX compatibility, which is defined in http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag

[issue10551] mimetypes read from the registry should not overwrite standard mime mappings

2010-11-30 Thread Kovid Goyal
Kovid Goyal added the comment: I actually had in mind people that (like me) develop primarily on unix and assume that mimetypes works the same way on both windows and unix. Of course, the changed behavior is also a concern. At the very least, I would encourage the addition of a warning to the

[issue10587] Document the meaning of str methods

2010-11-30 Thread Martin v . Löwis
Martin v. Löwis added the comment: What is the issue that you are reporting? that the status quo should be documented, or that isalpha is wrong? These are independent - don't mix them. -- nosy: +loewis ___ Python tracker

[issue10551] mimetypes read from the registry should not overwrite standard mime mappings

2010-11-30 Thread R. David Murray
R. David Murray added the comment: I would expect that it would not be people new to mimetypes that would have the issues, but people like you for whom the behavior on Windows has changed. And this is indeed a concern. The people involved in making the windows mimetypes enhancement are nosy

[issue10551] mimetypes read from the registry should not overwrite standard mime mappings

2010-11-30 Thread Kovid Goyal
Kovid Goyal added the comment: It is, of course, your decision, but IMO, since the mimetypes database in windows appears to be always broken, the default behavior of the mimetypes module in python 2.7 on windows is broken for most (all?) windows installs. For me personally, it doesn't matter

[issue10551] mimetypes read from the registry should not overwrite standard mime mappings

2010-11-30 Thread R. David Murray
R. David Murray added the comment: Kovid: so essentially what you are saying is that the windows platform is broken with respect to MIME types and with respect to its security model. Why am I not surprised? :) You would have the same problem if software installation altered the /etc/mimetyp

[issue9598] untabify.py fails on files that contain non-ascii characters

2010-11-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed revision 86893 that makes untabify.py respect encoding cookie in the files it processes. I don't think there is anything else that needs to be done here. -- resolution: -> fixed stage: -> committed/rejected status: open -> closed _

[issue1706039] Added clearerr() to clear EOF state

2010-11-30 Thread Scott Dial
Scott Dial added the comment: The patch includes unittests; the issue is that the tests pass without the changes. That is an entirely different state to be in. The tests should be committed unless somebody wants to object to the behavior that they are testing (although I believe this behavior

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Éric Araujo
Éric Araujo added the comment: > hasattr("lol", '__next__') == False, even though strings are Iterable FYI, magic methods are looked up on the class, not on the instance. That’s why ABCs are the right thing to use here. http://docs.python.org/dev/reference/datamodel#special-method-names --

[issue1706039] Added clearerr() to clear EOF state

2010-11-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I don't know how to reproduce the issue and without unit tests this patch cannot be committed. -- assignee: belopolsky -> ___ Python tracker

[issue1170] shlex have problems with parsing unicode

2010-11-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Adding #10587 because we need to figure out the exact meaning of str.isspace() etc. first. It is possible that for proper operation shlex should consult unicodedata directly. -- dependencies: +Document the meaning of str methods __

[issue10574] email.header.decode_header fails if the string contains multiple directives

2010-11-30 Thread R. David Murray
R. David Murray added the comment: Note that none of your examples are valid encoded words, so given that email currently does strict parsing, the fact that it is not attempting to decode those words is technically correct. However, I agree that it would be better for it to do a "best guess

[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()

2010-11-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am going to close this as "rejected" unless someone objects. The benefit is too small to make users suffer through the deprecation process. -- resolution: -> rejected status: open -> pending ___ Python tra

[issue10552] Tools/unicode/gencodec.py error

2010-11-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in revision 86891. Keeping open to address Mac issue. -- assignee: -> belopolsky components: +Macintosh priority: normal -> low stage: commit review -> needs patch ___ Python tracker

[issue1079] decode_header does not follow RFC 2047

2010-11-30 Thread R. David Murray
Changes by R. David Murray : -- assignee: -> r.david.murray ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Answering to myself, sorry. memoryview() does return the right answer of whether the object supports the buffer interface, *however* it doesn't mean the len() will be right. For example, take an array.array of ints: >>> memoryview(array.array("I", [1,2,3]))

[issue10576] Add a progress callback to gcmodule

2010-11-30 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: > How about a string and a dict? the string can be "start" and "stop" > and we can add interesting information to the dict as you suggest. I like where this is headed. How about putting the string in the dict, too? d['phase'] = 'start' -- ___

[issue10576] Add a progress callback to gcmodule

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: > You are right, Antoine. > How about a string and a dict? the string can be "start" and "stop" > and we can add interesting information to the dict as you suggest. Looks good to me. -- ___ Python tracker

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: > - Lets have the ValueError raised from the urllib/request.py. Changing > it to isinstance(data,collections.Iterable) as Antoine suggested is > okay here too. Xuanji is right: it's not. We want bytes to be accepted, and it's an iterable. -- _

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: One way to check that it's bytes-compatible is to take a memoryview of it: >>> memoryview(b"abc") >>> memoryview(bytearray(b"abc")) >>> memoryview(array.array('b', b"abc")) >>> memoryview([b"abc"]) Traceback (most recent call last): File "", line 1, in T

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Senthil Kumaran
Senthil Kumaran added the comment: Xuanji, a wording which does convey the approximate meaning is fine. I think, the Exception error messages will help the people based on the Context. - Lets have the ValueError raised from the urllib/request.py. Changing it to isinstance(data,collections.Ite

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Xuanji Li
Xuanji Li added the comment: davide: yeah, hasattr("lol", '__next__') == False, even though strings are Iterable; so for strings and other such sequences the len(data) line will be executed. So technically we shouldn't say "No Content-Length specified for iterable body" but we should say "No

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

2010-11-30 Thread Nick Coghlan
Nick Coghlan added the comment: Committed in r86889 The docs changes should soon be live at: http://docs.python.org/dev/library/urllib.parse.html If anyone would like to suggest changes to the wording of the docs for post beta1, or finds additional corner cases that the new bytes handling can

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > len(data) will raise anyway. > > No, it won't, if the iterable happens to be a sequence. Well, it seems the patch is confused between iterable and iterator. Only iterators have a __next__, but they usually don't have a __len__. The patch should really che

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Davide Rizzo
Davide Rizzo added the comment: > len(data) will raise anyway. No, it won't, if the iterable happens to be a sequence. -- nosy: +davide.rizzo ___ Python tracker ___

[issue10588] imp.find_module raises unexpected SyntaxError

2010-11-30 Thread Ron Adam
Changes by Ron Adam : -- nosy: +ron_adam ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Xuanji Li
Xuanji Li added the comment: I don't fully understand Lib/urllib/request.py either, I just ported it and ran the unittests... it seems like what it does is that if you send an iterator through as 'data' you can't know the length in advance, and rather than let the len(data) raise an exception

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: > pitrou: actually that seems a bit suspect now... you need to handle > 'data' differently depending on its type, Yes, but you can't know all appropriate types in advance, so it's better to try and catch the TypeError. I don't understand your changes in Lib/ur

[issue10576] Add a progress callback to gcmodule

2010-11-30 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: You are right, Antoine. How about a string and a dict? the string can be "start" and "stop" and we can add interesting information to the dict as you suggest. -- ___ Python tracker

[issue10576] Add a progress callback to gcmodule

2010-11-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Let's start bikeshedding the calling signature. I like having a > single callback, since multiple callables are a nuisance to manage. IMO the callback should have a second argument as a dict containing various statistics that we can expand over time. The gen

[issue10576] Add a progress callback to gcmodule

2010-11-30 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Hi, as I stated, the original patch was simply our original implementation. Here is a new patch. It is simpler: 1) it exposes a gc.callbacks list where users can register themselves, in the spirit of sys.meta_path 2) One can have multiple callbacks 3)

[issue10464] netrc module not parsing passwords containing #s.

2010-11-30 Thread Xuanji Li
Xuanji Li added the comment: bumping...can someone review this? The reported bug seems valid enough. -- ___ Python tracker ___ ___ Py

[issue10537] OS X IDLE 2.7rc1 from 64-bit installer hangs when you paste something.

2010-11-30 Thread Ned Deily
Ned Deily added the comment: More data points: using the 2.7.1 release source tarball, the problem is reproducible on 10.6 when dynamically linked to the Apple Tcl/Tk 8.5 and executing in either 64-bit or 32-bit mode. It is not reproducible when using ActiveState Tcl/Tk 8.5.9, AS Tcl/Tk 8.4.

[issue3243] Support iterable bodies in httplib

2010-11-30 Thread Xuanji Li
Xuanji Li added the comment: pitrou: actually that seems a bit suspect now... you need to handle 'data' differently depending on its type, and while you can determine the type by finding out when 'data' throws certain exceptions, it doesn't seem like what exceptions were meant for. -

[issue9709] test_distutils warning: initfunc exported twice on Windows

2010-11-30 Thread Stefan Krah
Stefan Krah added the comment: Without the patch, you see the warning if test_build_ext is run in verbose mode. With the patch, the warning disappears. -- ___ Python tracker ___

[issue10588] imp.find_module raises unexpected SyntaxError

2010-11-30 Thread Emile Anclin
New submission from Emile Anclin : Considering following file: $ cat pylint/test/input/func_unknown_encoding.py # -*- coding: IBO-8859-1 -*- """ check correct unknown encoding declaration """ __revision__ = '' $ When we try to find that module, imp.find_module raises SyntaxError: >>> fro

  1   2   >