[issue25885] ast Str type does not annotate the string type when it parses a python document

2015-12-16 Thread Myron Walker
New submission from Myron Walker: The 'ast' module does not indicate the type of string, ''' or '"' or '"""', that it has encountered when it parses a python document. This prevents accurate reproduction of the original parsed document by a writer walking over an instance of a abstract syntax

[issue25885] ast Str type does not annotate the string type when it parses a python document

2015-12-16 Thread SilentGhost
Changes by SilentGhost : -- components: +Library (Lib) nosy: +benjamin.peterson, brett.cannon, georg.brandl, ncoghlan stage: -> test needed ___ Python tracker

[issue25884] inspect.getmro() fails when base class lacks __bases__ attribute.

2015-12-16 Thread Brandon Zerbe
Brandon Zerbe added the comment: I am using Python 2.7.5.  The segment of code from inspect that I previously extracted came from line 332 although you may also find it by "finding" _searchbases. This is really an issue with Forthon: http://hifweb.lbl.gov/Forthon/ Specifically the Forthon

[issue25883] python 2.7.11 mod_wsgi regression on windows

2015-12-16 Thread Steve Dower
Steve Dower added the comment: This is probably the registry key issue25824. That'll often show up as an import error on site if you're loading python##.dll while outside of an install directory. Without the key, it can't find its way to the stdlib. Try renaming the registry key as described

[issue25885] ast Str type does not annotate the string type when it parses a python document

2015-12-16 Thread Brett Cannon
Brett Cannon added the comment: Two things. One, this won't change in Python 2.7 due to compatibility, so this only applies to Python 3.6. Two, the AST has not been designed to support round-trip syntax transpiling, e.g. there is no way to get back comments in the source code. Because the

[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-16 Thread SilentGhost
Changes by SilentGhost : -- nosy: +SilentGhost ___ Python tracker ___ ___

[issue25885] ast Str type does not annotate the string type when it parses a python document

2015-12-16 Thread R. David Murray
R. David Murray added the comment: Unlike the tokenizer, I don't think the AST module makes any guarantee about being able to reproduce the original source. This might be a reasonable enhancement request, though. -- nosy: +r.david.murray ___

[issue25885] ast Str type does not annotate the string type when it parses a python document

2015-12-16 Thread R. David Murray
R. David Murray added the comment: Please respect the decisions of the python core developers as to issue status (you can argue with us until we ask you to stop, but let us make the status change if you convince us :) We aren't rejecting your ideas, just this bug report (as not being a bug).

[issue25886] ast module is combining string literals that are concatenated with plus operator

2015-12-16 Thread Brett Cannon
Changes by Brett Cannon : -- resolution: duplicate -> not a bug ___ Python tracker ___ ___

[issue25849] files, opened in unicode (text): write() returns symbols count, but seek() expect offset in bytes

2015-12-16 Thread Martin Panter
Martin Panter added the comment: I think changing the TextIOBase API would be hard to do if you want to keep compatibility with existing code. I agree that encoding the position to a number and back seems like a bad design, but I doubt it is worth changing it at this point. --

[issue25887] awaiting on coroutine more than once should be an error

2015-12-16 Thread Martin Panter
Martin Panter added the comment: It should always be valid to create a new coroutine instance. Perhaps you meant: instance = foo() print(await instance) # Okay the first time print(await instance) # Second time should be an error This seems sensible, at least for 3.6. Maybe it should also be

[issue25886] ast module is combining string literals that are concatenated with plus operator

2015-12-16 Thread SilentGhost
SilentGhost added the comment: Hm, I'm going to close this as duplicate since a commenter in your previous issue clearly stated: "I don't think the AST module makes any guarantee about being able to reproduce the original source". -- nosy: +SilentGhost, benjamin.peterson,

[issue25891] Stray variable meth_idx in enable_symlink

2015-12-16 Thread Alexander Riccio
New submission from Alexander Riccio: See: https://hg.python.org/cpython/file/tip/Modules/posixmodule.c#l12383 The variable int meth_idx is initialized but not used. I have no idea how it got there. -- components: Windows messages: 256553 nosy: Alexander Riccio, paul.moore,

[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-16 Thread Martin Panter
Martin Panter added the comment: With patch v4 many tests still fail for me. How are you running the test suite? Some excerpts: File "/media/disk/home/proj/python/cpython/Lib/test/datetimetester.py", line 1567, in test_isoformat self.assertEqual(t.isoformat(timespec='milliseconds'),

[issue25893] Second variable DWORD reqdSize in getpythonregpath is initialized but not used

2015-12-16 Thread Alexander Riccio
New submission from Alexander Riccio: See: https://hg.python.org/cpython/file/tip/PC/getpathp.c#l324 The second variable named `reqdSize` in getpythonregpath is initialized but not used. -- components: Windows messages: 256555 nosy: Alexander Riccio, paul.moore, steve.dower,

[issue25888] awaiting on coroutine that is being awaited should be an error

2015-12-16 Thread Guido van Rossum
Guido van Rossum added the comment: Right. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue25887] awaiting on coroutine more than once should be an error

2015-12-16 Thread Guido van Rossum
Guido van Rossum added the comment: OK, but only for await (not for yield from). -- ___ Python tracker ___

[issue25887] awaiting on coroutine more than once should be an error

2015-12-16 Thread Yury Selivanov
Yury Selivanov added the comment: > OK, but only for await (not for yield from). Sure, generators will stay untouched (I'll even add a unittest for that, if we don't have it). > It should always be valid to create a new coroutine instance. Perhaps you > meant: Correct, Martin, great that

[issue25890] PyObject *po in _listdir_windows_no_opendir is initialized but not used

2015-12-16 Thread Alexander Riccio
New submission from Alexander Riccio: See: https://hg.python.org/cpython/file/tip/Modules/posixmodule.c#l3466 The variable PyObject *po in _listdir_windows_no_opendir is initialized but not used. Given that there's a variable named po_wchars, and two PyObject variables, I'm going to guess

[issue25890] PyObject *po in _listdir_windows_no_opendir is initialized but not used

2015-12-16 Thread Alexander Riccio
Alexander Riccio added the comment: (in the same function, char *bufptr is ALSO unused) -- ___ Python tracker ___

[issue25886] ast module is combining string literals that are concatenated with plus operator

2015-12-16 Thread STINNER Victor
STINNER Victor added the comment: "The fact that ast combines strings and does not maintain the original syntax of the document means that original syntax information is lost and a writer walking the abstract syntax tree is unable to reproduce the original syntax of the document." You should

[issue25886] ast module is combining string literals that are concatenated with plus operator

2015-12-16 Thread Myron Walker
Myron Walker added the comment: My thought on this is that a syntax tree needs to accurately represent parsed syntax of the code. Two strings being concatenated contain syntax information that is different from a single string. "Hello" + " World" Is not the same syntax as: "Hello

[issue25892] PyObject *exc in encode_code_page_strict is initialized but not used

2015-12-16 Thread Alexander Riccio
New submission from Alexander Riccio: See: https://hg.python.org/cpython/file/tip/Objects/unicodeobject.c#l7335 The variable PyObject *exc in encode_code_page_strict is initialized but not used. -- components: Windows messages: 256554 nosy: Alexander Riccio, paul.moore, steve.dower,

[issue25886] ast module is combining string literals that are concatenated with plus operator

2015-12-16 Thread R. David Murray
R. David Murray added the comment: By the way, if you want to talk about enhancing the AST module to be more useful to your use cases, the python-ideas mailing list would be the right place to raise the topic (you might want to look for earlier relevant discussions first, I'm pretty sure

[issue25885] ast Str type does not annotate the string type when it parses a python document

2015-12-16 Thread Myron Walker
Myron Walker added the comment: I am re-opening this as I believe this is an important issue for work I would like to eventually push into the python core which is python code that recode themselves as declarations or as instance representation. "I don't see any benefit in supporting this

[issue25034] string.Formatter accepts empty fields but displays wrong when nested

2015-12-16 Thread John Mark Vandenberg
Changes by John Mark Vandenberg : -- nosy: +jayvdb ___ Python tracker ___ ___

[issue25878] CPython on Windows builds with /W3, not /W4

2015-12-16 Thread Alexander Riccio
Alexander Riccio added the comment: > The problem with this bug report is that there is little chance that it gets > resolved in the near term, and it's quite possible that it will stay open for > years. Somebody would have to sit down and start producing patches to fix > these warnings

[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-16 Thread SilentGhost
SilentGhost added the comment: Even that produces 3 failures on my setup, though the full list would be available when running: ./python -m test -v test_datetime It is obvious, however, that the tests would fail: you've changed "if us:" to "if us is None:". --

[issue25886] ast module is combining string literals that are concatenated with plus operator

2015-12-16 Thread Myron Walker
New submission from Myron Walker: ast module is combining string literals that are concatenated with plus operator into a single string in the parsestrplus module rather than maintaining the true syntax tree of the original document. The fact that ast combines strings and does not maintain

[issue21815] imaplib truncates some untagged responses

2015-12-16 Thread Lita Cho
Lita Cho added the comment: Had some trouble setting up my dev environment for Python. Definitely going to work on it today and tomorrow. On Tue, Dec 8, 2015 at 12:33 PM, Maciej Szulik wrote: > > Maciej Szulik added the comment: > > Perfect, thanks! > > -- > >

[issue25885] ast Str type does not annotate the string type when it parses a python document

2015-12-16 Thread Myron Walker
Myron Walker added the comment: The purpose of a syntax tree is to represent the syntax and not a final processed result of processing of syntax. The current information stored for strings is losing syntax information which seems to defeat the purpose of offering the information in a syntax

[issue25888] awaiting on coroutine that is being awaited should be an error

2015-12-16 Thread Yury Selivanov
New submission from Yury Selivanov: This problem was discussed in one of the asyncio issues here: https://github.com/python/asyncio/issues/288 I propose to raise a RuntimeError if an 'await' expression is used for a coroutine object that's being awaited on already. This change shouldn't

[issue25885] ast Str type does not annotate the string type when it parses a python document

2015-12-16 Thread R. David Murray
R. David Murray added the comment: Oh, that was weird. I got a weird error message from roundup. Must have been because I was posting at the same time as Brett. I'll defer to his decision on this. -- stage: test needed -> resolved ___ Python

[issue25887] awaiting on coroutine more than once should be an error

2015-12-16 Thread Yury Selivanov
New submission from Yury Selivanov: async def foo(): return 123 print(await foo()) # will print 123 print(await foo()) # prints None print(await foo()) # prints None The above code illustrates the current behaviour. I propose to change it, so that second 'await' will trigger a

[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-16 Thread Alessandro Cucci
Alessandro Cucci added the comment: Uploaded a new patch (v4): DONE: - now all tests work (I also added one more) - removed non ascii chars - added milliseconds and nanoseconds as multiple of microseconds - removed code duplication in the datetime.py - update the docstring. TODO: > The doc

[issue25886] ast module is combining string literals that are concatenated with plus operator

2015-12-16 Thread R. David Murray
R. David Murray added the comment: Also note that this probably mirrors the behavior of the actual compiler (I haven't checked). -- nosy: +r.david.murray ___ Python tracker

[issue25889] Find_BOM accepts a char*, but is passed an unsigned char*; and related usage

2015-12-16 Thread Alexander Riccio
New submission from Alexander Riccio: This is safe, but warns on /W4. In maybe_handle_shebang, an unsigned char* is passed to find_BOM, which accepts a char* (https://hg.python.org/cpython/file/tip/PC/launcher.c#l1139). Without an explicit cast, this generates a warning:

[issue25849] files, opened in unicode (text): write() returns symbols count, but seek() expect offset in bytes

2015-12-16 Thread Марк Коренберг
Марк Коренберг added the comment: Well, 03e61104f7a2 adds good description, why not to enforce checks instead of saying that some values are unsupported ? Also, idea in returning special object instance from tell(), this object should incapsulate byte offset. And allow for the seek() either

[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2015-12-16 Thread Alessandro Cucci
Alessandro Cucci added the comment: I just did that... ~/Documenti/cpython$ ./configure --with-pydebug ~/Documenti/cpython$ make -s -j2 ~/Documenti/cpython$ ./python -m test -v datetimetester ... ... -- Ran 325 tests in 1.128s

[issue25885] ast Str type does not annotate the string type when it parses a python document

2015-12-16 Thread STINNER Victor
STINNER Victor added the comment: "Would adding proper storage of syntax information in the AST cause performance issues?" Exactly. And storing syntax information is useless for 90% of usages of AST. So Python is optimized for the most common cases. Again, use a different project (like

[issue25885] ast Str type does not annotate the string type when it parses a python document

2015-12-16 Thread Myron Walker
Myron Walker added the comment: Would it be prudent to add a Parse flag to the AST module that could provide one of two types of AST's an optimized AST or a complete AST -- ___ Python tracker

[issue25894] unittest subTest failure causes result to be omitted from listing

2015-12-16 Thread Zachary Ware
New submission from Zachary Ware: The title can barely be called accurate; the description of the problem isn't easy to condense to title length. Here's the issue: $ cat subtest_test.py import os import unittest class TestClass(unittest.TestCase): def test_subTest(self): for t

[issue25895] urllib.parse.urljoin does not handle WebSocket URLs

2015-12-16 Thread Martin Panter
Martin Panter added the comment: The documentation should probably also be updated. It has a list of supported schemes. I imagine this would have to be taken as a new feature for 3.6+, rather than a bug fix. An alternative would be to enable joining for arbitrary schemes; see Issue 18828.

[issue25895] urllib.parse.urljoin does not handle WebSocket URLs

2015-12-16 Thread Yury Selivanov
Yury Selivanov added the comment: Gergely, the patch looks alright. Please sign the contributor agreement and we'll have it merged. -- nosy: +yselivanov ___ Python tracker

[issue25895] urllib.parse.urljoin does not handle WebSocket URLs

2015-12-16 Thread Gergely Imreh
Gergely Imreh added the comment: Just signed it, thanks! -- ___ Python tracker ___ ___ Python-bugs-list

[issue25809] "Invalid" tests on locales

2015-12-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Just commit to 3.4, merge forward, and push. I don't think there is need to pick up this in the final 3.4.4 release. But this can be picked up by maintainers of specific Linux distributions if new libc will come with the non-breaking space for French

[issue25651] Confusing output for TestCase.subTest(0)

2015-12-16 Thread Zachary Ware
Zachary Ware added the comment: I think Ezio's suggestion of a sentinel value would be better, allowing None to be using as a legitimate 'message' [1]. That is, somewhere at global scope, define '_subtest_msg_sentinel = object()', change the msg default at Lib/unittest/case.py:500 to be

[issue25864] collections.abc.Mapping should include a __reversed__ that raises TypeError

2015-12-16 Thread Andrew Barnert
Andrew Barnert added the comment: @Swati Jaiswal: > But the work around suggested here ... is also not a general solution, i.e. > ... for any other mapping which does not have 0 as a key, it results in > KeyError. You're missing the point. The workaround isn't intended to be a general

[issue25864] collections.abc.Mapping should include a __reversed__ that raises TypeError

2015-12-16 Thread Andrew Barnert
Andrew Barnert added the comment: @R. David Murray: > What is it that makes reversed raise a typeerror on dict here? There are separate slots for tp_as_sequence and tp_as_mapping, so a C type can be (and generally is) one or the other, not both. But for Python types, anything that has

[issue25895] urllib.parse.urljoin does not handle WebSocket URLs

2015-12-16 Thread Gergely Imreh
New submission from Gergely Imreh: Handling the "ws" and "wss" schemes of the WebSocket protocol in urllib.parse.urlparse was discussed in a previous issue http://bugs.python.org/issue13244 Parsing them seems to work correctly: >>> urllib.parse.urlparse("wss://domain/endpoint")

[issue25809] "Invalid" tests on locales

2015-12-16 Thread koobs
koobs added the comment: Just to note, the koobs-freebsd-current buildbot is still failing on 3.4, which reminded me to re-open -- ___ Python tracker

[issue25878] CPython on Windows builds with /W3, not /W4

2015-12-16 Thread Alexander Riccio
Alexander Riccio added the comment: Cut out more noisy warnings. -- Added file: http://bugs.python.org/file41333/W4_v3.patch ___ Python tracker ___

[issue25864] collections.abc.Mapping should include a __reversed__ that raises TypeError

2015-12-16 Thread R. David Murray
R. David Murray added the comment: No, the workaround was for duplicating the existing behavior if the fix (raising an error like a normal dict does) broken someone's code. The *only* possibility here is to have a __reversed__ that raises a TypeError. What is it that makes reversed raise a

[issue25878] CPython on Windows builds with /W3, not /W4

2015-12-16 Thread Zachary Ware
Zachary Ware added the comment: At this point our MSBuild project files are hand-crafted, and are best edited by hand. You can use the GUI to get a general idea of what the changes should be, but it just creates far too much spam to really be usable. This should be about a 2 line change, but

[issue25809] "Invalid" tests on locales

2015-12-16 Thread koobs
koobs added the comment: Re-open for 3.4 merge -- status: closed -> open versions: +Python 3.4 ___ Python tracker ___

[issue5501] Update multiprocessing docs re: freeze_support

2015-12-16 Thread Davin Potts
Changes by Davin Potts : -- nosy: +rhettinger ___ Python tracker ___ ___

[issue25864] collections.abc.Mapping should include a __reversed__ that raises TypeError

2015-12-16 Thread Swati Jaiswal
Swati Jaiswal added the comment: But the work around suggested here as: def __reversed__(self): return (self[k] for k in reversed(range(len(self is also not a general solution, i.e. it is applicable for the following case: m = MyDict({2:40, 0:10, 1:20}) but for any other mapping

[issue25882] argparse help error: arguments created by add_mutually_exclusive_group() are shown outside their parent group created by add_argument_group()

2015-12-16 Thread paul j3
paul j3 added the comment: I've attached a file that monkey patches the _ActionsContainer._add_container_actions method. It corrects the `_container` attribute of the copied mutually exclusive groups. I've only tested it for the case presented in this issue (and the relate Stackoverflow

[issue5501] Update multiprocessing docs re: freeze_support

2015-12-16 Thread Davin Potts
Davin Potts added the comment: Thank you, Winterflower, for the nudge to see this set right. In truth, invoking multiprocessing.freeze_support() has zero effect on platforms other than Windows. This should be reflected in the 2.7 docs as well as the 3.x docs that are still actively being

[issue5501] Update multiprocessing docs re: freeze_support

2015-12-16 Thread Davin Potts
Changes by Davin Potts : Added file: http://bugs.python.org/file41331/issue_5501_explicit_freeze_support_nonWin_v3x.patch ___ Python tracker

[issue25881] A little faster ElementTree serializing

2015-12-16 Thread Martin Panter
Martin Panter added the comment: Suggested further speedup -- nosy: +martin.panter ___ Python tracker ___ ___

[issue25894] unittest subTest failure causes result to be omitted from listing

2015-12-16 Thread Martin Panter
Martin Panter added the comment: Okay, so you have a test with subtests. You have presented three cases: 1. Single subtest which passes. No problem I assume. 2. Two subtests: 1st fails, 2nd passes. This is how subtests are normally used, so I guess there is no problem. Is that right? 3.

[issue24103] Use after free in xmlparser_setevents (1)

2015-12-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- dependencies: +Use Py_REPLACE/Py_XREPLACE macros ___ Python tracker ___

[issue25881] A little faster ElementTree serializing

2015-12-16 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch makes ElementTree serializing to xml and html formats a little faster. For example the write_utf8_parse_bytesIO test from lxml benchmark suite now is up to 5% faster, tostring_utf8 now is up to 9% faster. Even with this patch, serializing

[issue25880] u'..'.encode('idna') → UnicodeError: label empty or too long

2015-12-16 Thread SpaceOne
SpaceOne added the comment: But why is the error UnicodeError instead of UnicodeEncodeError? -- resolution: not a bug -> status: closed -> open ___ Python tracker

[issue25880] u'..'.encode('idna') → UnicodeError: label empty or too long

2015-12-16 Thread R. David Murray
R. David Murray added the comment: Why does it matter? If you want to suggest changing it, you could propose a patch. Maybe in reading the code you'll find out why it is the way it is now. I haven't looked at that code in a while myself, so I don't remember if there is a reason or not :)

[issue25883] python 2.7.11 mod_wsgi regression on windows

2015-12-16 Thread stephan
stephan added the comment: No, I didn't report this to the mod_wsgi folks. -- ___ Python tracker ___ ___

[issue25880] u'..'.encode('idna') → UnicodeError: label empty or too long

2015-12-16 Thread R. David Murray
R. David Murray added the comment: The error message is accurate. That string has empty label segments in it, which RFC 5890 defines as an error on encoding. There is no such error defined for decoding, so that doesn't raise an error. I don't see anything wrong with the error message, it

[issue25880] u'..'.encode('idna') → UnicodeError: label empty or too long

2015-12-16 Thread R. David Murray
Changes by R. David Murray : -- status: open -> closed ___ Python tracker ___ ___

[issue25883] python 2.7.11 mod_wsgi regression on windows

2015-12-16 Thread R. David Murray
R. David Murray added the comment: Regardless of where the bug lies, we're probably going to need the mod_wsgi folks to help debug it. Have you reported it to them as well? -- nosy: +r.david.murray ___ Python tracker

[issue25883] python 2.7.11 mod_wsgi regression on windows

2015-12-16 Thread stephan
New submission from stephan: Hi, I use apache 32 bit on windows with mod_wsgi for my trac instance, and other django instances which are attached by reverse-proxy. With python (32bit) 2.7.10 it works, but as soon as I updated to python 2.7.11 apache doesn't work anymore (it does not respond to

[issue25884] inspect.getmro() fails when base class lacks __bases__ attribute.

2015-12-16 Thread Brandon Zerbe
New submission from Brandon Zerbe: I am using a possibly non-standard python package called Forthon, and when I inspect an object that is dependent on the Forthon class, I get the following error: File "/Users/zerbeb/homemade_programs/config2class/src/method_parsing.py", line 18, in

[issue25882] argparse help error: arguments created by add_mutually_exclusive_group() are shown outside their parent group created by add_argument_group()

2015-12-16 Thread Balázs Regényi
New submission from Balázs Regényi: So, a parent parser is created. It has a "global arguments" group (by add_argument_group()) and this group has a mutually exclusive group. Then a child parser is created used previous parser as parent. The error: in the child parser help: the arguments of

[issue25884] inspect.getmro() fails when base class lacks __bases__ attribute.

2015-12-16 Thread R. David Murray
R. David Murray added the comment: Which version of python are you running? I can't match that traceback up to the code in the current 2.7 inspect module. That said, the same issue probably exists in the current code. A 2.7 class is expected to have either an __mro__ or a __bases__

[issue25880] u'..'.encode('idna') → UnicodeError: label empty or too long

2015-12-16 Thread SpaceOne
New submission from SpaceOne: Python 3.4.2 (default, Oct 8 2014, 10:45:20) >>> u'..'.encode('idna') Traceback (most recent call last): File "/usr/lib/python3.4/encodings/idna.py", line 165, in encode raise UnicodeError("label empty or too long") UnicodeError: label empty or too long The

[issue25874] Add notice that XP is not supported on Python 3.5+

2015-12-16 Thread SilentGhost
SilentGhost added the comment: Hm, may be I'm seeing things, but the content of the current what's new section is this: Windows XP is no longer supported by Microsoft, thus, per :PEP:`11`, CPython 3.5 is no longer officially supported on this OS. The proposed patch adds two sentences on

[issue25878] CPython on Windows builds with /W3, not /W4

2015-12-16 Thread Martin v . Löwis
Martin v. Löwis added the comment: The problem with this bug report is that there is little chance that it gets resolved in the near term, and it's quite possible that it will stay open for years. Somebody would have to sit down and start producing patches to fix these warnings correctly,