[issue24821] The optimization of string search can cause pessimization

2017-03-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for testing Louie. Thank you for your review and testing Xiang. > Would it completely kill performances to remove the optimization? Yes. The optimization is not used if the lowest byte is 0. You can try to search "\0" for getting the result

[issue22240] argparse support for "python -m module" in help

2017-03-29 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue29932] Missing word ("be") in error message ("first argument must a type object")

2017-03-29 Thread SylvainDe
Changes by SylvainDe : -- pull_requests: +790 ___ Python tracker ___ ___

[issue29935] list and tuple index methods should accept None parameters

2017-03-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +789 ___ Python tracker ___ ___

[issue29941] Confusion between asserts and Py_DEBUG

2017-03-29 Thread Thomas Wouters
Thomas Wouters added the comment: Ugh, I logged in with the wrong OpenID without noticing; that was supposed to be me ;-P -- nosy: +twouters ___ Python tracker

[issue29941] Confusion between asserts and Py_DEBUG

2017-03-29 Thread Thomas Wouters
New submission from Thomas Wouters: There is a bit of confusion in the CPython source between Py_DEBUG and (C) asserts. By default Python builds without Py_DEBUG and without asserts (definining NDEBUG to disable them). Turning on Py_DEBUG also enables asserts. However, it *is* possible to

[issue29942] Stack overflow in itertools.chain.from_iterable.

2017-03-29 Thread Thomas Wouters
New submission from Thomas Wouters: itertools.chain.from_iterable (somewhat ironically) uses recursion to resolve the next iterator, which means it can run out of the C stack when there's a long run of empty iterables. This is most obvious when building with low optimisation modes, or with

[issue29942] Stack overflow in itertools.chain.from_iterable.

2017-03-29 Thread Thomas Wouters
Changes by Thomas Wouters : -- type: -> crash ___ Python tracker ___ ___ Python-bugs-list

[issue29935] list and tuple index methods should accept None parameters

2017-03-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: The error message should be fixed and the API should be left alone. A *None* value doesn't do a good jog of communicating intent. -- nosy: +rhettinger ___ Python tracker

[issue29935] list and tuple index methods should accept None parameters

2017-03-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Raymond. Proposed patch fixes error messages and doesn't change the public API. -- stage: -> patch review type: enhancement -> behavior versions: +Python 2.7, Python 3.5, Python 3.6 ___ Python

[issue29940] Add follow_wrapped=True option to help()

2017-03-29 Thread Samwyse
New submission from Samwyse: The help(obj) function uses the type of obj to create its result. This is less than helpful when requesting help on a wrapped object. Since 3.5, inspect.signature() and inspect.from_callable() have a follow_wrapped option to get around similar issues. Adding

[issue29941] Confusion between asserts and Py_DEBUG

2017-03-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +haypo, serhiy.storchaka ___ Python tracker ___

[issue29932] Missing word ("be") in error message ("first argument must a type object")

2017-03-29 Thread Brett Cannon
Brett Cannon added the comment: New changeset a90e64b78d74b80a7cbcca2237280c724b99431b by Brett Cannon (Sylvain) in branch 'master': bpo-29932: Fix small error message typos in arraymodule.c (GH-888) https://github.com/python/cpython/commit/a90e64b78d74b80a7cbcca2237280c724b99431b --

[issue29942] Stack overflow in itertools.chain.from_iterable.

2017-03-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +rhettinger stage: -> patch review versions: +Python 2.7, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker

[issue29935] list and tuple index methods should accept None parameters

2017-03-29 Thread George King
George King added the comment: I think it is a mistake not to support None values. Please consider: The existing message clearly suggests that the intent is to support the same set of values as the start/stop parameters of the slice type. str, bytes, and bytearray all support None for

[issue29932] Missing word ("be") in error message ("first argument must a type object")

2017-03-29 Thread Brett Cannon
Changes by Brett Cannon : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue29880] python3.6 install readline ,and then cpython exit

2017-03-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +pitrou ___ Python tracker ___ ___

[issue15797] bdist_msi does not pass -install/remove flags to install_script

