[issue26180] multiprocessing.util._afterfork_registry leak in threaded environment

2016-01-25 Thread Milan Zamazal
Milan Zamazal added the comment: Python 3.x version attached. -- Added file: http://bugs.python.org/file41706/bug3.py ___ Python tracker ___ _

[issue26187] sqlite3 trace callback prints duplicate line

2016-01-25 Thread Xiang Zhang
Changes by Xiang Zhang <18518281...@126.com>: -- nosy: +xiang.zhang ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue26140] inspect.iscoroutinefunction raises TypeError when checks Mock of function or coroutinefunction

2016-01-25 Thread Michael Foord
Changes by Michael Foord : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue26196] Argparse breaks when a switch is given an argument beginning with a dash

2016-01-25 Thread Charles Daffern
New submission from Charles Daffern: Example code demonstrating the problem: # {{{ import argparse def try_args(*args): parser = argparse.ArgumentParser() parser.add_argument("-a") print("Trying:", args) try: print(parser.parse_args(args)) except SystemExit:

[issue26196] Argparse breaks when a switch is given an argument beginning with a dash

2016-01-25 Thread SilentGhost
SilentGhost added the comment: If you're to drop the space between the argument and its value, e.g. try_args('-a-a'), it seems to work as intended. The third example ( try_args("-a", "--")) still wouldn't work, but it looks like a reasonable workaround to me. -- nosy: +SilentGhost, bet

[issue26197] arange from numpy function has some limits....I propose a python function that overcome

2016-01-25 Thread Francesco Pelizza
New submission from Francesco Pelizza: arange from numpy is a function to generate list of floats from a start to an end number with a defined float number. The "arange" function works fine for some cases, but in my case where I have to generate numbers that constitute parameters in a Quantum

[issue26197] arange from numpy function has some limits....I propose a python function that overcome these limitations

2016-01-25 Thread STINNER Victor
STINNER Victor added the comment: It looks like an issue for numpy no? http://www.scipy.org/scipylib/bug-report.html I'm not sure that such function fits into Python stdlib. -- nosy: +haypo ___ Python tracker ___

[issue26197] arange from numpy function has some limits....I propose a python function that overcome these limitations

2016-01-25 Thread Francesco Pelizza
Changes by Francesco Pelizza : -- title: arange from numpy function has some limitsI propose a python function that overcome -> arange from numpy function has some limitsI propose a python function that overcome these limitations ___ Python

[issue26197] arange from numpy function has some limits....I propose a python function that overcome these limitations

2016-01-25 Thread Emanuel Barry
Emanuel Barry added the comment: NumPy isn't a part of CPython. As haypo said, please submit that to their tracker instead. -- nosy: +ebarry resolution: -> third party stage: -> resolved status: open -> closed ___ Python tracker

[issue26146] PEP 511: Add ast.Constant to allow AST optimizer to emit constants

2016-01-25 Thread STINNER Victor
STINNER Victor added the comment: Patch version 3: fix a reference leak in validate_constant(). -- Added file: http://bugs.python.org/file41708/constant-3.patch ___ Python tracker __

[issue24923] Append system paths in setup.py instead of prepending

2016-01-25 Thread Chris Hogan
Chris Hogan added the comment: Zach, 3.x had the desired behavior. We didn't have to make any changes. -- ___ Python tracker ___ __

[issue26189] Interpreter returns control to cmd.exe early

2016-01-25 Thread Ivan Pozdeev
Ivan Pozdeev added the comment: @eryksun tried that already, same effect: C:\>start /b /w python -c "print 'bla-bla-bl a'; raise SystemExit(42)" C:\>bla-bla-bla echo %errorlevel% 0 I'll try to pinpoint the issue to an OS/OS family/update or Python version. --

[issue26198] PyArg_ParseTuple with format "et#" and "es#" detects overflow by raising TypeError instead of ValueError

2016-01-25 Thread Hrvoje Nikšić
New submission from Hrvoje Nikšić: The documentation for the "es#" format (and the "et#" that derives from it) documents the possibility of providing an already allocated buffer. Buffer overflow is detected and handled as follows: "If the buffer is not large enough, a ValueError will be set."

[issue26198] PyArg_ParseTuple with format "et#" and "es#" detects overflow by raising TypeError instead of ValueError

2016-01-25 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: The problem can be encountered and easily reproduced by calling os.path functions, such as os.path.abspath, with a sufficiently large string on Windows: >>> os.path.abspath("a" * 1024) Traceback (most recent call last): File "", line 1, in File "P:\...\lib\

[issue26199] fix broken link to hamcrest.library.integration.match_equality in unittest.mock "getting started" documentation

