[issue32582] chr raises OverflowError

2018-01-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Perhaps this issue should be raised on Python-Dev, since it changes the old and 
well-known behavior of buildins. I think that ValueError is more appropriate, 
but in past we decided to keep OverflowError for compatibility.

If change chr(), other code needs to be changed. "%c", PyUnicode_FromOrdinal(), 
PyUnicode_Format(), and possible the same for bytes.

See also issue29833 and issue15988.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32589] Statistics as a result from timeit

2018-01-20 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

On Fri, Jan 19, 2018 at 11:48:46PM +, STINNER Victor wrote:

> The timeit module of the stdlib computes 5 values by default... I'm 
> not sure that it's revelant to compute the standard deviation only on 
> 5 values.

I made the same mistake as that: I too thought Matthias was talking 
about calculating the statistics based on timer.repeat(), but after 
looking more closely at the PR, I see that the statistics gathered 
are from the (default) 100 runs of each call to timer.timeit().

(Matthias: in future, please don't just dump a PR into the bug tracker 
with barely a word of explanation. We shouldn't have to read the source 
to understand what it does, let alone why it is done. Thank you.)

Given that Mattias is calculating the stats of each call to timeit(), 
I'm not sure whether that makes more or less sense than what I thought.

His patch effectively converts timeit() to calculate the time for one 
run a million times, instead of the total time for one million runs. 
That is one of the traps that Tim Peters warns about in the O'Reilly 
book: timing *one* run may give unrealistic results due to the timer's 
quantization. So I think this will be much less accurate.