2017-03-29 Thread Ned Deily
Changes by Ned Deily : -- nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker ___

[issue29677] clarify docs about 'round()' accepting a negative integer for ndigits

2017-03-29 Thread Cheryl Sabella
Cheryl Sabella added the comment: Mariatta, Thank you so much for your support and encouragement while I worked on my first PR. You've made this an awesome experience! -- ___ Python tracker

[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-03-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: My apologies for breaking the world. The workaround is to undefine PySlice_GetIndicesEx after #include "Python.h". #if PY_VERSION_HEX < 0x0307 && defined(PySlice_GetIndicesEx) #undef PySlice_GetIndicesEx #endif But this restores the initial bug. Other

[issue29533] urllib2 works slowly with proxy on windows

2017-03-29 Thread Julia Dolgova
Julia Dolgova added the comment: May be I described the problem not clearly enough, because English is not my native language, so I try to explain once again. In Windows there is an option "Do not use proxy server for address beginning with". I call this option . This option is invented for

[issue29938] subprocess.run calling bash on windows10 cause 0x80070057 error when capture stdout with PIPE

2017-03-29 Thread Eryk Sun
Eryk Sun added the comment: The initial release of WSL doesn't support passing non-console standard handles from Windows to Linux, or vice versa. It will work if you switch to a Windows Insider preview build. Otherwise you'll have to wait for the Windows 10 Creators Update. See the

[issue29938] subprocess.run calling bash on windows10 cause 0x80070057 error when capture stdout with PIPE

2017-03-29 Thread Eryk Sun
Changes by Eryk Sun : -- resolution: not a bug -> third party ___ Python tracker ___ ___

[issue16011] "in" should be consistent with return value of __contains__

2017-03-29 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: New changeset fd704a02ca8713b0dae644f7f182f3e3d1218dbf by Mariatta in branch '2.7': bpo-16011: clarify that 'in' always returns a boolean value (GH-152) (GH-883) https://github.com/python/cpython/commit/fd704a02ca8713b0dae644f7f182f3e3d1218dbf --

[issue15797] bdist_msi does not pass -install/remove flags to install_script

2017-03-29 Thread Henry Borchers
Henry Borchers added the comment: Any progress on this? It seems to still be an issue in Python 3.6. -- nosy: +loneraver versions: +Python 3.6 -Python 2.7, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker

[issue29677] clarify docs about 'round()' accepting a negative integer for ndigits

2017-03-29 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- stage: needs patch -> backport needed ___ Python tracker ___

[issue16011] "in" should be consistent with return value of __contains__

2017-03-29 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Thanks everyone :) Patch has been merged and backported to 3.6, 3.5, and 2.7. -- resolution: -> fixed stage: backport needed -> resolved status: open -> closed ___ Python tracker

[issue29677] clarify docs about 'round()' accepting a negative integer for ndigits

2017-03-29 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: New changeset 85deefcf61d3cc192846f41a4ccc6df17da60c98 by Mariatta (csabella) in branch 'master': bpo-29677: DOC: clarify documentation for `round` (GH-877) https://github.com/python/cpython/commit/85deefcf61d3cc192846f41a4ccc6df17da60c98 --