2016-01-25 Thread Raphael Das Gupta
New submission from Raphael Das Gupta: On * https://docs.python.org/3.3/library/unittest.mock-examples.html#more-complex-argument-matching * https://docs.python.org/3.4/library/unittest.mock-examples.html#more-complex-argument-matching * https://docs.python.org/3.5/library/unittest.mock-examp

[issue24923] Append system paths in setup.py instead of prepending

2016-01-25 Thread Zachary Ware
Zachary Ware added the comment: In that case, does this patch do what you want it to do? -- stage: -> patch review Added file: http://bugs.python.org/file41710/issue24923.diff ___ Python tracker __

[issue26199] fix broken link to hamcrest.library.integration.match_equality in unittest.mock "getting started" documentation

2016-01-25 Thread Raphael Das Gupta
Changes by Raphael Das Gupta : -- keywords: +patch Added file: http://bugs.python.org/file41709/0d413f60cc23.diff ___ Python tracker ___ _

[issue26199] fix broken link to hamcrest.library.integration.match_equality in unittest.mock "getting started" documentation

2016-01-25 Thread Raphael Das Gupta
Raphael Das Gupta added the comment: 0d413f60cc23.diff generated with the 'Create Patch' button of this bug tracker is crap. (I guess it's a diff of upstream's tip to my repo's tip, thus reverting all changes of upstream that this daggy fix isn't based on.) Use fix-broken-link-to-pyhamcrest-ma

[issue26196] Argparse breaks when a switch is given an argument beginning with a dash

2016-01-25 Thread Eric V. Smith
Eric V. Smith added the comment: I believe this is a duplicate of issue 9334. There's a lot of discussion there. -- nosy: +eric.smith stage: -> resolved status: open -> closed superseder: -> argparse does not accept options taking arguments beginning with dash (regression from optpars

[issue25783] test_traceback.test_walk_stack() fails when run directly (without regrtest)

2016-01-25 Thread STINNER Victor
STINNER Victor added the comment: @Robert: Can you please take a look at the attached patch? Does it look good to you? -- ___ Python tracker ___

[issue24923] Append system paths in setup.py instead of prepending

2016-01-25 Thread Chris Hogan
Chris Hogan added the comment: I should be able to try it out today or tomorrow. I'll let you know. -- ___ Python tracker ___ ___ Pyt

[issue26200] SETREF adds unnecessary work in some cases

2016-01-25 Thread Raymond Hettinger
New submission from Raymond Hettinger: Application of the SETREF macro was not code neutral in a number of cases. The SETREF macro always uses Py_XDECREF where the original code correctly used a faster and lighter Py_DECREF. There should be an XSETREF variant and more care should be taken whe

[issue26189] Interpreter returns control to cmd.exe early

2016-01-25 Thread Eryk Sun
Eryk Sun added the comment: That the wait failed to get the 42 exit code means that the "python" command (which may not actually be python.exe) is spawning a child process to run the command and not waiting for it to exit. Please try the following using the absolute path to python.exe: C:

[issue26198] PyArg_ParseTuple with format "et#" and "es#" detects overflow by raising TypeError instead of ValueError

2016-01-25 Thread Barun Parruck
Barun Parruck added the comment: I just changed the ValueError to TypeError. This is my first attempt at fixing anything, so let me know if I've screwed up anywhere. -- keywords: +patch nosy: +Barun Parruck Added file: http://bugs.python.org/file41712/typeerror.patch __

[issue26189] Interpreter returns control to cmd.exe early

2016-01-25 Thread Ivan Pozdeev
Ivan Pozdeev added the comment: @eryksun That's it! "python" was actually launching a shortcut in my "shortcuts to often-used commands around the system" folder! Thank goodness (this time, "Goodness" is Brian Curtin with 90617:a9d34685ec47, Sat May 10 12:52:59 2014 -0500 (so tell him he can ad

[issue26198] PyArg_ParseTuple with format "et#" and "es#" detects overflow by raising TypeError instead of ValueError

2016-01-25 Thread Barun Parruck
Barun Parruck added the comment: Added a patch that changes the documentation to reflect TypeError instead of ValueError* -- ___ Python tracker ___ _

[issue26201] Faster type checking in listobject.c

2016-01-25 Thread Raymond Hettinger
New submission from Raymond Hettinger: A number of fine-grained methods in Objects/listobject.c use PyList_Check(). They include PyList_Size, PyList_GetItem, PyList_SetItem, PyList_Insert, and PyList_Append. The PyList_Check() works by making two sequentially dependent memory fetches: mo

[issue26201] Faster type checking in listobject.c

2016-01-25 Thread Jeremy Kloth
Jeremy Kloth added the comment: Added review -- nosy: +jkloth ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue26201] Faster type checking in listobject.c

2016-01-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please provide any microbencmarks that show the benefit of this optimization? -- ___ Python tracker ___ ___

