[issue15657] Error in Python 3 docs for PyMethodDef

2017-01-10 Thread Martin Panter
Martin Panter added the comment: . The documentation did not get merged properly into 3.6+. And even in 3.5, under METH_KEYWORDS, I propose to change “The flag is typically combined with METH_VARARGS” to “The flag must be combined . . .”. The remaining issue15657_36.diff patch looks out of dat

[issue29137] Fix fpectl-induced ABI breakage

2017-01-10 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue28885] Python 3.5.2 strange-behavior issues (from PyPy)

2017-01-10 Thread Armin Rigo
Armin Rigo added the comment: (S6) 'xxx' % b'foo' == 'xxx' b'xxx' % b'foo' raises TypeError The first case is because PyMapping_Check() is true on b'foo', so it works like 'xxx' % {...}, which always just returns 'xxx'. The second case is because _PyBytes_Format() contains more special c

[issue28885] Python 3.5.2 strange-behavior issues (from PyPy)

2017-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Armin, it would help if you report all cases as separate issues. Some of them are already resolved, some can be closed with "won't fix" resolution, others need special discussions. This issue can be left as a metaissue. -- __

[issue28997] test_readline.test_nonascii fails on Android

2017-01-10 Thread Xavier de Gaye
Xavier de Gaye added the comment: Trying to track the 'char * text' pointer that is returned to Python by readline in rlhandler() and using gdb 'set follow-fork-mode child' and 'set detach-on-fork off' to stop (with a breakpoint in rlhandler) in the child spawned by run_pty() in test_nonascii,

[issue28997] test_readline.test_nonascii fails on Android

2017-01-10 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- assignee: xdegaye -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue29213] python -m venv activate.bat has weird mix of line endings

2017-01-10 Thread Evan
Evan added the comment: The scripts are being read in with mode 'rb', decoded, modified, then written back out with mode 'w'. This means the EOL conversion doesn't happen on the way in, but does happen on the way out, and so '\r\n' becomes '\r\r\n'. One fix would be to always use binary mode a

