[issue15542] Documentation incorrectly suggests __init__ called after direct __new__ call

2013-03-02 Thread Ankur Ankan
Changes by Ankur Ankan : -- nosy: +Ankur.Ankan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue12455] urllib2 forces title() on header names, breaking some requests

2013-03-02 Thread karl
karl added the comment: tests in http://hg.python.org/cpython/file/886df716cd09/Lib/test/test_wsgiref.py#l370 also checking that everything is case insensitive. And the method to get the headers in wsgiref, make sure they are lower-case http://hg.python.org/cpython/file/886df716cd09/Lib/wsgir

[issue13477] tarfile module should have a command line

2013-03-02 Thread Ankur Ankan
Ankur Ankan added the comment: I was also working on this issue so thought I should also submit my patch. Has a few extra features from berker.peksag's patch: 1) the name of the files to be extracted can be specified 2) output directory can be specified for extracting files. -- Added fil

[issue12455] urllib2 forces title() on header names, breaking some requests

2013-03-02 Thread karl
karl added the comment: Are there issues related to removing the capitalize() and title() appears? # title() * http://hg.python.org/cpython/file/886df716cd09/Lib/urllib/request.py#l1239 # capitalize() * http://hg.python.org/cpython/file/886df716cd09/Lib/urllib/request.py#l359 * http://hg.pyth

[issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing

2013-03-02 Thread Benjamin Peterson
Benjamin Peterson added the comment: I think the emphasis is on "internally" :). -- ___ Python tracker ___ ___ Python-bugs-list mailin

[issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing

2013-03-02 Thread Alex Gaynor
Alex Gaynor added the comment: python-dev/ideas may be a better place to have this discussion, but basically if you're going to insist that stuff like this doesn't go into Python "because it isn't C++", people are going to have to write C++, and that makes me incredibly sad. There's an obviou

[issue11448] docs for HTTPConnection.set_tunnel are ambiguous

2013-03-02 Thread karl
karl added the comment: ok made a proper patch on the rst file with hg diff. See issue-11448-1.patch -- Added file: http://bugs.python.org/file29293/issue-11448-1.patch ___ Python tracker __

[issue11448] docs for HTTPConnection.set_tunnel are ambiguous

2013-03-02 Thread karl
karl added the comment: Ah thanks Eric, I will fix that. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff)

2013-03-02 Thread karl
karl added the comment: I created 4 tests for testing trailing and leading spaces on * add_unredirected_header() * add_header() and modified the functions. Tests passed. → ./python.exe Lib/test/test_urllib2net.py […] test_headers_with_spaces (__main__.OtherNetworkTests) ... ok […]

[issue13477] tarfile module should have a command line

2013-03-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 for adding a CLI and +1 for keeping it minimal. -- nosy: +rhettinger ___ Python tracker ___ __

[issue17339] bytes() TypeError message is misleadingly narrow

2013-03-02 Thread Éric Araujo
Éric Araujo added the comment: Short form for me. -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue13477] tarfile module should have a command line

2013-03-02 Thread Éric Araujo
Éric Araujo added the comment: Patch looks good! Some minor comments on Rietveld. Could you add tests? -- ___ Python tracker ___ ___

[issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing

2013-03-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think it is going a bit too far in the direction of exposing low-level optimizations. Python is not C++. I also agree with Raymond that it's rather rare to construct read-only containers (in the sense that they are allocated once and for all). -- no

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

2013-03-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: hi Charles-François, > I'm attaching a patch doing the cleanup in PyEval_ReInitThreads(), with > test. Did you forget to attach the patch? -- ___ Python tracker

[issue17330] Stop checking for directory cache invalidation in importlib

2013-03-02 Thread Brett Cannon
Brett Cannon added the comment: So Nick Coghlan pointed out that this would require a deprecation warning which is doable using ImportWarning. But that also lowers my motivation to bother since there is no performance benefit. I will, though, at least make it clearer in the What's New doc and

[issue17339] bytes() TypeError message is misleadingly narrow

2013-03-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: Do you prefer the long or short form? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue13477] tarfile module should have a command line

2013-03-02 Thread Berker Peksag
Changes by Berker Peksag : -- keywords: +patch nosy: +berker.peksag Added file: http://bugs.python.org/file29291/issue13477.diff ___ Python tracker ___ __

[issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing

2013-03-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: Guido has previously rejected any kind of user specified presizing parameter for dictionaries. He felt that it was breaking the abstraction in a way that caused people to focus on implementation specific details. Also, set() and dict() use presizing (and h

[issue17339] bytes() TypeError message is misleadingly narrow

2013-03-02 Thread Ezio Melotti
Ezio Melotti added the comment: See also #16518. -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue17267] datetime.time support for '+' and 'now'

2013-03-02 Thread Francisco Martín Brugué
Francisco Martín Brugué added the comment: Hi Joar, just a detail: is there a reason for the asymmetric check for timedelta isinstance (and raising NotImplemented)? And BTW. isn't a double check for the __sub__ case (or have I missed something)? +def __add__(self, other): +"Add a t

[issue17032] Misleading error message: global name 'X' is not defined

2013-03-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: I just opened #17339 about another situation where the error message references only the last of several checks that failed. bytes(object()) # raises TypeError: 'object' object is not iterable # or 4 other possibilities I think any message like this should b

[issue17339] bytes() TypeError message is misleadingly narrow

2013-03-02 Thread Terry J. Reedy
New submission from Terry J. Reedy: If an object ob does not have a __bytes__ method or buffer interface and is not a string, integer, or iterable, bytes(ob) fails with TypeError: 'object' object is not iterable This is misleadingly narror (similar to #17032). We should either list *all* the

[issue10967] move regrtest over to using more unittest infrastructure

2013-03-02 Thread R. David Murray
R. David Murray added the comment: Ah, but for me the point of running directly under unit test (and unittest discovery) it to be able to use the standard unittest facilities for running a single testcase or individual test. Converting them to skips without making them run if regrtest isn't a

[issue17032] Misleading error message: global name 'X' is not defined

2013-03-02 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- stage: patch review -> commit review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue17336] Complex number representation round-trip doesn't work with signed zero values

2013-03-02 Thread Mark Dickinson
Mark Dickinson added the comment: An aside: C99 gets around this problem by allowing an (optional) Imaginary type, separate from Complex. Very few compilers support it, though. -- ___ Python tracker

[issue17336] Complex number representation round-trip doesn't work with signed zero values

2013-03-02 Thread Mark Dickinson
Mark Dickinson added the comment: This is not easy to avoid, I'm afraid, and it's a consequence of Python's usual rules for mixed-type arithmetic: (-0-0j) is interpreted as 0 - (0.0 + 0.0j) --- that is, the 0j is promoted to a complex instance (by giving it zero real part) before the subtract

[issue10967] move regrtest over to using more unittest infrastructure

2013-03-02 Thread Ezio Melotti
Ezio Melotti added the comment: Yes, that could be done as well, but even if they are not run by default under unittest, I'd be already happy to see them marked as skipped. If I see that they are skipped I can always switch to regrtest to enable the necessary resource, or just execute the fil

[issue17309] __bytes__ doesn't work in subclass of int and str

2013-03-02 Thread Benjamin Peterson
Benjamin Peterson added the comment: This has been fixed recently: $ ./python bytes.py b'\x00' b'hello' -- nosy: +benjamin.peterson resolution: -> out of date status: open -> closed ___ Python tracker _

[issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing

2013-03-02 Thread Benjamin Peterson
Benjamin Peterson added the comment: Definitely needs to be discussed on python-ideas/python-dev. -- nosy: +benjamin.peterson ___ Python tracker ___ _

[issue10967] move regrtest over to using more unittest infrastructure

2013-03-02 Thread Ezio Melotti
Ezio Melotti added the comment: > So you are agreeing with my proposal? I will have to see a concrete proposal first. If a resource API is useful enough to be added to unittest, and we can come up with a decent API we can move it there, otherwise it can just stay in regrtest. There's also th

[issue10967] move regrtest over to using more unittest infrastructure

2013-03-02 Thread R. David Murray
R. David Murray added the comment: My proposal is how to do this without adding anything to unittest. It is about how to implement the skips so that all tests are run when run under unittest, but resource control still happens when the tests run under regrtest. -- ___

[issue10967] move regrtest over to using more unittest infrastructure

2013-03-02 Thread R. David Murray
R. David Murray added the comment: So you are agreeing with my proposal? And no, I don't think the goal is to get rid of regrtest, it is just to make it as small as practical. Or to put it another way, to add the features of regrtest that are generally useful to unittest. -- ___

[issue10967] move regrtest over to using more unittest infrastructure

2013-03-02 Thread Ezio Melotti
Ezio Melotti added the comment: > I'd rather not have resources outside the local machine be accessed. Fair enough. > If you *also* want a way to skip tests based on resource when running > them outside regrtest, then unittest would have to grow a resource API. This can already be done though

[issue10967] move regrtest over to using more unittest infrastructure

2013-03-02 Thread R. David Murray
R. David Murray added the comment: No controversy on (1), we should just do that. I don't see a strong reason to change (2). I always run the test suite with -uall, but if I were running a restricted set I'd rather not have resources outside the local machine be accessed. My proposal is a wa

[issue17331] namedtuple raises a SyntaxError instead of ValueError on invalid identifier

2013-03-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the suggestion. isidentifier() was exactly what was needed. -- resolution: -> fixed status: open -> closed ___ Python tracker __

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2013-03-02 Thread Evgeny Kapun
Changes by Evgeny Kapun : -- nosy: +abacabadabacaba ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue17338] Add length_hint parameter to list, dict, set constructors to allow efficient presizing

2013-03-02 Thread Alex Gaynor
New submission from Alex Gaynor: Following the length_hint PEP, we should expose this facility to end-python programmers. The semantics would be basically: the list has behavior identical to if you hadn't provided length_hint, except the VM is free to preallocate efficiently. CPython (and PyP

[issue10967] move regrtest over to using more unittest infrastructure

2013-03-02 Thread Ezio Melotti
Ezio Melotti added the comment: There are actually three separate issues here: 1) The resources don't use unittest skip (or at least not always), so while running the tests without regrtests there are no indication that some tests have been skipped. This could be addressed by converting the cu

[issue10712] 2to3 fixer for deprecated unittest method names

2013-03-02 Thread Gregory P. Smith
Gregory P. Smith added the comment: Yes! 2to3 features are allowed in stable releases. On Mar 2, 2013 5:17 AM, "Ezio Melotti" wrote: > > Ezio Melotti added the comment: > > Can this still go on 2.7/3.2/3.3? > > -- > > ___ > Python tracker >

[issue10967] move regrtest over to using more unittest infrastructure

2013-03-02 Thread R. David Murray
R. David Murray added the comment: We have previously discussed adding resource-awareness to unittest, but that is a much bigger project (API design, scope considerations, etc etc). In the meantime, what we could do is modify the current resource-skip logic slightly: make it so that tests are

[issue17337] input() and raw_input() do not work correctly with colored prompts

2013-03-02 Thread Michael Enßlin
Michael Enßlin added the comment: The issue might very well be strictly related to GNU readline. I have both successfully reproduced it in a C program: #include #include int main() { readline("\x1b[31;1mthis is a bold red prompt\x1b[m> "); } gcc -lreadline test.c and found a fix, hi

[issue17032] Misleading error message: global name 'X' is not defined

2013-03-02 Thread Ram Rachum
Changes by Ram Rachum : Removed file: http://bugs.python.org/file29006/cpython_patch1of1_8e9346e7ae87.patch ___ Python tracker ___ ___ Python

[issue17032] Misleading error message: global name 'X' is not defined

2013-03-02 Thread Ram Rachum
Ram Rachum added the comment: (I fixed the patch to not have a typo.) -- Added file: http://bugs.python.org/file29290/cpython_patch1of1_8e9346e7ae87.patch.txt ___ Python tracker ___

[issue17032] Misleading error message: global name 'X' is not defined

2013-03-02 Thread Ezio Melotti
Ezio Melotti added the comment: Not yet, I wanted to make sure that everyone agrees on the change. If I don't get other replies I'll commit it soon. -- stage: -> patch review ___ Python tracker ___

[issue17337] input() and raw_input() do not work correctly with colored prompts

2013-03-02 Thread Ezio Melotti
Ezio Melotti added the comment: I can reproduce the issue, but only from the interactive interpreter while using input() directly (Linux/py3). I tried the following things: $ ./python -c 'print("\x1b[31;1mthis is a bold red prompt> \x1b[m", end=""); input()' $ ./python -c 'input("\x1b[31;1mthi

[issue17032] Misleading error message: global name 'X' is not defined

2013-03-02 Thread Ram Rachum
Ram Rachum added the comment: Was the patch applied? Is there any reason why it should not be applied? -- ___ Python tracker ___ ___ P

[issue17337] input() and raw_input() do not work correctly with colored prompts

2013-03-02 Thread mic_e
New submission from mic_e: With a prompt that uses ANSI color escape codes, python3 input() and python2 raw_input() behave incorrectly when it comes to the wrapping of the first line - almost certainly due to the wrong string length calculation. The line breaking occurs k characters early, wher

[issue17322] urllib.request add_header() currently allows trailing spaces (and other weird stuff)

2013-03-02 Thread karl
karl added the comment: http://hg.python.org/cpython/file/3.3/Lib/urllib/request.py#l359 def add_header(self, key, val): # useful for something like authentication self.headers[key.capitalize()] = val and http://hg.python.org/cpython/file/3.3/Lib/urllib/request.py#l271 in __

[issue15866] encode(..., 'xmlcharrefreplace') produces entities for surrogate pairs

2013-03-02 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue11787] File handle leak in TarFile lib