[issue26202] The range() object is deepcopied as atomic

2016-01-25 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: The range() object is immutable, but is not atomic, and copy.deepcopy() shouldn't return it unchanged. >>> class I(int): pass # mutable index ... >>> import copy >>> r = range(I(10)) >>> r2 = copy.deepcopy(r) >>> r.stop.attr = 'spam' >>> r2.stop.attr 'spa

[issue26189] Interpreter returns control to cmd.exe early

2016-01-25 Thread Eryk Sun
Eryk Sun added the comment: By shortcut I'm guessing you mean a batch file. A regular .LNK shortcut works fine if .LNK is in PATHEXT. I sometimes use a shortcut when I need to set the default to "Run as administrator". (I add a "runas" verb to the ProgIds to add this option to the menu for .PY

[issue26203] nesting venv in virtualenv segfaults

2016-01-25 Thread André Caron
New submission from André Caron: When trying to create a new virtual environment using Python 3.5's venv package from a virtual environment created by the popular 3rd-party virtualenv package, I get a segfault. Nested virtual environments work fine both with venv and virtualenv, but using on

[issue25833] pyvenv: venvs cannot be moved because activate scripts hard-code paths

2016-01-25 Thread André Caron
Changes by André Caron : -- nosy: +André Caron ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue26201] Faster type checking in listobject.c

2016-01-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Jeremy, thanks for the keen eyes. Attaching a revised patch. Serhiy, pure python code doesn't directly access any of the C-API functions touched by the patch, so timeit-style examples aren't possible. The beneficiaries of the change are external modules.

[issue26203] nesting venv in virtualenv segfaults

2016-01-25 Thread Florian Bruhin
Changes by Florian Bruhin : -- nosy: +The Compiler, dstufft, vinay.sajip ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue26202] The range() object is deepcopied as atomic

2016-01-25 Thread STINNER Victor
STINNER Victor added the comment: Hum ok, it's a bug :-) It should be fixed. Do you want to work on a patch? -- ___ Python tracker ___ ___

[issue26202] The range() object is deepcopied as atomic

2016-01-25 Thread Ethan Furman
Ethan Furman added the comment: I don't have much experience with the copy module, but I don't see any problems with the code. Does copy.copy suffer from the same problem? If yes, is it fixed with this same patch, or is more work needed? -- nosy: +ethan.furman __

[issue26202] The range() object is deepcopied as atomic

2016-01-25 Thread Ethan Furman
Ethan Furman added the comment: Victor, patch was already attached. ;) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue26201] Faster type checking in listobject.c

2016-01-25 Thread STINNER Victor
STINNER Victor added the comment: > Could you please provide any microbencmarks that show the benefit of this > optimization? Yeah, analyzing the assembler seems overkill to me. I'm not sure that it really make the code faster (but it makes the code more complex). -- nosy: +haypo ___

[issue26202] The range() object is deepcopied as atomic

2016-01-25 Thread STINNER Victor
STINNER Victor added the comment: deepcopy_range.patch looks good to me. -- ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue26202] The range() object is deepcopied as atomic

2016-01-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Returning the same range() object from copy.copy() is correct. This is shallow copying. -- ___ Python tracker ___ ___

[issue26183] 2.7.11 won't clean install on Windows 10 x64

2016-01-25 Thread Roger Cook
Roger Cook added the comment: Installing a VM and running it there, it installs. Is there a manual removal procedure to follow when the automated uninstall fails? -- resolution: -> not a bug status: open -> closed ___ Python tracker

[issue26201] Faster type checking in listobject.c

2016-01-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Writing your own static optimizer from scratch is overkill. Following basic techniques from the Agner Fog manuals and Intel optimization manuals is quite reasonable in comparison. Unless you see an actual defect in the patch, I'm applying it. --

[issue26189] Interpreter returns control to cmd.exe early