(Is this still true now that timeit() uses perf_counter() as the default 
timer, instead of clock() or time()? I don't know.)

> About the PR itself, I dislike providing a fixed list of statistical 
> functions. For example, what if someone needs the geometric mean? What 
> if you want to count outliers? etc.

I'm not sure that the geometric mean would be physically meaningful. But 
your point is well taken. For example, I think the median might be a 
better choice than mean -- but if some user disagrees, that's okay.

> If someone really wants timeit to evolve, I suggest to return all 
> values rather than only the minimum: as repeat() does.

timeit() doesn't return the minimum.

timeit() calculates the total time for `number` (default is 100) 
runs, and returns that total; repeat() calls timeit() `repeat` (default 
is 3, not 5) times and returns them as a list.

> By the way, using the minimum is IMHO a bad idea, but I already 
> proposed to change timeit, and my change was rejected because of the 
> backward compatibility.

I am interested in why you think it is a bad idea to use the minimum as 
the best estimate of the actual execution time.

--

___
Python tracker 

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



[issue29708] support reproducible Python builds

2018-01-20 Thread Chih-Hsuan Yen

Change by Chih-Hsuan Yen :


--
nosy:  -yan12125

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-20 Thread Nathaniel Smith

Change by Nathaniel Smith :


--
keywords: +patch
pull_requests: +5097
stage:  -> patch review

___
Python tracker 

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



[issue25910] How many "critical"-level open issues are there?

2018-01-20 Thread STINNER Victor

STINNER Victor  added the comment:

"I will issue a separate PR for it, and then we're good to close this
issue."

Ok.

--
title: Fixing links in documentation -> How many "critical"-level open issues 
are there?

___
Python tracker 

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



[issue32589] Statistics as a result from timeit

2018-01-20 Thread STINNER Victor

STINNER Victor  added the comment:

For minimum vs average, see: https://bugs.python.org/issue28240

--

___
Python tracker 

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



[issue32589] Statistics as a result from timeit

2018-01-20 Thread STINNER Victor

STINNER Victor  added the comment:

"but after
looking more closely at the PR, I see that the statistics gathered
are from the (default) 100 runs of each call to timer.timeit()."

Ah, don't do that. Timeit runs the same code multiple times and computes
the average to compute one value on purpose. Reading a timer takes time,
and measures smaller than 1 ms are unstable.

--

___
Python tracker 

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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2018-01-20 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

I have a patch for this, but it will be simplest if we can merge 
https://github.com/python/cpython/pull/5250 (for bpo-32591) first, because they 
touch a lot of overlapping code.

--

___
Python tracker 

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



[issue25910] Fixing links in documentation

2018-01-20 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
title: How many "critical"-level open issues are there? -> Fixing links in 
documentation

___
Python tracker 

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



[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-20 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:


New changeset d911e40e788fb679723d78b6ea11cabf46caed5a by Ivan Levkivskyi in 
branch 'master':
bpo-32226: PEP 560: improve typing module (#4906)
https://github.com/python/cpython/commit/d911e40e788fb679723d78b6ea11cabf46caed5a


--

___
Python tracker 

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



[issue30693] tarfile add uses random order

2018-01-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

If make this change you need to make similar changes in other places that 
recursively add files to archives: shutil, zipapp, distutils, and maybe more.

--
versions:  -Python 2.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



[issue32598] Use autoconf to detect OpenSSL and libssl features

2018-01-20 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset ff5be6e8100276647e0077e80869fc022d1bb53f by Christian Heimes in 
branch 'master':
bpo-32598: Use autoconf to detect usable OpenSSL (#5242)
https://github.com/python/cpython/commit/ff5be6e8100276647e0077e80869fc022d1bb53f


--

___
Python tracker 

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



[issue32598] Use autoconf to detect OpenSSL and libssl features

2018-01-20 Thread Christian Heimes

Christian Heimes  added the comment:

Thanks, Andrew

--
resolution:  -> fixed
stage: patch review -> 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



[issue32589] Statistics as a result from timeit

2018-01-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I concur with Victor. This will defeat the purpose of timeit. And making the 
type of the result depending on arguments usually means a bad design.

For you particular need it is easy to write an explicit loop and gather the 
statistics that your need.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32589] Statistics as a result from timeit

2018-01-20 Thread STINNER Victor

STINNER Victor  added the comment:

> For you particular need it is easy to write an explicit loop and gather the 
> statistics that your need.

I concur with Serhiy:

>>> loops=2**15; values = [value/loops for value in t.repeat(10, loops)]
>>> import statistics
>>> statistics.mean(values)
3.439414190675727e-06
>>> statistics.stdev(values)
1.444941323254124e-07


Matthias Gilch: "I think it's inconvenient to write those stubs every time when 
we have a method for this in the standard library that could be easily used 
with a few changes in it."

Hum, maybe a module on PyPI which uses timeit.Timer internally would be more 
appropriate, than extending the timeit module.

(Or use my existing perf module, it's up to you ;-))

--

___
Python tracker 

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



[issue32430] Simplify Modules/Setup{,.dist,.local}

2018-01-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Why not adding an option in Makefile or configure to allow to specify a 
> different path to a custom Setup file?

Because we don't want to maintain more config options?  Really, I don't to want 
to further complicate our build process.

--

___
Python tracker 

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



[issue30693] tarfile add uses random order

2018-01-20 Thread STINNER Victor

STINNER Victor  added the comment:

I now agree to leave Python 2.7 and 3.6 unchanged.

--

___
Python tracker 

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



[issue32295] User friendly message when invoking bdist_wheel sans wheel package.

2018-01-20 Thread TestUserEWDurbin

Change by TestUserEWDurbin :


--
status: pending -> open
title: User friendly message when invoking bdist_wheel sans wheel package -> 
User friendly message when invoking bdist_wheel sans wheel package.

___
Python tracker 

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



[issue25910] Fixing links in documentation

2018-01-20 Thread R. David Murray

R. David Murray  added the comment:

@guido: in roundup, by default anyone can change the issue title.  I imagine he 
is a new user who just didn't understand that he was doing so.  (And indeed, 
the account was created on 1/19).

--

___
Python tracker 

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



[issue32430] Simplify Modules/Setup{,.dist,.local}

2018-01-20 Thread STINNER Victor

STINNER Victor  added the comment:

> Because we don't want to maintain more config options?  Really, I don't to 
> want to further complicate our build process.

I don't see how adding an option to make one path configurable would make the 
build process more complicated.

It seems like Xavier and Thomas do use Modules/Setup for their need, and for me 
it's strange to have to modify Modules/Setup (or Modules/Setup.dist) if it's 
tracked by Git. If I modify it, IMHO it's a configuration file, and it 
shouldn't be part of Python code base. It's fine to have a default 
configuration, but if you don't want to  use the default, just pass the path to 
your own config. No?

--

___
Python tracker 

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



[issue32430] Simplify Modules/Setup{,.dist,.local}

2018-01-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le 20/01/2018 à 14:22, STINNER Victor a écrit :
> 
> I don't see how adding an option to make one path configurable would make the 
> build process more complicated.

Do you think implementing and maintaing an option has no cost?

> It seems like Xavier and Thomas do use Modules/Setup for their need, and for 
> me it's strange to have to modify Modules/Setup (or Modules/Setup.dist) if 
> it's tracked by Git.

Distributors routinely modify files that are tracked by git.
Modules/Setup doesn't have to be an exception.

See Anaconda example I posted above.  Also you can look up packaging by
RedHat or any other distro.

--

___
Python tracker 

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



[issue32583] Crash during decoding using UTF-16/32 and custom error handler

2018-01-20 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
components: +Interpreter Core
nosy: +serhiy.storchaka
stage: test needed -> patch review
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue32602] Test ECDSA and dual mode context

2018-01-20 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset bd5c7d238c01b90fbfae8ea45b47bd601900abaf by Christian Heimes in 
branch 'master':
bpo-32602: Test ECDSA certs (#5247)
https://github.com/python/cpython/commit/bd5c7d238c01b90fbfae8ea45b47bd601900abaf


--

___
Python tracker 

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



[issue32602] Test ECDSA and dual mode context

2018-01-20 Thread Christian Heimes

Change by Christian Heimes :


--
resolution:  -> fixed
stage: patch review -> 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



[issue32430] Simplify Modules/Setup{,.dist,.local}

2018-01-20 Thread Julien Palard

Julien Palard  added the comment:

I don't see a use case where one want to edit a file without having his work 
being tracked by git, can someone shed a light to me on this?

I understand that to modify a single configuration point (a path, whatever) a 
configure option is the right way and is not versioned by git, but 
Modules/Setup is a file, not a flag.

But, I assumed the whole time Modules/Setup modifications are not trivial, but 
the result of some work worth versioning, unlike a single configure option, am 
I wrong?

--

___
Python tracker 

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



[issue32503] Avoid creating small frames in pickle protocol 4

2018-01-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 1211c9a9897a174b7261ca258cabf289815a40d8 by Serhiy Storchaka in 
branch 'master':
bpo-32503: Avoid creating too small frames in pickles. (#5127)
https://github.com/python/cpython/commit/1211c9a9897a174b7261ca258cabf289815a40d8


--

___
Python tracker 

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



[issue32594] File object 'name' attribute inconsistent type and not obviously documented

2018-01-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Isn't this a duplicate of issue18534?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32503] Avoid creating small frames in pickle protocol 4

2018-01-20 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> 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



[issue31429] TLS cipher suite compile time option for downstream

2018-01-20 Thread Christian Heimes

Christian Heimes  added the comment:

My PR is ready for review.

--
nosy: +alex, dstufft, janssen

___
Python tracker 

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



[issue32594] File object 'name' attribute inconsistent type and not obviously documented

2018-01-20 Thread R. David Murray

R. David Murray  added the comment:

Ah, yes.  When I said "this has been discussed previously", that's the issue I 
was thinking of but couldn't find.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> State clearly that open() 'file' param is "name" attr of the 
result

___
Python tracker 

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



[issue29302] add contextlib.AsyncExitStack

2018-01-20 Thread Nick Coghlan

Nick Coghlan  added the comment:

Explicitly noting some API design decisions from the review of 
https://github.com/python/cpython/pull/4790:

1. AsyncExitStack will define __aenter__ and __aexit__ but *not* __enter__ and 
__exit. This makes it unambiguous which form of with statement you need to be 
using for a given stack.
2. AsyncExitStack will use the same methods to add synchronous context managers 
as ExitStack does
3. The only common method with clearly distinct external behaviour will be 
stack.close(), which will be a coroutine in the AsyncExitStack case (the other 
common methods will all still be synchronous in AsyncExitStack)
4. AsyncExitStack will gain 3 new methods for working with async context 
managers:

- enter_async_context(cm): coroutine to enter an async context manager and adds 
its __aexit__ to the context stack if __aenter__ succeeds
- push_async_exit(cm_or_exit): push an exit callback directly onto the stack. 
The argument must either be an object implementing __aexit__, or else a 
callback with the same signature as __aexit__ (use stack.push() to register a 
synchronous CM or exit callback)
- push_async_callback(callback): push the given callback onto the stack. The 
callback should return an awaitable (use stack.callback() to register 
synchronous callbacks)

--

___
Python tracker 

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



[issue32550] STORE_ANNOTATION bytecode is unnecessary and can be removed.

2018-01-20 Thread Guido van Rossum

Guido van Rossum  added the comment:

There is very little code that depends on __annotations__ at all, and none
of it is very subtle. All actual type checking is done by separate tools
(mypy, pytype, PyCharm) that don't import the code and don't care about
__annotations__. The __annotations__ variable exists so that other people
*may* do useful stuff with it, e.g. design run-time type-checking
decorators. So please don't worry about interning.

--

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-20 Thread Yury Selivanov

Yury Selivanov  added the comment:

Guido,

I'd like to go forward with this and merge Nathaniel's PR.

Quick summary:

* This issue adds new APIs: a sys.set_coroutine_origin_tracking_depth(depth) 
function and a 'cr_origin' property to native coroutine objects.

* By using this APIs, users can opt-in to save traceback (serialized as tuples 
of `(funcname, filename, line)`) of where native coroutines are created.

* This allows us to deprecate the sys.set_coroutine_wrapper function, which I 
never liked.  It's too powerful as it allows anyone to intercept/override 
native coroutine construction logic.

* In turn, we are removing a lot of complexity from asyncio code: starting with 
3.7 we'll use CoroWrapper only for generator-based corotuines; at some point 
(Python 3.9?) when we remove @asyncio.coroutine we'll be able to remove 
CoroWrapper.  This will also make asyncio debug mode quite a bit faster, 
allowing people to use it in production.

* Finally, sys.set_coroutine_wrapper was always documented as a debug-only API 
that might disappear in future CPython releases.  We'll deprecate it in 3.7 and 
remove it in 3.8.

Are you OK with this?

--
nosy: +gvanrossum

___
Python tracker 

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



[issue32476] Add concat functionality to ElementTree xpath find

2018-01-20 Thread John Jolly

Change by John Jolly :


--
pull_requests: +5098
stage:  -> patch review

___
Python tracker 

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



[issue32589] Statistics as a result from timeit

2018-01-20 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

If we agree that the patch is wrong, we should reject it and close this issue.

--

___
Python tracker 

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



[issue32472] Mention of __await__ missing in Coroutine Abstract Methods

2018-01-20 Thread Andrew Svetlov

Change by Andrew Svetlov :


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

___
Python tracker 

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



[issue24334] SSLSocket extra level of indirection

2018-01-20 Thread Christian Heimes

Change by Christian Heimes :


--
pull_requests: +5099
stage: needs patch -> patch review

___
Python tracker 

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



[issue29833] Avoid raising OverflowError if possible

2018-01-20 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
dependencies: +chr raises OverflowError

___
Python tracker 

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



[issue32583] Crash during decoding using UTF-16/32 and custom error handler

2018-01-20 Thread Xiang Zhang

Xiang Zhang  added the comment:

The problem is utf16 decoder almost always assumes that two bytes decodes to 
one unicode character, so when allocating memory, it assumes (bytes_number+1)/2 
unicode slots is enough, there is even a comment in the code. And in 
unicode_decode_call_errorhandler_writer, it only allocates more memory when the 
error handler returns a unicode longer than 1, but doesn't take care pace by 
one, in which case one byte to one unicode character. So it's possible for the 
decoder to write out of bound.

This example could steadily crash on my Mac with debug version, it writes 
across the bound of the internal unicode buffer:

>>> import codecs
>>> def pace_by_one(exc):
... return ('\ufffd', exc.start+1)
...
>>> codecs.register_error('pace_by_one', pace_by_one)
>>> b'\xd8\xd8\xd8\xd8\xd8\xd8\x00\x00\x00'.decode('utf-16-le', 'pace_by_one')
Debug memory block at address p=0x10210c260: API 'o'
100 bytes originally requested
The 7 pad bytes at p-7 are FORBIDDENBYTE, as expected.
The 8 pad bytes at tail=0x10210c2c4 are not all FORBIDDENBYTE (0xfb):
at tail+0: 0x00 *** OUCH
at tail+1: 0x00 *** OUCH
at tail+2: 0xfb
at tail+3: 0xfb
at tail+4: 0xfb
at tail+5: 0xfb
at tail+6: 0xfb
at tail+7: 0xfb
The block was made by call #30672 to debug malloc/realloc.
Data at p: 00 00 00 00 00 00 00 00 ... fd ff fd ff fd ff d8 00

Fatal Python error: bad trailing pad byte

Current thread 0x7fffab9b4340 (most recent call first):
  File "/Users/angwer/Repositories/cpython/Lib/encodings/utf_16_le.py", line 16 
in decode
  File "", line 1 in 
[1]63997 abort  ~/Repositories/cpython/python.exe

I'll try to make a fix tomorrow.

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue32583] Crash during decoding using UTF-16/32 and custom error handler

2018-01-20 Thread Xiang Zhang

Change by Xiang Zhang :


--
stage: patch review -> needs patch

___
Python tracker 

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



[issue32597] Bad detection of clang

2018-01-20 Thread Stefan Krah

Stefan Krah  added the comment:

> https://bugs.python.org/issue20767 was showing the issue and imho badly fixed.

You do realize that the fix was proposed by FreeBSD people and that the 
upstream Clang issue is still open?

--
nosy: +skrah

___
Python tracker 

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



[issue32583] Crash during decoding using UTF-16/32 and custom error handler

2018-01-20 Thread Xiang Zhang

Xiang Zhang  added the comment:

Another way to crash:

>>> import codecs
>>> def replace_with_longer(exc):
... exc.object = b'\xa0\x00' * 100
... return ('\ufffd', exc.end)
...
>>> codecs.register
codecs.register(   codecs.register_error(
>>> codecs.register_error('replace_with_longer', rep
replace_with_longer( repr(
>>> codecs.register_error('replace_with_longer', replace_with_longer)
>>> b'\xd8\xd8'.decode('utf-16-le', 'replace_with_longer')
Debug memory block at address p=0x10b3b8c40: API 'o'
92 bytes originally requested
The 7 pad bytes at p-7 are FORBIDDENBYTE, as expected.
The 8 pad bytes at tail=0x10b3b8c9c are not all FORBIDDENBYTE (0xfb):
at tail+0: 0xa0 *** OUCH
at tail+1: 0x00 *** OUCH
at tail+2: 0xa0 *** OUCH
at tail+3: 0x00 *** OUCH
at tail+4: 0xa0 *** OUCH
at tail+5: 0x00 *** OUCH
at tail+6: 0xa0 *** OUCH
at tail+7: 0x00 *** OUCH
The block was made by call #11529390970613309440 to debug malloc/realloc.
Data at p: 00 00 00 00 00 00 00 00 ... 00 00 00 00 fd ff a0 00

Fatal Python error: bad trailing pad byte

Current thread 0x7fffab9b4340 (most recent call first):
  File "/Users/angwer/Repositories/cpython/Lib/encodings/utf_16_le.py", line 16 
in decode
  File "", line 1 in 
[1]64081 abort  ~/Repositories/cpython/python.exe

--

___
Python tracker 

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



[issue31687] test_semaphore_tracker() of test_multiprocessing_spawn fails randomly (race condition?)

2018-01-20 Thread STINNER Victor

STINNER Victor  added the comment:

To reproduce the issue, someone should increase the system load to make the 
system slower and make timeouts more likely, and change the order in which 
processes are run. I'm using the "stress" utility on Linux for that. But 
sometimes, the best stress tool... is the Python test suite, since running the 
full test suite in multiple processes in parallel (./python -m test -j0 -r) 
runs various workloads, and so sometimes trigger bugs which would be very hard 
to trigger othewise.

Terminal 1: run "./python -m test -j0 -r", stress or anything else to make the 
system slower

Terminal 2: run "./python -m test test_multiprocessing_fork -m 
test_semaphore_tracker -F -v" which runs the test in a loop until it fails.

--

___
Python tracker 

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



[issue32603] Deprecation warning on strings used in re module

2018-01-20 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

+1 to this. I have seen a lot of regular expressions not using raw strings that 
makes use of "\d" and friends. I will work on a patch to the docs if that's ok.

--
nosy: +pablogsal

___
Python tracker 

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



[issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element

2018-01-20 Thread Gordon P. Hemsley

Gordon P. Hemsley  added the comment:

>> As discussed above, starting with msg309074, __deepcopy__() is being added 
>> to the Python implementation because it already exists in the C 
>> implementation.
> 
> Python implementation shouldn't copy all implementation details of the C 
> implementation. This is cumbersome and often impossible. Both implementation 
> should have the same behavior, and they do have.

As it stands, calling Element.__deepcopy__() will succeed with the C
implementation and fail with the Python implementation. That seems
problematic to me, and making that *not* be the case is trivial, so I
don't understand the generalization to "all implementation details".

Additionally, if copy.deepcopy() already works well with the Python
implementation, why would it not work on the C implementation? What is
different about the C implementation that requires the definition of
__deepcopy__() in the first place?

>> And additional tests have in fact uncovered further discrepancies between 
>> the Python and C implementations with regard to copying behavior.
> 
> What are these discrepancies?

As I mentioned in the PR, the C implementation does not make use of
Element.__init__() when it creates new instances of the class, opting
instead to use create_new_element() (which is not used in the C
implementation of Element.__init__()). However, create_new_element()
does not make a copy of the attrib dict that is passed in, meaning that
the internal attrib dict of an Element instance is mutable by changing
the dict that was passed in.

I have modified the C implementation to fix this problem by adding a
copy line in create_new_element(). Without this change, some of the new
tests in the PR will fail in the C implementation.

The Python implementation does not have this problem because it
inherently always goes through Element.__init__().

> In any case it is better to extend existing tests by adding missed checks 
> than duplicate tests.

As I mentioned in the PR:

I have added the unit tests in the way that I have because the existing
checks are generally integration tests, and most of the test coverage
for this module comes as a side effect of pickle tests. It is my goal to
expand the unit tests later to test each method individually, so
starting that work here makes it easier.

--

___
Python tracker 

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



[issue27682] wsgiref: Windows Error 10053, ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

2018-01-20 Thread William Hingston

William Hingston  added the comment:

I'm still seeing this with

Python 3.6.3
Django 2.0.1
Windows 10 Pro Version 1709

Was this determined to be a Django bug?

--
nosy: +William Hingston

___
Python tracker 

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



[issue32378] test_npn_protocols broken with LibreSSL 2.6.1+

2018-01-20 Thread Christian Heimes

Change by Christian Heimes :


--
pull_requests: +5100

___
Python tracker 

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



[issue32502] uuid1() fails if only 64-bit interface addresses are available

2018-01-20 Thread bbayles

Change by bbayles :


--
keywords: +patch
pull_requests: +5101
stage: needs patch -> patch review

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-20 Thread Guido van Rossum

Guido van Rossum  added the comment:

Yes, I'm OK with this plan. Note that I've only read Nathaniel's original
message and Yury's last message, and I've not reviewed the PR, but getting
rid of that eyesore sounds good, and it seems you two have reached
agreement.

--

___
Python tracker 

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



[issue32574] asyncio.Queue, put() leaks memory if the queue is full

2018-01-20 Thread José Melero Fernández

Change by José Melero Fernández :


--
versions: +Python 3.5

___
Python tracker 

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



[issue32603] Deprecation warning on strings used in re module

2018-01-20 Thread Pablo Galindo Salgado

Change by Pablo Galindo Salgado :


--
keywords: +patch
pull_requests: +5102
stage:  -> patch review

___
Python tracker 

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



[issue32232] building extensions as builtins is broken in 3.7

2018-01-20 Thread Pablo Galindo Salgado

Change by Pablo Galindo Salgado :


--
pull_requests: +5103
stage:  -> patch review

___
Python tracker 

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



[issue32232] building extensions as builtins is broken in 3.7

2018-01-20 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

I have put together a PR with Matthias' patch and a test.

--
nosy: +pablogsal

___
Python tracker 

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



[issue32232] building extensions as builtins is broken in 3.7

2018-01-20 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

It seems that Microsoft compiler does not handle well the circular dependencies 
between Include/pystate.h and Include/internal/pystate.h so I have included 
guards for Windows in the new include for Include/pystate.h and deactivated the 
test in that case. Some better ideas on how to handle that case?

--

___
Python tracker 

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



[issue32606] Email Header Injection Protection Bypass

2018-01-20 Thread Dalton Campbell

New submission from Dalton Campbell :

The protection's implemented in 
https://github.com/python/cpython/blob/master/Lib/email/header.py to prevent 
Email Header injection can be bypassed by specifying an injected additional 
header in the following format:
exam...@python.org\ncc :injec...@python.org

The white space bypasses the current regex protection (_embedded_header = 
re.compile(r'\n[^ \t]+:')) and is still accepted by the smtp server. 

Attached is a proof of concept script

--
components: Library (Lib)
files: PythonEmailHeaderInjectionPOC.py
messages: 310367
nosy: r.david.murray, thedoctorsoup
priority: normal
severity: normal
status: open
title: Email Header Injection Protection Bypass
type: security
Added file: https://bugs.python.org/file47396/PythonEmailHeaderInjectionPOC.py

___
Python tracker 

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



[issue32606] Email Header Injection Protection Bypass

2018-01-20 Thread Dalton Campbell

Change by Dalton Campbell :


--
nosy: +barry

___
Python tracker 

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