[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: testcapi_stack_pointer.patch: add _testcapi.stack_pointer() function. -- Added file: http://bugs.python.org/file46238/testcapi_stack_pointer.patch ___ Python tracker __

[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: stack_overflow_28870-sp.py: script using testcapi_stack_pointer.patch to compute the usage of the C stack. Results of this script. (*) Reference test_python_call: 7175 calls before crash, stack: 1168 bytes/call test_python_getitem: 6235 calls before crash, sta

[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: no_small_stack-2.patch: Remove all "small_stack" buffers. Reference test_python_call: 7175 calls before crash, stack: 1168 bytes/call test_python_getitem: 6235 calls before crash, stack: 1344 bytes/call test_python_iterator: 5344 calls before crash, stack: 1568

[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: > no_small_stack.patch: Oops, you should read no_small_stack-2.patch in my previous message ;-) -- ___ Python tracker ___ _

[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: Python 3.5 (revision 8125d9a8152b), before all fastcall changes: test_python_call: 8314 calls before crash, stack: 1008 bytes/call test_python_getitem: 7483 calls before crash, stack: 1120 bytes/call test_python_iterator: 6802 calls before crash, stack: 1232 byt

[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What are results with 3.4? There were several issues about stack overflow in 3.5 (issue25222, issue28179, issue28913). -- ___ Python tracker

[issue15216] Support setting the encoding on a text stream after creation

2017-01-10 Thread INADA Naoki
INADA Naoki added the comment: I had not read the patch carefully when updating. Now I'm reading pure Python part of the patch. For writing side, this patch is very simple. For reading side, this patch is very complex, because TextIOWrapper.tell() and .seek() is complex already. How about start

[issue15216] Support setting the encoding on a text stream after creation

2017-01-10 Thread INADA Naoki
INADA Naoki added the comment: This patch doesn't change current behavior of "decode by chunk". It's difficult to support changing encoding via header, like Python's encoding cookie. >>> import io >>> buff = io.BytesIO("hello\nこんにちは".encode('utf-8')) >>> f = io.TextIOWrapper(buff, encoding='asci

[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: Python 3.4 (rev 6340c9fcc111): test_python_call: 9700 calls before crash, stack: 864 bytes/call test_python_getitem: 8314 calls before crash, stack: 1008 bytes/call test_python_iterator: 7818 calls before crash, stack: 1072 bytes/call => total: 25832 calls, 294

[issue29223] Settable defaulting to decimal instead of float

2017-01-10 Thread George Fischhof
New submission from George Fischhof: Hi There, Settable defaulting to decimal instead of float It would be good to be able to use decimal automatically instead of float if there is a setting. For example an environment variable or a flag file. Where and when accuracy is more important than sp

[issue29224] OS related file operations (copy, move, delete, rename...) should be placed into one module

2017-01-10 Thread George Fischhof
New submission from George Fischhof: Hi There, OS related file operations (copy, move, delete, rename...) should be placed into one module... As it quite confusing that they are in two moduls (os and shutil). I have read that one is higher level than other, but actually to use them I have to

[issue29224] OS related file operations (copy, move, delete, rename...) should be placed into one module

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: You can design your own "oshutil" module which combines both modules. They are technical reasons to have two separated modules. -- nosy: +haypo ___ Python tracker

[issue29223] Settable defaulting to decimal instead of float

2017-01-10 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: This issue (and your other issue29223) would probably be a better for the python-ideas mailing list rather than the bug tracker. See the FAQ in the Developer Guide for Python https://docs.python.org/devguide/faq.html#suggesting-changes Both issues sho

[issue29223] Settable defaulting to decimal instead of float

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: You are not the first one to propose the idea. 2012: "make decimal the default non-integer instead of float?" https://mail.python.org/pipermail/python-ideas/2012-September/016250.html 2014: "Python Numbers as Human Concept Decimal System" https://mail.python.or

[issue29223] Settable defaulting to decimal instead of float

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: > This issue (and your other issue29223) ... I guess that you mean issue #29224 "OS related file operations (copy, move, delete, rename...) should be placed into one module". -- ___ Python tracker

[issue29224] OS related file operations (copy, move, delete, rename...) should be placed into one module

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: As Jim Fasarakis-Hilliard wrote in msg285117, the *bug* tracker is not the best place to propose changes, so I close this issue. -- resolution: -> not a bug status: open -> closed ___ Python tracker

[issue29223] Settable defaulting to decimal instead of float

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: Jim is right, I close the bug. The *bug* tracker is not the best place to propose ideas: please use the python-ideas mailing list ;-) -- resolution: -> not a bug status: open -> closed ___ Python tracker

[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: no_small_stack-2.patch has a very bad impact on performances: haypo@speed-python$ python3 -m perf compare_to 2017-01-04_12-02-default-ee1390c9b585.json no_small_stack-2_refee1390c9b585.json -G --min-speed=5 Slower (59): - telco: 15.7 ms +- 0.5 ms -> 23.4 ms +

[issue29224] OS related file operations (copy, move, delete, rename...) should be placed into one module

2017-01-10 Thread Eryk Sun
Changes by Eryk Sun : -- stage: -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thus Python 3.6 stack usage is about 20% larger than Python 3.5 and about 40% larger than Python 3.4. This is significant. :-( no_small_stack-2.patch decreases it only by 6% (with possible performance loss). -- __

[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: > no_small_stack-2.patch decreases it only by 6% (with possible performance > loss). Yeah, if we want to come back to Python 3.4 efficiency, we need to find the other functions which now uses more stack memory ;-) The discussed "small stack" buffers are only

[issue29208] BlockingIOError during system startup

2017-01-10 Thread Dustin Spicuzza
Dustin Spicuzza added the comment: I'm able to confirm that the patch does indeed fix the problem. Thanks everyone! -- ___ Python tracker ___

[issue1294959] Problems with /usr/lib64 builds.

2017-01-10 Thread jan matejek
jan matejek added the comment: at this again, when porting SUSE patches to 3.6.0 :) ( :( ) Last time there was a discussion, Barry suggested using sysconfig variables to find the proper libdir. Trouble is, to fill out the variables, sysconfig itself uses two sources: a) compiled-in information

[issue29225] distutils.command.install_lib.get_outputs() wrong with extensions built inplace

2017-01-10 Thread Elvis Stansvik
New submission from Elvis Stansvik: I noticed the following strange behavior: estan@newton:~/testdist$ find . ./testext.c ./setup.cfg ./setup.py estan@newton:~/testdist$ cat setup.py from distutils.core import setup, Extension setup( name='testdist', version='1.0.0', ext_modules =

[issue29225] distutils.command.install_lib.get_outputs() wrong with extensions built inplace

2017-01-10 Thread Elvis Stansvik
Changes by Elvis Stansvik : -- keywords: +patch Added file: http://bugs.python.org/file46241/fix-install-lib-with-inplace-ext.patch ___ Python tracker ___ __

[issue1294959] Problems with /usr/lib64 builds.

2017-01-10 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue29225] distutils.command.install_lib.get_outputs() wrong with extensions built inplace

2017-01-10 Thread Elvis Stansvik
Changes by Elvis Stansvik : -- versions: +Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: Stack used by each C function of test_python_call. 3.4: (a) method_call: 64 (b) PyObject_Call: 48 (b) function_call: 160 (b) PyEval_EvalCodeEx: 176 (c) PyEval_EvalFrameEx: 256 (c) call_function: 0 (c) do_call: 0 (c) PyObject_Call: 48 (d) slot_tp_call: 64 (d)

[issue29226] Comment generates syntax error

2017-01-10 Thread Simon Grantham
New submission from Simon Grantham: Placing the word "coding:" in a hash tag comment in a file causes a syntax error. Eg: ~ $ cat tst.py # coding: Wow! How odd! ~ $ python tst.py File "tst.py", line 2 SyntaxError: encoding problem: Wow ~ $ -- components: Interpreter Core messages:

[issue29226] Comment generates syntax error

2017-01-10 Thread Simon Grantham
Changes by Simon Grantham : -- type: -> compile error ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue29226] Comment generates syntax error

2017-01-10 Thread Ammar Askar
Ammar Askar added the comment: This is because the "coding:" in a comment is a special syntax used to define the encoding of the file. The only documentation I could find for it on the official docs is a brief mention here: https://docs.python.org/3/howto/unicode.html#the-string-type More det

[issue28885] Python 3.5.2 strange-behavior issues (from PyPy)

2017-01-10 Thread Armin Rigo
Armin Rigo added the comment: > Armin, it would help if you report all cases as separate issues. I asked on python-dev before creating these three issues, and got the opposite answer. If you decide it was a bad idea after all, I will open separate issues in the future. -- __

[issue22107] tempfile module misinterprets access denied error on Windows

2017-01-10 Thread Rocco Matano
Rocco Matano added the comment: I just experienced the described problem using Python 3.6.0 (Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32), but i do not understand the current status of this issue: On the one hand it is marked as 'open', which

[issue29226] encoding comment generates a SyntaxError

2017-01-10 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: If you use an encoding declaration the encoding must be recognized by Python. This is clearly stated in the documentation: https://docs.python.org/3/reference/lexical_analysis.html#encoding-declarations -- nosy: +Jim Fasarakis-Hilliard title:

[issue29226] Comment generates syntax error

2017-01-10 Thread Simon Grantham
Simon Grantham added the comment: Thanks Ammar. Curiously, the comment I had put in my code was a note regarding usage and actually didn't contain the word "coding:" but the word "encoding:". # curl -v --header "Transfer-Encoding: chunked" -d @somefile.txt "http://localhost:80/"; Perhaps th

[issue22107] tempfile module misinterprets access denied error on Windows

2017-01-10 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Library (Lib) resolution: fixed -> stage: resolved -> versions: +Python 3.7 -Python 3.4 ___ Python tracker ___ ___

[issue29227] Reduce C stack consumption in function calls

2017-01-10 Thread STINNER Victor
New submission from STINNER Victor: Attached patch reduce C stack consumption in function calls. It's the follow-up of the issue #28870. Reference (rev a30cdf366c02): test_python_call: 7175 calls before crash, stack: 1168 bytes/call test_python_getitem: 6235 calls before crash, stack: 1344 by

[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: I created the issue #29227 "Reduce C stack consumption in function calls" which contains a first simple patch with a significant effect on the C stack. -- ___ Python tracker _

[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: It seems like subfunc.patch approach using the "no inline" attribute helps. -- ___ Python tracker ___ __

[issue29226] Comment generates syntax error

2017-01-10 Thread Ammar Askar
Ammar Askar added the comment: Thanks for the link Jim, looks like my googling skills are a bit amiss. I believe the reason the matching allows "encoding" is because a recommended format in the documentation is: # vim:fileencoding= I think changing the behavior of the matching to be stricter

[issue29226] Comment generates syntax error

2017-01-10 Thread Simon Grantham
Simon Grantham added the comment: My googling skills are a bit amiss too. I searched for some kind of encoding pragma before reporting. Perhaps just a footnote in the basic documentation of a python comment is the easiest solution. Simon On 1/10/2017 12:58 PM, Ammar Askar wrote: > Ammar Ask

[issue29225] distutils.command.install_lib.get_outputs() wrong with extensions built inplace

2017-01-10 Thread Elvis Stansvik
Elvis Stansvik added the comment: Not really related to this fix, but a colleague also prudently pointed out that perhaps an assert file[:prefix_len] == build_dir + os.sep before the outputs.append(os.path.join(self.install_dir, file[prefix_len:])) in the helper for pure modules (_

[issue29228] sqlite3 OperationalError on changing into WAL transaction mode

2017-01-10 Thread yadayada
New submission from yadayada: Running sqlite3.connect('foo.db').execute("PRAGMA journal_mode = WAL") will throw sqlite3.OperationalError: cannot change into wal mode from within a transaction on Python 3.6.0, but not with older versions. -- messages: 285141 nosy: yadayada priority: n

[issue29228] sqlite3 OperationalError on changing into WAL transaction mode

2017-01-10 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the report. This is a duplicate of issue 28518. -- components: +Library (Lib) nosy: +berker.peksag resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> execute("begin immediate") throwing OperationalError type:

[issue28885] Python 3.5.2 strange-behavior issues (from PyPy)

2017-01-10 Thread Brett Cannon
Brett Cannon added the comment: I think if you're up for doing individual issues, Armin, that's preferred. But if it's too much work we will take it all in this single issue instead of risking the loss of the information. And if you want to use this issue as a meta one to track everything you

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-10 Thread Brett Cannon
Brett Cannon added the comment: The point Serhiy is trying to make is that not everyone needs or cares about setting specific file permissions. Python's built-in open() function has not supported this for 26 years and so there's obviously not that much of a need if this has not consistently co

[issue29113] modulefinder no longer finds all required modules for Python itself, due to use of __import__ in sysconfig

2017-01-10 Thread Brett Cannon
Brett Cannon added the comment: The limitation is unavoidable as modulefinder inspects bytecode for its inferencing, so any code that calls __import__() or importlib.import_module() will simply not work. So unless sysconfig can be updated reasonably back to a statically defined import this is

[issue29229] incompatible: unittest.mock.sentinel and multiprocessing.Pool.map()

2017-01-10 Thread Jason Curtis
New submission from Jason Curtis: When a sentinel object from unittest.mock.sentinel is passed through a multiprocessing.Pool.map, I expect it to still be comparable. As a user, I'd like to be able to write a unit test using sentinels on my unparallelized code, and then see that the test stil

[issue29227] Reduce C stack consumption in function calls

2017-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: $ ./python -m perf timeit -s "from bench_recursion import test_python_call as test" -- "test(1000)" Python 2.7: 5.10 ms +- 0.37 ms Python 3.4: 4.38 ms +- 0.28 ms Python 3.5: 4.19 ms +- 0.26 ms Python 3.6: 3.93 ms +- 0.32 ms Python 3.7: 3.26 ms +- 0.27 ms

[issue29219] TracebackException(capture_locals=True) may fail with RecursionError

2017-01-10 Thread Ilya Kulakov
Ilya Kulakov added the comment: I was not able to reproduce it. The origin "unhandeled" exception happens after ctypes.cdll.LoadLibrary fails to load a library: Traceback (most recent call last): File "...", line 852, in ... File ":/ctypes/__init__.py", line 425, in LoadLibrary File ":/c

[issue29229] incompatible: unittest.mock.sentinel and multiprocessing.Pool.map()

2017-01-10 Thread Davin Potts
Davin Potts added the comment: This arises from the behavior of pickle (which is used by default in multiprocessing to serialize objects sent to / received from other processes in data exchanges), as seen with Python 3.6: >>> import pickle >>> x = pickle.dumps(mock.sentinel.foo) >>> x b'\x80\x

[issue29230] Segfault in sqlite3

2017-01-10 Thread Daniel Fackrell
New submission from Daniel Fackrell: This crash occurs while running some unittests in one of our Django apps. It duplicates on all three versions I've tried (2.7.10, 2.7.12, and 2.7.13). I don't have a Python3-capable code to test against at present. It fails on my Mac OS system, and we can't

[issue29229] incompatible: unittest.mock.sentinel and multiprocessing.Pool.map()

2017-01-10 Thread Davin Potts
Davin Potts added the comment: I think this should be regarded as a duplicate of issue20804 though discussion in issue14577 is also related/relevant. -- superseder: -> Sentinels identity lost when pickled (unittest.mock) ___ Python tracker

[issue20804] Sentinels identity lost when pickled (unittest.mock)

2017-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch makes mock sentinels supporting pickling and copying. This allows passing them in multiprocessing. I'm not sure whether this is a bug fix or a new feature. The patch works only with 3.5+. Older versions need more complex solution. --

[issue29230] Segfault in sqlite3

2017-01-10 Thread Ned Deily
Ned Deily added the comment: Thanks for the report. From a quick look at the macOS crash report, I'm guessing you are running with the Apple-supplied system Python 2.7 but with a virtualenv. In any case, the Apple-supplied libsqlite3 is in use and there are previously reported problems using

[issue29219] TracebackException(capture_locals=True) may fail with RecursionError

2017-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch fixes an infinite recursion in a repr of uninitialized CDLL instance. -- keywords: +patch stage: -> patch review Added file: http://bugs.python.org/file46246/ctypes_cdll_uninitialized_repr.patch __

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: I don't understand the problem with umask(). It's standard and affect all code even C extension calling directly or indirectly open(). It is more secure to use umask() than setting mode on a few Python open() calls no? For example, Python creates .pyc files. You

[issue20804] Sentinels identity lost when pickled (unittest.mock)

2017-01-10 Thread Davin Potts
Davin Potts added the comment: Serhiy: The above discussion seemed to converge on the perspective that object identity should not survive pickling and that the point of a sentinel is object identity. While your proposed patch may mechanically work, I believe it is in conflict with the outcome

[issue29231] Broken MSIs in Python 3.5+

2017-01-10 Thread KeyWeeUsr
New submission from KeyWeeUsr: In versions _lower_ than 3.5.0 there was a `.MSI` installer for Windows, which had a really nice hidden option. That option looked like this: msiexec.exe /a "file.msi" /qb /L*V "file.log" ALLUSERS=0 TARGETDIR="target" CURRENTDIRECTORY="%cd%" which basically

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-10 Thread Christian Heimes
Christian Heimes added the comment: Victor, you are correct. That was exactly my point. The most secure way is to tighten security and set umask to 0o077. It's basically a white list or locked down approach. With umask 0o077 all subsequent files, directories and other resources will be created

[issue29232] Quiet Install

2017-01-10 Thread Earl Maier
New submission from Earl Maier: On quiet and passive Installs of Python 3.6 and 3.5 in windows 7 and 10 (x64), Python successfully installs but does not appear in programs and features. It would also appear that the append path and python launcher switches do not work for quiet install. If in

[issue29231] Broken MSIs in Python 3.5+

2017-01-10 Thread KeyWeeUsr
Changes by KeyWeeUsr : -- versions: +Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue29227] Reduce C stack consumption in function calls

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: Oh wow! I'm impressed that Python 3 is better at each release! On 2 tests, Python 3.7 is faster than Python 2.7, but on test_python_iterator Python 3.7 is still slower. It seems like this specific test became much slower (+19%) on Python 3.4 compared to 2.7.

[issue20804] Sentinels identity lost when pickled (unittest.mock)

2017-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, I had wrote this patch for issue29229 and didn't read the above discussion. Copying and pickling preserve identity of some objects: functions, classes, enums, builtin singletons (None, False, True, ...). It was not obvious to me that this shouldn't w

[issue29113] modulefinder no longer finds all required modules for Python itself, due to use of __import__ in sysconfig

2017-01-10 Thread Matthias Klose
Matthias Klose added the comment: the idea is that we load a different _sysconfigdata module when we are cross building packages. So we don't know the name in advance. An ugly alternative would be a big if statement with conditional imports for all known cross build targets. Not sure if this

[issue29227] Reduce C stack consumption in function calls

2017-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I didn't provide results with less_stack.patch because they were almost the same, just 1-3% faster. That might be just a random noise or compiler artifact. But may be an effect of inlining call_function(). Could you run full Python benchmarks? Decreasing the

[issue29227] Reduce C stack consumption in function calls

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: I plan to run a benchmark when all my patches to reduce the stack consumption will be ready. I'm still trying all the various options to reduce the stack consumption. I'm trying to avoid hacks and reduce the number of changes. I'm already better than Python 2.

[issue29233] call_method(): call _PyObject_FastCall() rather than _PyObject_VaCallFunctionObjArgs()

2017-01-10 Thread STINNER Victor
New submission from STINNER Victor: Recently, I modified call_method() and call_maybe() of Objects/typeobject.c to avoid the creation of a temporary tuple: replace Py_VaBuildValue()+PyObject_Call() with the new _PyObject_VaCallFunctionObjArgs(). But while working on the issue #28870, I notice

[issue29233] call_method(): call _PyObject_FastCall() rather than _PyObject_VaCallFunctionObjArgs()

2017-01-10 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue29233] call_method(): call _PyObject_FastCall() rather than _PyObject_VaCallFunctionObjArgs()

2017-01-10 Thread STINNER Victor
Changes by STINNER Victor : -- components: +Interpreter Core type: -> performance versions: +Python 3.7 ___ Python tracker ___ ___ Py

[issue29233] call_method(): call _PyObject_FastCall() rather than _PyObject_VaCallFunctionObjArgs()

2017-01-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset b9404639a18c by Victor Stinner in branch 'default': call_method() now uses _PyObject_FastCall() https://hg.python.org/cpython/rev/b9404639a18c -- nosy: +python-dev ___ Python tracker

[issue29233] call_method(): call _PyObject_FastCall() rather than _PyObject_VaCallFunctionObjArgs()

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: Full commit message: changeset: 106081:b9404639a18c tag: tip user:Victor Stinner date:Wed Jan 11 00:07:40 2017 +0100 files: Include/abstract.h Objects/abstract.c Objects/typeobject.c description: call_method() now uses _PyObject_

[issue29234] Disable inlining of _PyStack_AsTuple() to reduce the stack consumption

2017-01-10 Thread STINNER Victor
New submission from STINNER Victor: While working on the issue #28870, I noticed that _PyStack_AsTuple() is inlined. Compared to Python 3.5 which didn't have this function, it seems like _PyStack_AsTuple() is responsible for an increase of the stack consumption. -- components: Interpre

[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: I pushed 3 changes: * rev b9404639a18c: Issue #29233: call_method() now uses _PyObject_FastCall() * rev 8481c379e2da: Issue #29227: inline call_function() * rev 6478e6d0476f: Issue #29234: disable _PyStack_AsTuple() inlining Before (rev a30cdf366c02): test_py

[issue2771] Test issue

2017-01-10 Thread Brett Cannon
Changes by Brett Cannon : -- pull_requests: +11 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue29234] Disable inlining of _PyStack_AsTuple() to reduce the stack consumption

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: noinline_msvs.patch: implement _Py_NO_INLINE for Microsoft Visual Studio #elif defined(_MSC_VER) # define _Py_NO_INLINE __declspec(noinline) I didn't push this change because I don't have access to a Windows VM yet. @Steve: Does noinline_msvs.patch look good

[issue2771] Test issue

2017-01-10 Thread Brett Cannon
Changes by Brett Cannon : -- pull_requests: +12 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue29233] call_method(): call _PyObject_FastCall() rather than _PyObject_VaCallFunctionObjArgs()

2017-01-10 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue29227] Reduce C stack consumption in function calls

2017-01-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8481c379e2da by Victor Stinner in branch 'default': Inline call_function() https://hg.python.org/cpython/rev/8481c379e2da -- nosy: +python-dev ___ Python tracker _

[issue29234] Disable inlining of _PyStack_AsTuple() to reduce the stack consumption

2017-01-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6478e6d0476f by Victor Stinner in branch 'default': Disable _PyStack_AsTuple() inlining https://hg.python.org/cpython/rev/6478e6d0476f -- nosy: +python-dev ___ Python tracker

[issue2771] Test issue

2017-01-10 Thread Brett Cannon
Changes by Brett Cannon : -- pull_requests: +13 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue2771] Test issue

2017-01-10 Thread Brett Cannon
Changes by Brett Cannon : -- pull_requests: +14 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: Result of attached bench_recursion-2.py comparing before/after the 3 changes reducing the stack consumption: test_python_call: Median +- std dev: [a30cdf366c02] 512 us +- 12 us -> [6478e6d0476f] 467 us +- 21 us: 1.10x faster (-9%) test_python_getitem: Median +

[issue29229] incompatible: unittest.mock.sentinel and multiprocessing.Pool.map()

2017-01-10 Thread Jason Curtis
Jason Curtis added the comment: sounds right; closing as a duplicate of issue20804 -- resolution: -> duplicate status: open -> closed ___ Python tracker ___

[issue29235] Allow profile/cProfile to be used as context managers

2017-01-10 Thread Thane Brimhall
New submission from Thane Brimhall: The `enable` and `disable` methods on the profilers fit the description of a context manager very well. The following code: pr = cProfile.Profile() pr.enable() # ... do something ... pr.disable() pr.print_stats() Would turn into something

[issue29236] 'an ASCII string of one or more PEM-encoded certificates' needs to be unicode

2017-01-10 Thread Maciej Piechorka
New submission from Maciej Piechorka: In documentation it is specified that cadata parameter in load_verify_locations is 'an ASCII string of one or more PEM-encoded certificates'. However the code is actually determining it based on PyUnicode_Check function so the 'ASCII string' actually needs

[issue28839] _PyFunction_FastCallDict(): replace PyTuple_New() with PyMem_Malloc()

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: Ok, I give up on that one. I don't think that it's worth it. -- resolution: -> rejected status: open -> closed ___ Python tracker ___ _

[issue29237] Create enum for pstats sorting options

2017-01-10 Thread Thane Brimhall
New submission from Thane Brimhall: When using the cProfile and pstats modules, I often forget which string keys are available for sorting. It would be nice to add an enum for these so a user could have their linter and IDE check that value pre-runtime. By subclassing both `str` and `Enum` thi

[issue29237] Create enum for pstats sorting options

2017-01-10 Thread Ethan Furman
Ethan Furman added the comment: To keep backwards compatibility and lesson the burden on new code, simply make the value of the duplicate names be the same: cumulative = 'cumulative' cumtime = 'cumulative' This way the standard name is 'cumulative' but 'cumtime' works as well. ---

[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-01-10 Thread Thomas Nyberg
Thomas Nyberg added the comment: I'm attaching a small patch (against the current hg master branch) that I believe solves the problem, however, I think it was quite hacky. Here is a walk-through of the logic. 1) If '--system-site-packages' is requested, then it is overrided initially in the p

[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-01-10 Thread Thomas Nyberg
Thomas Nyberg added the comment: Now that I look over this thread again, I realize that my patch ended up basically evolving to being extremely similar to Mark Haase's. The only thing that I don't understand though is that he says that his shebangs are somehow messed up. For me the shebangs ar

[issue29234] Disable inlining of _PyStack_AsTuple() to reduce the stack consumption

2017-01-10 Thread Steve Dower
Steve Dower added the comment: I'm fairly sure dllexport implies noinline, and it certainly does for the exported function (but maybe PGO will inline it within the module? hard to know). In any case, I agree with keeping it private as it's purely about optimization. Do you have a test that ca

[issue29238] Add more kwargs to cProfile's print_stats

2017-01-10 Thread Thane Brimhall
New submission from Thane Brimhall: Using the pstats class to print off profiler results is helpful when you want to filter, order, and limit the number of returned lines. I'd rather see the most commonly-used subset of pstats functionality included in the profiler's print_stats implementation

  1   2   >