[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-03-29 Thread Nathaniel Smith
New submission from Nathaniel Smith: In the process of fixing issue 27867, a new function PySlice_AdjustIndices was added, and PySlice_GetIndicesEx was converted into a macro that calls this new function. The patch was backported to both the 3.5 and 3.6 branches, was released in 3.6.1, and is

[issue29880] python3.6 install readline ,and then cpython exit

2017-03-29 Thread pz
pz added the comment: I have unistall readline and install gnureadline,but cpyton also crashed # ./pip3 install gnureadline Collecting gnureadline Installing collected packages: gnureadline Running setup.py install for gnureadline ... done Successfully installed gnureadline-6.3.3 #

[issue15797] bdist_msi does not pass -install/remove flags to install_script

2017-03-29 Thread Steve Dower
Steve Dower added the comment: Unless this is documented somewhere, it's a new feature in a deprecated module. You can easily produce a third-party distutils command that does this differently, but I see limited benefit in changing this command. I'd also need to dig deeper to learn how

[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-03-29 Thread Steve Dower
Changes by Steve Dower : -- nosy: +steve.dower ___ Python tracker ___ ___

[issue9146] Segfault in hashlib in OpenSSL FIPS mode using non-FIPS-compliant hashes, if "ssl" imported before "hashlib"

2017-03-29 Thread Kevin Christopher
Kevin Christopher added the comment: I tripped over this exact issue a few months ago, while working on a FIPSified OpenSSL library (custom platform). Attached a different (more minimal) patch; this one focuses more narrowly on the exact failure mode. It's based on 'master' (~3.7), applies

[issue29677] clarify docs about 'round()' accepting a negative integer for ndigits

2017-03-29 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +795 ___ Python tracker ___ ___

[issue29677] clarify docs about 'round()' accepting a negative integer for ndigits

2017-03-29 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: New changeset 2609c9ee78c53d501914a5a90dbe094d9a8c3c97 by Mariatta in branch '3.6': bpo-29677: DOC: clarify documentation for `round` (GH-877) (GH-892) https://github.com/python/cpython/commit/2609c9ee78c53d501914a5a90dbe094d9a8c3c97 --

[issue29677] clarify docs about 'round()' accepting a negative integer for ndigits

2017-03-29 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Gerrit, Cheryl, thanks and congrats for your first contributions to CPython! They've been merged and backported to 3.5 and 3.6. So I'm closing this now. Thanks all :) -- resolution: -> fixed stage: backport needed -> resolved status: open -> closed

[issue9146] Segfault in hashlib in OpenSSL FIPS mode using non-FIPS-compliant hashes, if "ssl" imported before "hashlib"

2017-03-29 Thread Gregory P. Smith
Gregory P. Smith added the comment: I like your patch, raising an exception is indeed the right thing to do. i'll get this patch in. whether or not the built-in non-openssl based _md5 and _sha1 module exist in "fips" mode is a separate build time issue - lets keep this one just dealing with

[issue29677] clarify docs about 'round()' accepting a negative integer for ndigits

2017-03-29 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +796 ___ Python tracker ___ ___

[issue29677] clarify docs about 'round()' accepting a negative integer for ndigits

2017-03-29 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: New changeset eef6e11f9883f54de491121b8c49fdadd3e3506d by Mariatta in branch '3.5': bpo-29677: DOC: clarify documentation for `round` (GH-877) (GH-893) https://github.com/python/cpython/commit/eef6e11f9883f54de491121b8c49fdadd3e3506d --

[issue29917] Wrong link target in PyMethodDef documentation

2017-03-29 Thread Senthil Kumaran
Changes by Senthil Kumaran : -- pull_requests: +798 ___ Python tracker ___ ___

[issue29917] Wrong link target in PyMethodDef documentation

2017-03-29 Thread Senthil Kumaran
Changes by Senthil Kumaran : -- pull_requests: +799 ___ Python tracker ___ ___

[issue29917] Wrong link target in PyMethodDef documentation

2017-03-29 Thread Senthil Kumaran
Changes by Senthil Kumaran : -- pull_requests: +797 ___ Python tracker ___ ___

[issue29917] Wrong link target in PyMethodDef documentation

2017-03-29 Thread Senthil Kumaran
Senthil Kumaran added the comment: New changeset d1dbbaab01354f01faa696aff1280db3b349e354 by Senthil Kumaran in branch '3.5': bpo-29917: DOC: Remove link from PyMethodDef (#890) (#895) https://github.com/python/cpython/commit/d1dbbaab01354f01faa696aff1280db3b349e354 --

[issue29917] Wrong link target in PyMethodDef documentation

2017-03-29 Thread Senthil Kumaran
Senthil Kumaran added the comment: New changeset 3ceca68741f8a2d3a4436b6d54eae76aa5bcc4c5 by Senthil Kumaran in branch '2.7': bpo-29917: DOC: Remove link from PyMethodDef (#890) (#896) https://github.com/python/cpython/commit/3ceca68741f8a2d3a4436b6d54eae76aa5bcc4c5 --

[issue29917] Wrong link target in PyMethodDef documentation

2017-03-29 Thread Senthil Kumaran
Senthil Kumaran added the comment: New changeset da6ad2f780d187fbfdea330d1037766ae7bdb778 by Senthil Kumaran in branch '3.6': bpo-29917: DOC: Remove link from PyMethodDef (#890) (#894) https://github.com/python/cpython/commit/da6ad2f780d187fbfdea330d1037766ae7bdb778 --

[issue22392] Clarify documentation of __getinitargs__

2017-03-29 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +800 ___ Python tracker ___

[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2017-03-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This issue is left open because it needs to add a porting guide in What's New. See also a problem with breaking ABI in issue29943. -- ___ Python tracker

[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-03-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 2.7 is affected too. Nathaniel, could you add references to this issue and to original issue27867 on the Fedora bug tracker? -- nosy: +benjamin.peterson versions: +Python 2.7 ___ Python tracker

[issue29941] Confusion between asserts and Py_DEBUG

2017-03-29 Thread Tim Peters
Tim Peters added the comment: I think we should certainly support asserts regardless of whether Py_DEBUG is in force (although Py_DEBUG should imply asserts run too). And I wish you had stuck to just that much ;-) The argument against, e.g., 'assert(!PyErr_Occurred())', seems exceedingly

[issue29917] Wrong link target in PyMethodDef documentation

2017-03-29 Thread Senthil Kumaran
Changes by Senthil Kumaran : -- resolution: -> fixed stage: backport needed -> resolved status: open -> closed ___ Python tracker

[issue29941] Confusion between asserts and Py_DEBUG

2017-03-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Perhaps it would be better to raise SystemError for errors in user extensions and left assert() only for checking invariants that can't be broken by user code. But checking the condition takes time, assert() is cheaper. Perhaps it would be better to replace

[issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError

2017-03-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The __exit__() method doesn't conform PEP 8. PEP 8: """Be consistent in return statements. Either all return statements in a function should return an expression, or none of them should. If any return statement returns an expression, any return statements

[issue22392] Clarify documentation of __getinitargs__

2017-03-29 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +801 ___ Python tracker ___

[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-03-29 Thread Larry Hastings
Larry Hastings added the comment: Let's make it a release blocker for now. -- priority: normal -> release blocker ___ Python tracker ___

[issue29917] Wrong link target in PyMethodDef documentation

2017-03-29 Thread Cheryl Sabella
Changes by Cheryl Sabella : -- pull_requests: +792 ___ Python tracker ___ ___

[issue29917] Wrong link target in PyMethodDef documentation

2017-03-29 Thread Cheryl Sabella
Changes by Cheryl Sabella : -- pull_requests: +792, 793 ___ Python tracker ___ ___

[issue29917] Wrong link target in PyMethodDef documentation

2017-03-29 Thread Senthil Kumaran
Senthil Kumaran added the comment: New changeset c3c7ef088583cc12bd218138036d1edb6de9c63f by Senthil Kumaran (csabella) in branch 'master': bpo-29917: DOC: Remove link from PyMethodDef (#890) https://github.com/python/cpython/commit/c3c7ef088583cc12bd218138036d1edb6de9c63f -- nosy:

[issue29917] Wrong link target in PyMethodDef documentation

2017-03-29 Thread Senthil Kumaran
Changes by Senthil Kumaran : -- stage: needs patch -> backport needed ___ Python tracker ___

[issue29917] Wrong link target in PyMethodDef documentation

2017-03-29 Thread Cheryl Sabella
Cheryl Sabella added the comment: I am working on a pull request for this issue. -- nosy: +csabella ___ Python tracker ___

[issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError

2017-03-29 Thread svelankar
Changes by svelankar : -- pull_requests: +794 ___ Python tracker ___ ___

[issue24821] The optimization of string search can cause pessimization

2017-03-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ukrainian "Є" is not the only character suffered from this issue. I suppose much CJK characters are suffered too. The problem is occurred when the lower byte of searched character matches the upper byte of most characters in the text. For example,

[issue29922] error message when __aexit__ is not async

2017-03-29 Thread Frazer McLean
Changes by Frazer McLean : -- nosy: +RazerM ___ Python tracker ___ ___

[issue24821] The optimization of string search can cause pessimization

2017-03-29 Thread Ma Lin
Changes by Ma Lin : -- nosy: +Ma Lin ___ Python tracker ___ ___ Python-bugs-list mailing

[issue29930] Waiting for asyncio.StreamWriter.drain() twice in parallel raises an AssertionError when the transport stopped writing

2017-03-29 Thread Aymeric Augustin
Aymeric Augustin added the comment: drain() returns when the write buffer reaches the low water mark, not when it's empty, so you don't have a guarantee that your bytes were written to the socket.

[issue24821] The optimization of string search can cause pessimization

2017-03-29 Thread Louie Lu
Louie Lu added the comment: I can now only test on Python3.6, providing much meaningful sentence, still trying to use perf on cpython master branch. --- $ python -m perf timeit -s 's="一件乒乓事事亏, 不乏串連产業, 万丈一争今为举, 其乎哀哉"*1000' -- 's.find("乎")'

[issue24821] The optimization of string search can cause pessimization

2017-03-29 Thread Xiang Zhang
Xiang Zhang added the comment: I can't give a "realistic" example. A more meaningful example may be: '。', '\u3002', the Chinese period which used in almost every paragraph, '地', '\u5730', which is a common used word. ./python3 -m perf timeit -s 's = "你好,我叫李雷。"*1000' 's.find("地")' Mean +- std

[issue25538] Traceback from __exit__ method is misleading

2017-03-29 Thread Frazer McLean
Changes by Frazer McLean : -- nosy: +RazerM ___ Python tracker ___ ___

[issue29939] Compiler warning in _ctypes_test.c

2017-03-29 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Compiler warning was introduced by issue29565. /home/serhiy/py/cpython/Modules/_ctypes/_ctypes_test.c: In function ‘_testfunc_large_struct_update_value’: /home/serhiy/py/cpython/Modules/_ctypes/_ctypes_test.c:53:42: warning: parameter ‘in’ set but not

[issue22240] argparse support for "python -m module" in help

2017-03-29 Thread zertrin
Changes by zertrin : -- nosy: +zertrin ___ Python tracker ___ ___ Python-bugs-list

[issue26440] tarfile._FileInFile.seekable is broken in stream mode

2017-03-29 Thread Louie Lu
Louie Lu added the comment: Actually, _Stream does provide seek method, should the seekable just return True? -- nosy: +louielu ___ Python tracker ___

[issue28415] PyUnicode_FromFormat integer format handling different from printf about zeropad

2017-03-29 Thread Xiang Zhang
Changes by Xiang Zhang : -- versions: +Python 2.7 ___ Python tracker ___ ___

[issue29939] Compiler warning in _ctypes_test.c

2017-03-29 Thread Vinay Sajip
Vinay Sajip added the comment: Yes, this is on my radar. I'm planning to make some changes to this file in response to bpo-22273, and will stick in a (void) in to get rid of the warning. -- ___ Python tracker

[issue28415] PyUnicode_FromFormat integer format handling different from printf about zeropad

2017-03-29 Thread Louie Lu
Louie Lu added the comment: Add a note block under Py*_FromFormat in unicode.rst and bytes.rst. Could Xiang or Terry help to review? Thanks. -- nosy: +louielu ___ Python tracker

[issue28415] PyUnicode_FromFormat integer format handling different from printf about zeropad

2017-03-29 Thread Louie Lu
Changes by Louie Lu : -- pull_requests: +787 ___ Python tracker ___ ___ Python-bugs-list

[issue24821] The optimization of string search can cause pessimization

2017-03-29 Thread STINNER Victor
STINNER Victor added the comment: Would it completely kill performances to remove the optimization? -- ___ Python tracker ___