[issue31956] Add start and stop parameters to the array.index()

2017-11-13 Thread STINNER Victor
STINNER Victor added the comment: Anders Lorentsen: Py_ssize_t is the correct type for an index in the C language. It's not technically possible to create an array object larger than PY_SSIZE_T_MAX items :-) Serhiy> Just take list.index as an example. I concur with

[issue32012] Disallow ambiguous syntax f(x for x in [1],)

2017-11-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is easy to forbid the above cases, but I don't know what error message is appropriate. General "invalid syntax"? -- ___ Python tracker

[issue32013] _pickle: Py_DECREF seems to be missing from a failure case in fast_save_enter()

2017-11-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 6ed9d4ecde8c3f0eeadf188f15a5bbd32b9d1145 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-32013: _pickle: Add missing Py_DECREF in error case in fast_save_enter() (GH-4384) (#4385)

[issue32013] _pickle: Py_DECREF seems to be missing from a failure case in fast_save_enter()

2017-11-13 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> resource usage versions: +Python 3.6 ___ Python tracker

[issue30696] infinite loop in PyRun_InteractiveLoopFlags()

2017-11-13 Thread Xavier de Gaye
Xavier de Gaye added the comment: Also the existing test coverage of these functions in all the Python versions is very weak. -- ___ Python tracker

[issue30696] infinite loop in PyRun_InteractiveLoopFlags()

2017-11-13 Thread STINNER Victor
STINNER Victor added the comment: Thanks for fixing this very old bug! What about Python 2.7? -- ___ Python tracker ___

[issue30696] infinite loop in PyRun_InteractiveLoopFlags()

2017-11-13 Thread Xavier de Gaye
Xavier de Gaye added the comment: > What about Python 2.7? _testcapi.set_nomemory() does not exist on Pyhton 2.7 so the changes cannot be tested. Applying the changes to PyRun_InteractiveLoopFlags() in 2.7 looks rather straightforward but there are too many differences in

[issue31956] Add start and stop parameters to the array.index()

2017-11-13 Thread Anders Lorentsen
Anders Lorentsen added the comment: Writing my tests, I originally looked at Lib/test/seq_tests.py. One test case uses indexes that are (+-)4*sys.maxsize. This does not fit in Py_ssize_t, and so these tests cause my array implementation to raise an overflow exception. A

[issue31963] AMD64 Debian PGO 3.x buildbot: compilation failed with an internal compiler error in create_edge

2017-11-13 Thread Gregory P. Smith
Gregory P. Smith added the comment: Given this is gcc exploding, I'm not sure there is anything we can do about it. I _believe_ we're doing everything right. -- ___ Python tracker

[issue32012] Disallow ambiguous syntax f(x for x in [1],)

2017-11-13 Thread Nick Coghlan
Nick Coghlan added the comment: In a function call, `f(x for x in iterable)` is roughly equivalent to `f(iter(iterable))`, not `f(*iterable)` (the genexp based equivalent of the latter would be ``f(*(x for x in iterable))`). Thus the base class list is no different from

[issue24294] DeprecationWarnings should be visible by default in the interactive REPL

2017-11-13 Thread Nick Coghlan
Nick Coghlan added the comment: I don't think anybody consistently does proper resource management in the REPL, so the trade-offs involved there are quite different from those for deprecation warnings. Assuming PEP 565 gets accepted, we'll end up with once-per-session

[issue1539925] warnings in interactive sessions

2017-11-13 Thread Nick Coghlan
Nick Coghlan added the comment: As a user, what would I actually gain from being warned more than once per session that a particular API I'm using is deprecated? If I want that behaviour, I can already opt in to it by doing "warnings.simplefilter('always')". As things

[issue24294] DeprecationWarnings should be visible by default in the interactive REPL

2017-11-13 Thread Aaron Meurer
Aaron Meurer added the comment: If it's of any interest to this discussion, for SymPy (for some time) we have used a custom subclass of DeprecationWarning that we enable by default https://github.com/sympy/sympy/blob/master/sympy/utilities/exceptions.py. I don't know if

[issue32012] Disallow ambiguous syntax f(x for x in [1],)

2017-11-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The problem with these constructions is that they are not allowed by the Python language specification. It should be explicitly changed for allowing them. And this change should be accepted by Guido. -- nosy:

[issue32020] arraymodule: Missing Py_DECREF in failure case of make_array()

2017-11-13 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6 ___ Python tracker

[issue32021] Brotli encoding is not recognized by mimetypes

2017-11-13 Thread Andrey Klinger
New submission from Andrey Klinger : Brotli (.br) encoding is not recognized by mimetypes module. mimetypes doesn't have API for adding encodings. The encoding is supported by most browsers: https://caniuse.com/#feat=brotli -- components: Library (Lib) messages:

[issue32020] arraymodule: Missing Py_DECREF in failure case of make_array()

2017-11-13 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4340 ___ Python tracker ___

[issue32020] arraymodule: Missing Py_DECREF in failure case of make_array()

2017-11-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 56935a53b11b9a70f3e13e460777ec81a5b9195e by Serhiy Storchaka (Mat M) in branch 'master': bpo-32020: arraymodule: Correct missing Py_DECREF in failure case of make_array() (#4391)

[issue32020] arraymodule: Missing Py_DECREF in failure case of make_array()

2017-11-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 18056fb11e6fe6e5247cd03073bd74df8ac0acc7 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-32020: arraymodule: Correct missing Py_DECREF in failure case of make_array() (GH-4391) (#4392)

[issue32020] arraymodule: Missing Py_DECREF in failure case of make_array()

2017-11-13 Thread Mathew M.
Change by Mathew M. : -- keywords: +patch pull_requests: +4339 stage: -> patch review ___ Python tracker ___

[issue32020] arraymodule: Missing Py_DECREF in failure case of make_array()

2017-11-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Mathew! -- ___ Python tracker ___

[issue32020] arraymodule: Missing Py_DECREF in failure case of make_array()

2017-11-13 Thread Mathew M.
New submission from Mathew M. : Similar to issue 32013, just in a different location. For reference: https://github.com/python/cpython/blob/28b624825eb92cb8c96fbf8da267d8d14a61a841/Modules/arraymodule.c#L1932 -- components: Extension Modules messages: 306183

[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-11-13 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___

[issue32015] Asyncio cycling during simultaneously socket read/write and reconnection

2017-11-13 Thread Andrey
Change by Andrey : -- keywords: +patch pull_requests: +4334 stage: -> patch review ___ Python tracker ___

[issue29184] skip tests of test_socketserver when bind() raises PermissionError (non-root user on Android)

2017-11-13 Thread Xavier de Gaye
Change by Xavier de Gaye : -- pull_requests: +4335 ___ Python tracker ___ ___

[issue32015] Asyncio looping during simultaneously socket read/write and reconnection

2017-11-13 Thread Andrey
Change by Andrey : -- title: Asyncio cycling during simultaneously socket read/write and reconnection -> Asyncio looping during simultaneously socket read/write and reconnection ___ Python tracker

[issue29587] Generator/coroutine 'throw' discards exc_info state, which is bad

2017-11-13 Thread Yury Selivanov
Yury Selivanov added the comment: Guido, The second example ("No active exception to reraise") was an actual long open bug. It was recently fixed by Mark Shannon in [1]. I think we should be able to fix the first case (missing __context__) although it's not critical.

[issue32015] Asyncio cycling during simultaneously socket read/write and reconnection

2017-11-13 Thread Andrey
New submission from Andrey : The bug is happened when the async reading/writing interrupted by other async method which reconnects the socket. The closed socket calls the appropriate handler in the loop due to cannot be removed due to wrong fileno of socket. --

[issue30696] infinite loop in PyRun_InteractiveLoopFlags()

2017-11-13 Thread STINNER Victor
STINNER Victor added the comment: Ok, I understand, thanks for the explanation. -- ___ Python tracker ___

[issue31963] AMD64 Debian PGO 3.x buildbot: compilation failed with an internal compiler error in create_edge

2017-11-13 Thread STINNER Victor
STINNER Victor added the comment: Same bug, again, AMD64 Debian PGO 3.x, so I reopen the issue: http://buildbot.python.org/all/#/builders/47/builds/159 Python/compile.c: In function ‘compiler_sync_comprehension_generator’: Python/compile.c:5457:1: internal compiler

[issue32012] Disallow ambiguous syntax f(x for x in [1],)

2017-11-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think this issue is not the best way for answering your question, but I will make a try. The fact that "class C(x for x in [object]): ..." does not cause a syntax error is a bug. This issue fixes it. The fact that corrected

[issue28369] Raise RuntimeError when transport's FD is used with add_reader etc

2017-11-13 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset ce12629c84400c52734859e43b2386deb2b6da12 by Yury Selivanov in branch 'master': bpo-28369: Enhance transport socket check in add_reader/writer (#4365)

[issue28369] Raise RuntimeError when transport's FD is used with add_reader etc

2017-11-13 Thread Yury Selivanov
Change by Yury Selivanov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue31979] Simplify converting non-ASCII strings to int, float and complex

2017-11-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 9b6c60cbce4ac45e8ccd7934babff465e9769509 by Serhiy Storchaka in branch 'master': bpo-31979: Simplify transforming decimals to ASCII (#4336)

[issue32016] Python 3.6.3 venv FAILURE

2017-11-13 Thread Larry Chen
New submission from Larry Chen : Upgraded from 3.6.1 to 3.6.3; but got an error when trying to create my virtual environment. [larrchen@rslab239 Larry]$ /opt/python3.6.3/bin/python3.6 -m venv /u/larrchen/work2/SAN/Users/Larry/rslab239_myENV_363 Error: Command

[issue31979] Simplify converting non-ASCII strings to int, float and complex

2017-11-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: As a side effect it slightly optimizes parsing non-ASCII numbers. $ ./python -m perf timeit --compare-to=./python0 'int("۱۲۳۴۵۶۷۸۹")' --duplicate 100 python0: . 277 ns +- 3 ns python: .

[issue31979] Simplify converting non-ASCII strings to int, float and complex

2017-11-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your review Victor. -- ___ Python tracker ___

[issue31979] Simplify converting non-ASCII strings to int, float and complex

2017-11-13 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue32012] Disallow ambiguous syntax f(x for x in [1],)

2017-11-13 Thread Henk-Jaap Wagenaar
Henk-Jaap Wagenaar added the comment: Currently, Class C(*some_classes): ... works 'as expected' and is within grammar and language specification whereas Class C(x for x in [object]): ... does not work but does not cause a syntax error. I can see a use

[issue32012] Disallow ambiguous syntax f(x for x in [1],)

2017-11-13 Thread Henk-Jaap Wagenaar
Henk-Jaap Wagenaar added the comment: [As a follow-on, should I open a new issue/discuss on python-dev? Willing to help out with a solution on way or another! I know https://en.wikipedia.org/wiki/Wikipedia:Chesterton%27s_fence, "In my head" <> "Should be the case"

[issue24294] DeprecationWarnings should be visible by default in the interactive REPL

2017-11-13 Thread STINNER Victor
STINNER Victor added the comment: If you consider that the REPL is designed for developers, I would also suggest to show ResourceWarning by default. I'm not sure of that since I like to write crappy code of REPL (and I hope that nobody logs my keyboard)! Example:

[issue31979] Simplify converting non-ASCII strings to int, float and complex

2017-11-13 Thread STINNER Victor
STINNER Victor added the comment: I don't think that the weird behaviour justify to backport this non-trivial change. I propose to only apply the change in Python 3.7. -- ___ Python tracker

[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-11-13 Thread STINNER Victor
STINNER Victor added the comment: Same buildbot, same bug: AMD64 Windows8.1 Refleaks 2.7 http://buildbot.python.org/all/#/builders/33/builds/26 == ERROR: test_use

[issue29185] test_distutils fails on Android API level 24

2017-11-13 Thread Xavier de Gaye
Change by Xavier de Gaye : -- versions: -Python 3.6 ___ Python tracker ___ ___

[issue31908] trace module cli does not write cover files

2017-11-13 Thread Michael Selik
Change by Michael Selik : -- nosy: +selik ___ Python tracker ___ ___ Python-bugs-list

[issue31908] trace module cli does not write cover files

2017-11-13 Thread Michael Selik
Michael Selik added the comment: You're referring to something like this: +def test_count_and_summary(self): +name = TESTFN + '.py' +with open(name, 'w') as fd: +self.addCleanup(unlink, name) +fd.write("""\ +x = 1 +y = 2 + +def f(): +

[issue32018] inspect.signature does not respect PEP 8

2017-11-13 Thread Guido van Rossum
Guido van Rossum added the comment: Those people who read and write annotations regularly are all using the convention that was added to PEP 8, so let's make inspect follow that lead rather than argue about it here. :-) -- nosy: +gvanrossum

[issue32018] inspect.signature does not respect PEP 8

2017-11-13 Thread R. David Murray
R. David Murray added the comment: Agreed. -- ___ Python tracker ___ ___

[issue32019] Interactive shell doesn't work with readline bracketed paste

2017-11-13 Thread Aaron Meurer
New submission from Aaron Meurer : Here are the steps to reproduce this: - Compile and link Python against readline version 7.0 or higher. - Add set enable-bracketed-paste on to your ~/.inputrc - Start python and paste the following two lines. Make sure to use a terminal

[issue32017] profile.Profile() has no method enable()

2017-11-13 Thread Antoine Pitrou
New submission from Antoine Pitrou : The section here is wrong as it claims that API is common to profile and cProfile. https://docs.python.org/3/library/profile.html#module-cProfile -- assignee: docs@python components: Documentation messages: 306169 nosy: docs@python,

[issue16055] incorrect error text for int(base=1000, x='1')

2017-11-13 Thread STINNER Victor
STINNER Victor added the comment: New changeset 28b624825eb92cb8c96fbf8da267d8d14a61a841 by Victor Stinner (Sanyam Khurana) in branch 'master': bpo-16055: Fixes incorrect error text for int('1', base=1000) (#4376)

[issue16055] incorrect error text for int(base=1000, x='1')

2017-11-13 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4338 ___ Python tracker ___

[issue31867] Duplicated keys in MIME type_map with different values

2017-11-13 Thread Henk-Jaap Wagenaar
Change by Henk-Jaap Wagenaar : -- keywords: +patch pull_requests: +4337 stage: -> patch review ___ Python tracker ___

[issue32018] inspect.signature does not respect PEP 8

2017-11-13 Thread R. David Murray
R. David Murray added the comment: FWIW, I find the version without the spaces to be more readable (but I don't find annotations to be readable in general, so my opinion may not be worth much :) -- nosy: +r.david.murray ___

[issue32018] inspect.signature does not respect PEP 8

2017-11-13 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___

[issue32018] inspect.signature does not respect PEP 8

2017-11-13 Thread Ivan Levkivskyi
New submission from Ivan Levkivskyi : The string representation of a function signature with annotations is currently like this: >>> def __init__(self, x: int = 1, y: int = 2) -> None: pass ... >>> import inspect >>> str(inspect.signature(__init__)) '(self, x:str=1,