2013-03-02 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue10712] 2to3 fixer for deprecated unittest method names

2013-03-02 Thread Ezio Melotti
Ezio Melotti added the comment: Can this still go on 2.7/3.2/3.3? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue7855] Add test cases for ctypes/winreg for issues found in IronPython

2013-03-02 Thread Ezio Melotti
Ezio Melotti added the comment: Dino, what's the status of this? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue12301] Use :role:`sys.thing` instead of ``sys.thing`` throughout

2013-03-02 Thread Ezio Melotti
Changes by Ezio Melotti : -- type: -> enhancement versions: +Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue10716] Modernize pydoc to use better HTML and separate CSS

2013-03-02 Thread Ezio Melotti
Ezio Melotti added the comment: > Is there a prefered style guide for css that we should use? If you mean indentation/spacing, my preferred style is: selector { property1: value1; property2: value2; ... } FWIW I agree an HTML5 doctype should be used. -- __

[issue17336] Complex number representation round-trip doesn't work with signed zero values

2013-03-02 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue17334] Fix test discovery for test_index.py

2013-03-02 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks for the patch! -- assignee: -> ezio.melotti resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker _

[issue17334] Fix test discovery for test_index.py

2013-03-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset 886df716cd09 by Ezio Melotti in branch '3.3': #17334: test_index now works with unittest test discovery. Patch by Zachary Ware. http://hg.python.org/cpython/rev/886df716cd09 New changeset 1c71882938eb by Ezio Melotti in branch 'default': #17334: m