2016-01-25 Thread Ivan Pozdeev
Ivan Pozdeev added the comment: @eryksun That is (was) an .lnk indeed, and adding ".lnk" to PATHEXT is exactly what I did to make it work. This is much more maintainable than registry hacks. An .lnk is launched with ShellExecute which returns control immediately upon successful launch (see ht

[issue26203] nesting venv in virtualenv segfaults

2016-01-25 Thread Vinay Sajip
Vinay Sajip added the comment: By design, the stdlib venv functionality expects to work from an installed Python. However, the Python in a virtualenv venv is not an installed Python - it copies some files from the Python it was installed from and does various other hacks in order to work (I'm

[issue26201] Faster type checking in listobject.c

2016-01-25 Thread STINNER Victor
STINNER Victor added the comment: > Unless you see an actual defect in the patch, I'm applying it. Well, Serhiy Storchaka asked for a microbenchmark. For an optimization, it's a reasonable request no? > Writing your own static optimizer from scratch is overkill. My goal is to get speedup on

[issue26146] PEP 511: Add ast.Constant to allow AST optimizer to emit constants

2016-01-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 27e5437f442c by Victor Stinner in branch 'default': Add ast.Constant https://hg.python.org/cpython/rev/27e5437f442c -- ___ Python tracker _

[issue26146] PEP 511: Add ast.Constant to allow AST optimizer to emit constants

2016-01-25 Thread STINNER Victor
STINNER Victor added the comment: I pushed an enhanced version of constant-3.patch: * fix the compiler: don't emit LOAD_CONST for ast.Constant if the value is a string (str) or a number (int, float, complex), as done previously for ast.Str and ast.Num * add unit tests on: the compiler (ensure

[issue26201] Faster type checking in listobject.c

2016-01-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Well, Serhiy Storchaka asked for a microbenchmark. > For an optimization, it's a reasonable request no? As noted above, it not reasonable for a C-API that isn't used internally because there is no reasonable way to measure the effect without writing a C

[issue26204] compiler: don't emit LOAD_CONST instructions for constant expressions?

2016-01-25 Thread STINNER Victor
New submission from STINNER Victor: The bytecode compilers ignores ast.Str and ast.Num nodes: >>> def func(): ... 123 ... "test" ... >>> import dis; dis.dis(func) 3 0 LOAD_CONST 0 (None) 3 RETURN_VALUE

[issue26204] compiler: don't emit LOAD_CONST instructions for constant statements?

2016-01-25 Thread STINNER Victor
Changes by STINNER Victor : -- title: compiler: don't emit LOAD_CONST instructions for constant expressions? -> compiler: don't emit LOAD_CONST instructions for constant statements? ___ Python tracker

[issue26201] Faster type checking in listobject.c

2016-01-25 Thread STINNER Victor
STINNER Victor added the comment: > As noted above, it not reasonable for a C-API that isn't used internally > because there is no reasonable way to measure the effect without writing a C > extension. Come on, there is a lot of C functions in Python using the C PyList_xxx() API. It's easy to

[issue26201] Faster type checking in listobject.c

2016-01-25 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +pitrou, yselivanov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue26205] Inconsistency concerning nested scopes

2016-01-25 Thread Roscoe R.Higgins
New submission from Roscoe R.Higgins: In chapter 9. Classes of the Python3.5 documentation it says: "At any time during execution, there are at least three nested scopes whose namespaces are directly accessible:", followed by a list containing 4 items. Further down a middle scope is mentioned

[issue26201] Faster type checking in listobject.c

2016-01-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: I've lost interest in talking with you. AFAICT you aren't doing anything to help advance or study the patch. You're just being a PITA and are now enlisting people to gang-up on a trivial patch. This is disgusting. -- status: open -> closed _

[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Mark, Serhiy and Timmy, do you have any thoughts on what is the right behavior? One option is to always pop the rightmost element to make room, but that results in a weird asymmetry between d.insert(len(d), item) and what d.append(item) would do. I can't s

[issue23794] http package should support HTTP/2

2016-01-25 Thread Fantix King
Changes by Fantix King : -- nosy: +Fantix King ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue18898] Apply the setobject optimizations to dictionaries

2016-01-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Hi, what's the status of this issue? Is anyone working one it? In the present environment, I feel like advancing this work would be an uphill battle and that much of my time investment would be wasted unnecessarily. That's too bad, because significant r&d

[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-25 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- keywords: +patch Added file: http://bugs.python.org/file41717/full_deque.diff ___ Python tracker ___ ___

[issue26189] Interpreter returns control to cmd.exe early

2016-01-25 Thread Eryk Sun
Eryk Sun added the comment: > An .lnk is launched with ShellExecute which returns control > immediately upon successful launch cmd calls ShellExecuteEx, not ShellExecute, and it uses the flags SEE_MASK_NO_CONSOLE (0x8000, don't create a new console) and SEE_MASK_NOCLOSEPROCESS (0x0040, return

[issue26204] compiler: don't emit LOAD_CONST instructions for constant statements?

2016-01-25 Thread Yury Selivanov
Yury Selivanov added the comment: The patch looks alright. Will the following code compile OK? What will it compile to? if 1: 42 -- ___ Python tracker ___ ___

[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Another take: Do a regular insertion with no special cases, followed by a pop from the right: >>> for i in range(len(d) + 1): s = list(d) s.insert(i, None) _ = s.pop() print(i, s) 0 [None, 'a', 'b'] 1 ['a', None

[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-25 Thread Raymond Hettinger
Changes by Raymond Hettinger : Added file: http://bugs.python.org/file41718/full_deque_alt.diff ___ Python tracker ___ ___ Python-bugs-list ma