[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22392] Clarify documentation of __getinitargs__

2017-03-29 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +801

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22392] Clarify documentation of __getinitargs__

2017-03-29 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +800

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 where no value is 
returned should explicitly state this as return None , and an explicit return 
statement should be present at the end of the function (if reachable)."""

The __exit__() method has explicit "return False", bare "return", and implicit 
"return" at the end of the method. Together with different styles in different 
"except" clauses this makes it slightly hard to read.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 some of asserts in non-critical code with 
runtime checks and PyErr_BadArgument()/PyErr_BadInternalCall().

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 weak.  An `assert()` is to catch 
things that are never supposed to happen.  It's an error in the implementation 
if such a thing ever does happen.  But whether that error is in the Pytnon core 
or an external C extension is a distinction that only matters to assigning 
blame - it's "an error" all the same.  It's nothing but good to catch errors 
ASAP.

Where I draw a hard distinction between assertions and Py_DEBUG is along the 
"expensive?" axis.  The more assertions the merrier, but they better be cheap 
(and `PyErr_Occurred()` is pretty cheap).  
Py_DEBUG does all sorts of stuff  that's expensive and intrusive - that's for 
heavy duty verification.

So, to me, 'assert(!PyErr_Occurred())' is fine - it's cheap and catches an 
error at a point where catching it is possible.  Finding the true cause for why 
the error is set may be arbitrarily more expensive, so _that_ code belongs 
under Py_DEBUG.  Except there is no general way to do that, so no such code 
exists ;-)

--
nosy: +tim.peters

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29917] Wrong link target in PyMethodDef documentation

2017-03-29 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
pull_requests: +799

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29917] Wrong link target in PyMethodDef documentation

2017-03-29 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
pull_requests: +798

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29917] Wrong link target in PyMethodDef documentation

2017-03-29 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
pull_requests: +797

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 
Internet Explorer (IE) and is used by IE. It could be used by other 
applications and I think it's obvious that other applications must handle it 
same way as IE does. May be I'm wrong here, please dissuade me.

The problem is that IE only compares the hostname received with items in this 
list. And urllib also makes the reverse lookup and the forward lookup of the 
hostname and compares the results of those lookups with items in this list. To 
reproduce that you need to:
1. Run a proxy on your Windows or use any other proxy, that outputs requests 
coming from clients.
2. On Windows in "Browser settings" (IE settings) turn on the option "use 
proxy", set up the IP of your proxy, set the list "Do not use proxy server for 
address beginning with" to '23.253.135.79' (without commas). (23.253.135.79 - 
is the result of 'nslookup python.org' at this time when I write this comment)
3. Make a request in IE to http://python.org/. Then analyze the output of your 
proxy. You will see that the request to python.org goes through proxy. 
4. Make a request to http://python.org/ via urllib (run checklib-py3.py). 
Analyze the output of your proxy. You will see that the request to python.org 
bypasses proxy.

Be careful: there might be redirections when you make a request to 
http://python.org/. If you see 'http://www.python.org/' in proxy output and 
don't see 'http://python.org/' it means that request to 'python.org' bypasses 
proxy.

This is the behavioral part of the problem which is attended by the performance 
decreasing, because the reverse lookup on some dns servers for some hostnames 
works slowly (up to 10 secs sometimes). May be the solution in my PR is not 
smart enough. But how can I make this issue go forward?

--
Added file: http://bugs.python.org/file46766/checklib-py3.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 obvious solution -- declare 3.6.0 broken and require upgrading to 3.6.1.

For 3.5.4 we can disable defining the macro when Py_LIMITED_API is not defined. 
This will restore the initial bug in many extensions. And we need other way to 
detect if we compile the CPython core or standard extensions for fixing the bug 
in standard collections. Or expand all uses of PySlice_GetIndicesEx to 
PySlice_Unpack+PySlice_AdjustIndices (the patch can be generated automatically).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 the always undesirable segfault.

--
assignee:  -> gregory.p.smith
versions: +Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 cleanly / 
tests_hashlib passes. My employer has been using this patch successfully (in a 
FIPS environment) for ~3 months now, and I'm looking to upstream.

Earlier, dmalcolm identified that OpenSSL's EVP_DigestUpdate dereferences a 
NULL in FIPS mode on non-FIPS algorithms. OpenSSL is not quite that bad ... 
turns out, EVP_DigestInit returns an error if FIPS disallows an algorithm, and 
ignoring the error (which _hashopenssl.c currently does) results in later 
dereferencing NULL. It's straightforward to add the right error checks and 
convert them to Python exceptions, which seems the most Pythonic way to handle 
the error - and it also minimizes the FIPS-only codepaths.

There's one catch, _hashopenssl.c likes to pre-construct several algorithms at 
module import and raising an exception during import leads hashlib.py to 
silently drop the exception (hashlib.py:158-161). So I made the 
pre-constructors lazy: the first use of any constructor will attempt to 
initialize it, and raise the exception on first use if FIPS mode makes it 
unusable. The reason for choosing this approach is Lib/hashlib.py and 
__get_openssl_constructor(), which already has logic to handle exactly this 
ValueError by falling back to __get_builtin_constructor() (and the 
less-optimized _md5/_sha1/_sha256 modules).

In the context of issue9216 (a usedforsecurity flag which can be passed to 
OpenSSL to allow non-FIPS algorithms), this change has the net effect of 
silently falling back from OpenSSL's MD5 implementation to python's _md5 C code 
when in FIPS mode. That's not exactly the intent of FIPS mode (python's _md5 
module is certainly not FIPS-compliant), but converting a crash to a catchable 
exception is a major improvement. I like the discussion in issue9216, and see 
this change as complementary: it avoids crashing and moves policy handling of 
how to handle FIPS mode _hashopenssl.c to hashlib.py, and my gut feeling is 
that policy logic is better placed in a .py library than in a .c library.

The advantage of this patch is that the new exceptions are obviously correct 
regardless of FIPS considerations, and the lazy constructors maintain the 
spirit of amortizing EVP_DigestInit calls while also reporting any error at a 
more useful point.

--
nosy: +kscguru
status: pending -> open
Added file: http://bugs.python.org/file46765/hashopenssl-fips-exceptions.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 bdist_msi works to make sure the change is sound, 
which I'm not entirely convinced it is (MSI custom actions are very difficult 
to get right, and have a lot of strange quirks - the big concern here would be 
breaking a property reference by adding the option in the wrong column, instead 
of using a custom action to set the property that is referenced from the action 
that executes it).

In short, non-trivial, rarely used, easily overrideable from the build scripts 
that need it. I'd recommend this for a third party module, but at this stage it 
should only be changed in the standard library if it doesn't match some 
documentation.

--
versions: +Python 3.7 -Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29692] contextlib.contextmanager may incorrectly unchain RuntimeError

2017-03-29 Thread svelankar

Changes by svelankar :


--
pull_requests: +794

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29917] Wrong link target in PyMethodDef documentation

2017-03-29 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
stage: needs patch -> backport needed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: +orsenthil

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29917] Wrong link target in PyMethodDef documentation

2017-03-29 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +792, 793

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29917] Wrong link target in PyMethodDef documentation

2017-03-29 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +792

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 currently slated to be released as part of 3.5.4.

Unfortunately, this breaks our normal ABI stability guarantees for micro 
releases: it means that if a C module that uses PySlice_GetIndicesEx is 
compiled against e.g. 3.6.1, then it cannot be imported on 3.6.0. This affects 
a number of high-profile packages (cffi, pandas, mpi4py, dnf, ...). The only 
workaround is that if you are distributing binary extension modules (e.g. 
wheels), then you need to be careful not to upgrade to 3.6.1. It's not possible 
for a wheel to declare that it requires 3.6.1-or-better, because CPython 
normally follows the rule that we don't make these kinds of changes. Oops.

CC'ing Ned and Larry, because it's possible this should trigger a 3.6.2, and I 
think it's a blocker for 3.5.4. CC'ing Serhiy as the author of the original 
patch, since you probably have the best idea how this could be unwound with 
minimal breakage :-).

python-dev discussion: 
https://mail.python.org/pipermail/python-dev/2017-March/147707.html

Fedora bug: https://bugzilla.redhat.com/show_bug.cgi?id=1435135

--
messages: 290796
nosy: larry, ned.deily, njs, serhiy.storchaka
priority: normal
severity: normal
status: open
title: PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches
versions: Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 following video and blog post by Ben Hillis for a discussion of the 
architecture changes that were made to support this feature:

https://blogs.msdn.microsoft.com/wsl/2016/10/19/windows-and-ubuntu-interoperability

--
nosy: +eryksun
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-03-29 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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


--
nosy: +brett.cannon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 `index`, as well as `count`, `find`, `rfind`, 
and `rindex`.

Not supporting None makes the type signature of list.index and tuple.index 
subtly different from those of str, bytes, and bytearray, when they could 
otherwise be interchangeable. It makes the type signature of index inconsistent 
across the types.

Furthermore, it makes converting slice start/stop to these arguments a pain. 
Compare the following:

seq.index(start=slice.start, end=slice.stop) # accepting None

seq.index(start=(0 if slice.start is None else slice.start), end=(len(seq) 
if slice.stop is None else slice.stop)) # current behavior.

I do not buy the argument that the latter communicates intent better, and it is 
adds bug-prone baggage to every call site.


Similarly, being able to pass None for end/stop parameters is very convenient 
in the case of optional passthrough arguments, saving the programmer from this:
def f(seq, end=None):
  i = seq.index(start=0, end=(len(seq) if end is None else end)) # current 
behavior.
  ...

Note that for the programmer writing `f`, None (or some other distinct sentinel 
value) is a *requirement* for correctness, because end=len(seq) is incorrect.

I would understand opposition to this on the basis of not changing existing 
behavior in any way, but "communicating intent" seems like a thin argument in 
comparison to the above.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 Py_DEBUG enabled:

Python 3.7.0a0 (heads/master:c431854a09, Mar 29 2017, 10:03:50) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import itertools
>>> next(itertools.chain.from_iterable(() for unused in range(1000)))
Segmentation fault (core dumped)

--
messages: 290787
nosy: gregory.p.smith, twouters
priority: normal
pull_requests: 791
severity: normal
status: open
title: Stack overflow in itertools.chain.from_iterable.

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29941] Confusion between asserts and Py_DEBUG

2017-03-29 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +haypo, serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 turn on asserts *without* turning on Py_DEBUG, and 
at Google we routinely build CPython that way. (Doing this with the regular 
configure/make process can be done by setting CFLAGS=-UNDEBUG when running 
configure.) This happens to highlight two different problems:

 - Code being defined in Py_DEBUG blocks but used in assertions: 
_PyDict_CheckConsistency() is defined in dictobject.c in an #ifdef Py_DEBUG, 
but then used in assert without a check for Py_DEBUG. This is a compile-time 
error.

 - Assertions checking for things that are outside of CPython's control, like 
whether an exception is set before calling something that might clobber it. 
Generally speaking assertions should be for internal invariants; things that 
should be a specific way, and it's an error in CPython itself when it's not (I 
think Tim Peters originally expressed this view of C asserts). For example, 
PyObject_Call() (and various other flavours of it) does 
'assert(!PyErr_Occurred())', which is easily triggered and the cause of which 
is not always apparent.

The second case is useful, mind you, as it exposes bugs in extension modules, 
but the way it does it is not very helpful (it displays no traceback), and if 
the intent is to only do this when Py_DEBUG is enabled it would be better to 
check for that. The attached PR fixes both issues.

I think what our codebase does (enable assertions by default, without enabling 
Py_DEBUG) is useful, even when applied to CPython, and I would like CPython to 
keep working that way. However, if it's deemed more appropriate to make 
assertions only work in Py_DEBUG mode, that's fine too -- but please make it 
explicit, by making non-Py_DEBUG builds require NDEBUG.

--
messages: 290784
nosy: Thomas Wouters, gregory.p.smith
priority: normal
pull_requests: 788
severity: normal
status: open
title: Confusion between asserts and Py_DEBUG
type: crash

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 the option to help() would prevent 
surprising behavior while still allowing current behavior to be used when 
needed.  See http://stackoverflow.com/a/17705456/603136 for more.

--
components: Library (Lib)
messages: 290782
nosy: samwyse
priority: normal
severity: normal
status: open
title: Add follow_wrapped=True option to help()
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-03-29 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 without the optimization. On my netbook the 
optimization speeds up searching by 5.5 times.

Search with optimization:
$ ./python -m perf timeit -s 's = "АБВГД"*10**5' -- 's.find("Ж")'
Median +- std dev: 296 us +- 33 us

Search without optimization:
$ ./python -m perf timeit -s 's = "АБВГД"*10**5' -- 's.find("\0")'
Median +- std dev: 1.65 ms +- 0.10 ms

Search an unlucky character (unpatched):
$ ./python -m perf timeit -s 's = "АБВГД"*10**5' -- 's.find("Є")'
Median +- std dev: 14.7 ms +- 1.8 ms

Search an unlucky character (patched):
$ ./python -m perf timeit -s 's = "АБВГД"*10**5' -- 's.find("Є")'
Median +- std dev: 2.17 ms +- 0.24 ms

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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


# ./python3
Python 3.6.1 (default, Mar 27 2017, 23:50:01)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
*** glibc detected *** ./python3: free(): invalid pointer: 0x7ffeee27e570 
***
=== Backtrace: =

--
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-03-29 Thread zertrin

Changes by zertrin :


--
nosy: +zertrin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25538] Traceback from __exit__ method is misleading

2017-03-29 Thread Frazer McLean

Changes by Frazer McLean :


--
nosy: +RazerM

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29922] error message when __aexit__ is not async

2017-03-29 Thread Frazer McLean

Changes by Frazer McLean :


--
nosy: +RazerM

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 dev: 6.65 us +- 0.27 us
Mean +- std dev: 4.08 us +- 0.22 us

It works! :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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("乎")'

Median +- std dev: 228 ns +- 7 ns


$ python -m perf timeit -s 's="一件乒乓事事亏, 不乏串連产業, 万丈一争今为举, 其乎哀哉"*1000' -- 
's.find("乏")'  

Median +- std dev: 143 ns +- 3 ns

---

$ python -m perf timeit -s 's="一件乒乓事事亏, 不乏串連产業, 万丈一争今为举, 其哀哉"*1000' -- 
's.find("乎")'  
   ^^ 
(missing "乎")
Median +- std dev: 100 us +- 3 us

$ python -m perf timeit -s 's="一件乒乓事事亏, 不串連产業, 万丈一争今为举, 其乎哀哉"*1000' -- 
's.find("乏")'
 ^^ (missing "乏")
Median +- std dev: 1.67 us +- 0.05 us

--
nosy: +louielu

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.

https://github.com/python/cpython/blob/6f0eb93183519024cb360162bdd81b9faec97ba6/Lib/asyncio/protocols.py#L36-L40

The low water mark defaults to 64kB and the high water mark to 256kB.

https://github.com/python/cpython/blob/6f0eb93183519024cb360162bdd81b9faec97ba6/Lib/asyncio/transports.py#L290

With websockets, the recommended way to ensure your message was received is:

yield from ws.send(...)
yield from ws.ping()

Given that TCP guarantees ordering, the ping response can only be received 
after the previous message was fully sent and received.

Of course the ping can fail even though the message was received, that's the 
classical at-most-once vs. at-least-once question.

The technique you suggest requires setting the low and high water marks to 0. 
I'm not sure this is the best way to achieve your goals, since you still don't 
control the OS buffers.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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, searching "乎" (U+4e4e) in the sequence of characters U+4eXX 
(but not containing U+4e4e and U+4e4f):

$ ./python -m perf timeit -s 's = 
"一丁丂七丄丅丆万丈三上下丌不与丏丐丑丒专且丕世丗丘丙业丛东丝丞丟丠両丢丣两严並丧丨丩个丫丬中丮丯丰丱串丳临丵丶丷丸丹为主丼丽举丿乀乁乂乃乄久乆乇么义乊之乌乍乐乑乒乓乔乕乖乗乘乙乚乛乜九乞也习乡乢乣乤乥书乧乨乩乪乫乬乭乮乯买乱乲乳乴乵乶乷乸乹乺乻乼乽乾乿亀亁亂亃亄亅了亇予争
 
亊事二亍于亏亐云互亓五井亖亗亘亙亚些亜亝亞亟亠亡亢亣交亥亦产亨亩亪享京亭亮亯亰亱亲亳亴亵亶亷亸亹人亻亼亽亾亿什仁仂仃仄仅仆仇仈仉今介仌仍从仏仐仑仒仓仔仕他仗付仙仚仛仜
 仝仞仟仠仡仢代令以仦仧仨仩仪仫们仭仮仯仰仱仲仳仴仵件价仸仹仺任仼份仾仿"*100' -- 's.find("乎")'

Unpatched:  Median +- std dev: 761 us +- 108 us
Patched:Median +- std dev: 117 us +- 9 us

For comparison, searching "乏" (U+4e4f) in the same sequence:

$ ./python -m perf timeit -s 's = 
"一丁丂七丄丅丆万丈三上下丌不与丏丐丑丒专且丕世丗丘丙业丛东丝丞丟丠両丢丣两严並丧丨丩个丫丬中丮丯丰丱串丳临丵丶丷丸丹为主丼丽举丿乀乁乂乃乄久乆乇么义乊之乌乍乐乑乒乓乔乕乖乗乘乙乚乛乜九乞也习乡乢乣乤乥书乧乨乩乪乫乬乭乮乯买乱乲乳乴乵乶乷乸乹乺乻乼乽乾乿亀亁亂亃亄亅了亇予争
 
亊事二亍于亏亐云互亓五井亖亗亘亙亚些亜亝亞亟亠亡亢亣交亥亦产亨亩亪享京亭亮亯亰亱亲亳亴亵亶亷亸亹人亻亼亽亾亿什仁仂仃仄仅仆仇仈仉今介仌仍从仏仐仑仒仓仔仕他仗付仙仚仛仜
 仝仞仟仠仡仢代令以仦仧仨仩仪仫们仭仮仯仰仱仲仳仴仵件价仸仹仺任仼份仾仿"*100' -- 's.find("乏")'

Unpatched:  Median +- std dev: 12.8 us +- 1.4 us
Patched:Median +- std dev: 12.6 us +- 1.7 us

Sorry, I don't know Chinese or Japanese and can't provide more realistic 
examples.

--
nosy: +inada.naoki, xiang.zhang

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 used [-Wunused-but-set-parameter]
 _testfunc_large_struct_update_value(Test in)
  ^

--
components: ctypes
messages: 290771
nosy: serhiy.storchaka, vinay.sajip
priority: normal
severity: normal
stage: needs patch
status: open
title: Compiler warning in _ctypes_test.c
type: compile error
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com