[issue17333] Fix test discovery for test_imaplib.py

2013-03-02 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks for the patch! As noted in msg183314, several tests are not included while using unittest discovery, but that's a separate issue. -- assignee: -> ezio.melotti resolution: -> fixed stage: -> committed/rejected status: open -> closed _

[issue17333] Fix test discovery for test_imaplib.py

2013-03-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset 02bbc5375a56 by Ezio Melotti in branch '3.3': #17333: test_imaplib now works with unittest test discovery. Patch by Zachary Ware. http://hg.python.org/cpython/rev/02bbc5375a56 New changeset b8bafae4a15a by Ezio Melotti in branch 'default': #17333:

[issue10967] move regrtest over to using more unittest infrastructure

2013-03-02 Thread Ezio Melotti
Ezio Melotti added the comment: > For one thing, I think resources could be implemented in terms of skips While working on #17333 I noticed a related problem. Most of the tests in test_imaplib are skipped if the 'network' resource is not specified. The test contains the following lines to en

[issue17336] Complex number representation round-trip doesn't work with signed zero values

2013-03-02 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti, mark.dickinson, skrah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue17336] Complex number representation round-trip doesn't work with signed zero values

2013-03-02 Thread Manuel Jacob
New submission from Manuel Jacob: When evaluating, signed zero complex numbers aren't recovered correctly. >>> -0j (-0-0j) >>> (-0-0j) 0j >>> 0j 0j According to http://docs.python.org/dev/reference/datamodel.html#object.__repr__ the representation can be used to recreate an object with the sam