[issue31490] assertion failure in ctypes in case an _anonymous_ attr appears outside _fields_

2017-09-26 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +3767

___
Python tracker 

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



[issue22140] "python-config --includes" returns a wrong path (double prefix)

2017-09-26 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset 14086cfc5eed8c5e78342d79e5db87a135d75fa8 by Benjamin Peterson 
(Michał Górny) in branch 'master':
closes bpo-22140: Prevent double substitution of prefix in python-config.sh 
(#3769)
https://github.com/python/cpython/commit/14086cfc5eed8c5e78342d79e5db87a135d75fa8


--
nosy: +benjamin.peterson
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



[issue25359] io.open() fails to open ascii file if LANG env not set

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 4954b8dc5305de72ce618522522a2910c3a34126 by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-25359: Add missed "goto error" after setting an exception. (GH-3712) 
(#3779)
https://github.com/python/cpython/commit/4954b8dc5305de72ce618522522a2910c3a34126


--

___
Python tracker 

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



[issue31505] assertion failure in json, in case _json.make_encoder() received a bad encoder() argument

2017-09-26 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



[issue25359] io.open() fails to open ascii file if LANG env not set

2017-09-26 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +3766

___
Python tracker 

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



[issue31505] assertion failure in json, in case _json.make_encoder() received a bad encoder() argument

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 7c24e99c99c961e6633ac45390a211f65806c687 by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
[3.6] bpo-31505: Fix an assertion failure in json, in case _json.make_encoder() 
received a bad encoder() argument. (GH-3643) (#3777)
https://github.com/python/cpython/commit/7c24e99c99c961e6633ac45390a211f65806c687


--

___
Python tracker 

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



[issue25532] infinite loop when running inspect.unwrap over unittest.mock.call

2017-09-26 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +3765
stage: backport needed -> patch review

___
Python tracker 

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



[issue31566] assertion failure in _warnings.warn() in case of a bad __name__ global

2017-09-26 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.6

___
Python tracker 

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



[issue31505] assertion failure in json, in case _json.make_encoder() received a bad encoder() argument

2017-09-26 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +3764

___
Python tracker 

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



[issue31145] PriorityQueue.put() fails with TypeError if priority_number in tuples of (priority_number, data) are the same.

2017-09-26 Thread Lisa Roach

Lisa Roach  added the comment:

I think it is a good idea to have a simple way to add a value to sort on in 
general, it could have some interesting use-cases. Also I am with Nick a name 
change would make the broader scope clearer.

What I am not sure about is making the comparison have to be between two items 
of the same wrapper type - since right now we are comparing priority to 
priority attributes. 

It makes sense for PriorityQueues, but if we wanted to use this for something 
more arbitrary like comparing a string with an int priority to an int we end up 
having to convert both data types to the new wrapper type:

  str_cmp = KeyedItem(20, 'cat')
  int_cmp  = KeyedItem(30, 30)
  str_cmp < int_cmp


I don't like having to convert to the new wrapper unless it's relevant, I'd 
rather do:

  str_cmp = KeyedItem(20, 'cat')
  str_cmp < 30


It could be instead:

 class KeyedItem:
def __init__(self, key, item):
 self.key = key
 self.item = item
 def __eq__(self, other):
 if not isinstance(other, KeyedItem):
 return self.key == other
 return self.key == other.key

 def __lt__(self, other):
if not isinstance(other, KeyedItem):
return self.key < other
return self.key < other.key
 ...

--
nosy: +lisroach

___
Python tracker 

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



[issue31285] a SystemError and an assertion failure in warnings.warn_explicit()

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 90fe25a051bd8cf64d52be533c9b60cad9bdd7fb by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-31285: Fix an assertion failure and a SystemError in 
warnings.warn_explicit. (GH-3219) (#3775)
https://github.com/python/cpython/commit/90fe25a051bd8cf64d52be533c9b60cad9bdd7fb


--

___
Python tracker 

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



[issue31490] assertion failure in ctypes in case an _anonymous_ attr appears outside _fields_

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset bdb215b18a42360b6a9c82876fa71f19ca1a416d by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
[3.6] bpo-31490: Fix an assertion failure in ctypes in case an _anonymous_ attr 
is defined only outside _fields_. (GH-3615) (#3774)
https://github.com/python/cpython/commit/bdb215b18a42360b6a9c82876fa71f19ca1a416d


--

___
Python tracker 

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



[issue31492] assertion failures in case a module has a bad __name__ attribute

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset f0db2dfda777ad3380e7816cabe4c4240f31687f by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-31492: Fix assertion failures in case of a module with a bad __name__ 
attribute. (GH-3620). (#3773)
https://github.com/python/cpython/commit/f0db2dfda777ad3380e7816cabe4c4240f31687f


--

___
Python tracker 

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



[issue31586] SystemError in _collections._count_element() in case of a bad mapping argument

2017-09-26 Thread Raymond Hettinger

Change by Raymond Hettinger :


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



[issue31586] SystemError in _collections._count_element() in case of a bad mapping argument

2017-09-26 Thread Raymond Hettinger

Raymond Hettinger  added the comment:


New changeset a1c49f6f09150f70f063417c8d67a38e59dde7ed by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.6':
[3.6] bpo-31586: Use _count_element fast path for real dicts. (#3776)
https://github.com/python/cpython/commit/a1c49f6f09150f70f063417c8d67a38e59dde7ed


--

___
Python tracker 

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



[issue31586] SystemError in _collections._count_element() in case of a bad mapping argument

2017-09-26 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +3763

___
Python tracker 

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



[issue31586] SystemError in _collections._count_element() in case of a bad mapping argument

2017-09-26 Thread Raymond Hettinger

Raymond Hettinger  added the comment:


New changeset 31aca4bf79217e6ec4c1d056d3ad7ed4dd469c78 by Raymond Hettinger 
(Oren Milman) in branch 'master':
bpo-31586: Use _count_element fast path for real dicts.
https://github.com/python/cpython/commit/31aca4bf79217e6ec4c1d056d3ad7ed4dd469c78


--

___
Python tracker 

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



[issue2771] Test issue

2017-09-26 Thread Ezio Melotti

Ezio Melotti  added the comment:

mail test

On Wed, Sep 27, 2017 at 4:14 AM, Ezio Melotti 
wrote:

>
> Ezio Melotti  added the comment:
>
> test
>
> --
> versions: +Python 3.8 -Python 3.5
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue2771] Test issue

2017-09-26 Thread Ezio Melotti

Ezio Melotti  added the comment:

test

--
versions: +Python 3.8 -Python 3.5

___
Python tracker 

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



[issue31599] bug in doctest when comparing - 0.0 == 0.0

2017-09-26 Thread R. David Murray

Changes by R. David Murray :


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



[issue31599] bug in doctest when comparing - 0.0 == 0.0

2017-09-26 Thread Zé Vinícius

Zé Vinícius added the comment:

Hi R. David Murray,

doctest compares strings, so "-0.0" is not the same as "0.0" to doctest

Thank you. That explains why "-0.0 == 0.0" is True to Python, but False to
doctest.

Cheers,
Zé

On Tue, Sep 26, 2017 at 5:35 PM, R. David Murray 
wrote:

>
> R. David Murray added the comment:
>
> To be clear: doctest compares strings, so "-0.0" is not the same as "0.0"
> to doctest.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue31599] bug in doctest when comparing - 0.0 == 0.0

2017-09-26 Thread R. David Murray

R. David Murray added the comment:

To be clear: doctest compares strings, so "-0.0" is not the same as "0.0" to 
doctest.

--

___
Python tracker 

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



[issue31599] bug in doctest when comparing - 0.0 == 0.0

2017-09-26 Thread R. David Murray

R. David Murray added the comment:

Can you explain why you think that is a bug in doctest?  It looks like you are 
getting different output than you expect, but that by itself wouldn't be a bug 
in doctest.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue31285] a SystemError and an assertion failure in warnings.warn_explicit()

2017-09-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue31490] assertion failure in ctypes in case an _anonymous_ attr appears outside _fields_

2017-09-26 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3761

___
Python tracker 

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



[issue31492] assertion failures in case a module has a bad __name__ attribute

2017-09-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +3760
stage: backport needed -> patch review

___
Python tracker 

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



[issue31595] Preferring MSVC 2017 in Python 3.6.x new minor releases

2017-09-26 Thread xoviat

xoviat added the comment:

@zooba

Since you mention it, I agree with that proposal. But currently we have core 
developers contributing to distutils and @jaraco contributing to setuptools. 
@jaraco is quite competent, but I doubt that he would be able to maintain an 
independent fork of distutils by himself.

In short, I think your proposal is a good one, but how can we allocate manpower?

--

___
Python tracker 

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



[issue31599] bug in doctest when comparing - 0.0 == 0.0

2017-09-26 Thread Zé Vinícius

New submission from Zé Vinícius:

See https://github.com/pytest-dev/pytest/issues/2796#event-1266625358

--
messages: 303081
nosy: Zé Vinícius
priority: normal
severity: normal
status: open
title: bug in doctest when comparing - 0.0 == 0.0

___
Python tracker 

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



[issue31095] Checking all tp_dealloc with Py_TPFLAGS_HAVE_GC

2017-09-26 Thread Larry Hastings

Larry Hastings added the comment:


New changeset 0fcc03367b31f44c1e1b8d3d2dd940ef1e744326 by larryhastings (INADA 
Naoki) in branch '3.5':
bpo-31095: fix potential crash during GC (GH-2974) (#3196)
https://github.com/python/cpython/commit/0fcc03367b31f44c1e1b8d3d2dd940ef1e744326


--

___
Python tracker 

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



[issue31597] ipaddress.hosts() doesn't return anything on a /32 "network"

2017-09-26 Thread Lord Anton Hvornum

Lord Anton Hvornum added the comment:

Historically Windows have struggled with /32 assigned networks.
Trying to push such a network address to a Windows machine has usually (not
all cases) rendered it connection-less, where as switches, routers, *nix
etc have never had any major issues with the logic of a /32 network host
isolation.

Anyway, it was a slight joke/peck on the history of networking.

On Tue, Sep 26, 2017 at 10:53 PM Eric V. Smith 
wrote:

>
> Eric V. Smith added the comment:
>
> You lost me at "some Windows mentality". I come from a networking
> background.
>
> Sorry, I don't care enough about this issue to pursue it.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue31597] ipaddress.hosts() doesn't return anything on a /32 "network"

2017-09-26 Thread Eric V. Smith

Eric V. Smith added the comment:

You lost me at "some Windows mentality". I come from a networking background.

Sorry, I don't care enough about this issue to pursue it.

--

___
Python tracker 

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



[issue31586] SystemError in _collections._count_element() in case of a bad mapping argument

2017-09-26 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Oren, thank you for the work you've been doing.

--
assignee:  -> rhettinger

___
Python tracker 

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



[issue31597] ipaddress.hosts() doesn't return anything on a /32 "network"

2017-09-26 Thread Lord Anton Hvornum

Lord Anton Hvornum added the comment:

I was actually just thinking about the same thing, why not just add a
optional flag to the already existing function.
I get that people are way into backward compatibility, and I won't get into
a religious fight over that particular topic as long as there's a fix for
this honestly strange behavior. (It's some Windows mentality saying a /32
network doesn't contain any hosts when you come from a network background).

Seeing as this is apparently a touchy subject, I won't even try to submit a
patch for this because I will screw this up.
So I politely ask someone with more intricate knowledge of this library,
it's history and use to add a totally optional flag that returns the single
host on this very narrow network called /32.

On Tue, Sep 26, 2017 at 10:33 PM Eric V. Smith 
wrote:

>
> Eric V. Smith added the comment:
>
> Yes, due to backward compatibility constraints, the behavior is immutable.
>
> You might be able to argue for another method, say all_hosts(), or
> something. Or maybe even a optional parameter to hosts() that defaults to
> the existing behavior, but if provided, lets you select a new behavior.
>
> What I would not support is a change to hosts() (or a new method) that
> treats a /32 network specially.
>
> --
> nosy: +eric.smith
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue31597] ipaddress.hosts() doesn't return anything on a /32 "network"

2017-09-26 Thread Eric V. Smith

Eric V. Smith added the comment:

Yes, due to backward compatibility constraints, the behavior is immutable.

You might be able to argue for another method, say all_hosts(), or something. 
Or maybe even a optional parameter to hosts() that defaults to the existing 
behavior, but if provided, lets you select a new behavior.

What I would not support is a change to hosts() (or a new method) that treats a 
/32 network specially.

--
nosy: +eric.smith

___
Python tracker 

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



[issue31597] ipaddress.hosts() doesn't return anything on a /32 "network"

2017-09-26 Thread Lord Anton Hvornum

Lord Anton Hvornum added the comment:

And this definition is some how immutable?

On Tue, Sep 26, 2017 at 10:19 PM Serhiy Storchaka 
wrote:

>
> Serhiy Storchaka added the comment:
>
> Because this is a definition of this method.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue31597] ipaddress.hosts() doesn't return anything on a /32 "network"

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Because this is a definition of this method.

--

___
Python tracker 

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



[issue30347] itertools.groupby() can fail a C assert()

2017-09-26 Thread Serhiy Storchaka

Changes 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



[issue30347] itertools.groupby() can fail a C assert()

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset d0b9dc33676bdad217d5074954c1b37d4ca54a10 by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-30347: Stop crashes when concurrently iterate over 
itertools.groupby() iterators. (GH-1557). (#3772)
https://github.com/python/cpython/commit/d0b9dc33676bdad217d5074954c1b37d4ca54a10


--

___
Python tracker 

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



[issue31597] ipaddress.hosts() doesn't return anything on a /32 "network"

2017-09-26 Thread Lord Anton Hvornum

Lord Anton Hvornum added the comment:

This is still a very strange behavior and I can't see why this still
shouldn't return a IP address.
if the broadcast, network and host address are all the same, that should
call for a exceptional behavior from the library.
Because 127.0.0.1/32 is still a usable host address, and it's a way of
isolating a host on a network device for instance, but it's still a host
address in there.. Or am i loosing my marbles?

On Tue, Sep 26, 2017 at 10:08 PM Serhiy Storchaka 
wrote:

>
> Serhiy Storchaka added the comment:
>
> This is documented.
>
>  hosts()
>
> Returns an iterator over the usable hosts in the network. The usable
> hosts are all the IP addresses that belong to the network, except the
> network address itself and the network broadcast address.
>
> >>> import ipaddress
> >>> ipaddress.ip_network('127.0.0.1/32').network_address
> IPv4Address('127.0.0.1')
> >>> ipaddress.ip_network('127.0.0.1/32').broadcast_address
> IPv4Address('127.0.0.1')
>
> --
> nosy: +serhiy.storchaka
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue31597] ipaddress.hosts() doesn't return anything on a /32 "network"

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is documented.

 hosts()

Returns an iterator over the usable hosts in the network. The usable hosts 
are all the IP addresses that belong to the network, except the network address 
itself and the network broadcast address.

>>> import ipaddress
>>> ipaddress.ip_network('127.0.0.1/32').network_address
IPv4Address('127.0.0.1')
>>> ipaddress.ip_network('127.0.0.1/32').broadcast_address
IPv4Address('127.0.0.1')

--
nosy: +serhiy.storchaka
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



[issue30347] itertools.groupby() can fail a C assert()

2017-09-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +3759

___
Python tracker 

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



[issue31580] Defer compiling regular expressions

2017-09-26 Thread Ezio Melotti

Ezio Melotti added the comment:

What about adding a lazy_compile() function?  It will leave the current 
behavior unchanged, it's explicit, and it's easier to use cross version (if 
importing re.lazy_compile fails, use re.compile).

FWIW I'm -1 on changing re.compile, -1 on adding re.IMMEDIATE, -0.5 on adding 
re.DEFERRED (not sure this option belongs among the re flag), +1 on adding a 
compile-time optimization.

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue29624] Python 3.5.3 x86 web installer cannot install launcher

2017-09-26 Thread Steve Dower

Changes by Steve Dower :


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



[issue31598] pyping 0.0.5 package crashed on ZeroDivisionError: float division by zero

2017-09-26 Thread R. David Murray

R. David Murray added the comment:

pyping is not part of the standard library, you'll need to find their bug 
tracker and report the problem to them.

--
nosy: +r.david.murray
resolution:  -> third party
stage:  -> resolved
status: open -> closed
type: crash -> behavior

___
Python tracker 

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



[issue31595] Preferring MSVC 2017 in Python 3.6.x new minor releases

2017-09-26 Thread Steve Dower

Changes by Steve Dower :


--
resolution:  -> out of date
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



[issue31598] pyping 0.0.5 package crashed on ZeroDivisionError: float division by zero

2017-09-26 Thread Saravanan Nagarajan

New submission from Saravanan Nagarajan:

r = pyping.ping(hostip)
  File "build/bdist.linux-x86_64/egg/pyping/core.py", line 426, in ping
return p.run(count)
  File "build/bdist.linux-x86_64/egg/pyping/core.py", line 288, in run
self.print_exit()
  File "build/bdist.linux-x86_64/egg/pyping/core.py", line 208, in print_exit
lost_rate = float(lost_count) / self.send_count * 100.0
ZeroDivisionError: float division by zero

--
components: Extension Modules
messages: 303066
nosy: saravanan1987
priority: normal
severity: normal
status: open
title: pyping 0.0.5 package crashed on ZeroDivisionError: float division by zero
type: crash
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



[issue31595] Preferring MSVC 2017 in Python 3.6.x new minor releases

2017-09-26 Thread Steve Dower

Steve Dower added the comment:

Let me hop in my time machine and fix that for you: 
https://github.com/python/cpython/pull/3425

(FWIW, I think it makes *much* more sense for setuptools to fix this by simply 
forking all of distutils and never looking back. But since we don't live in 
that world yet, it went into distutils.)

--

___
Python tracker 

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



[issue27494] 2to3 parser failure caused by a comma after a generator expression

2017-09-26 Thread Jakub Stasiak

Changes by Jakub Stasiak :


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

___
Python tracker 

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



[issue30347] itertools.groupby() can fail a C assert()

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 69b2dc8637ba924d78f9869be592c5a545510f10 by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
[3.6] bpo-30347: Stop crashes when concurrently iterate over 
itertools.groupby() iterators. (GH-1557) (#3770)
https://github.com/python/cpython/commit/69b2dc8637ba924d78f9869be592c5a545510f10


--

___
Python tracker 

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



[issue31580] Defer compiling regular expressions

2017-09-26 Thread Stefan Behnel

Stefan Behnel added the comment:

I'm also against changing re.compile() to not compile.

And I often write code like this:

replace_whitespace = re.compile(r"\s+").sub

which is not covered by your current proposed change.

--
nosy: +scoder

___
Python tracker 

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



[issue31597] ipaddress.hosts() doesn't return anything on a /32 "network"

2017-09-26 Thread Lord Anton Hvornum

New submission from Lord Anton Hvornum:

https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Network.hosts

I couldn't find anywhere in the documentation mentioning the fact that doing 
the following would return nothing:

>>> import ipaddress
>>> net = ipaddress.ip_network('127.0.0.1/32')
>>> list(net.hosts())
[]

For all intense and purposes, that network still contains hosts.
That being one single lonely host of '127.0.0.1'.

It's illogical to not return any hosts if there actually are one or more in 
there.
Now the programmer has to do a one-off-check to see if this particular defined 
network (of a huge list usually)
happens to end with /32, then it needs to treat the item not as a defined 
network (even tho it is with a netmask),
but rather strip the netmask and treat it as a single host entity.. It makes no 
sense if you're iterating over a huge list of network infrastructure.

--
components: Library (Lib)
messages: 303063
nosy: Lord Anton Hvornum
priority: normal
severity: normal
status: open
title: ipaddress.hosts() doesn't return anything on a /32 "network"
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue30347] itertools.groupby() can fail a C assert()

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset c740e4fe8a9bc5815dc18c38d7f7600b128c3c51 by Serhiy Storchaka in 
branch 'master':
bpo-30347: Stop crashes when concurrently iterate over itertools.groupby() 
iterators. (#1557)
https://github.com/python/cpython/commit/c740e4fe8a9bc5815dc18c38d7f7600b128c3c51


--

___
Python tracker 

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



[issue30347] itertools.groupby() can fail a C assert()

2017-09-26 Thread Roundup Robot

Changes by Roundup Robot :


--
keywords: +patch
pull_requests: +3757

___
Python tracker 

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



[issue31595] Preferring MSVC 2017 in Python 3.6.x new minor releases

2017-09-26 Thread Zachary Ware

Zachary Ware added the comment:

3.5 is in security-fix-only mode, so it will not receive such an update.  3.6 
is up to Ned and Steve.

--
assignee:  -> steve.dower
components: +Windows
nosy: +ned.deily, paul.moore, steve.dower, tim.golden, zach.ware
title: Preferring MSVC 2017 in Python 3.5.x and 3.6.x new minor releases -> 
Preferring MSVC 2017 in Python 3.6.x new minor releases
versions: +Python 3.6

___
Python tracker 

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



[issue31580] Defer compiling regular expressions

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Barry, please test re.search() with your changes.

$ ./python -m timeit -s 'import re; s = "a" * 100' 're.search("b", s)'
Unpatched:  50 loops, best of 5: 529 nsec per loop
Patched:5 loops, best of 5: 7.46 usec per loop

--

___
Python tracker 

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



[issue31596] expose pthread_getcpuclockid in time module

2017-09-26 Thread pdox

New submission from pdox:

time.clock_gettime() makes it possible to retrieve the thread-specific cpu-time 
clock for the current thread using time.CLOCK_THREAD_CPUTIME_ID. However, it is 
currently not possible in Python to retrieve the thread-specific clock for 
other threads. Exposing pthread_getcpuclockid() makes this possible.

--
components: Extension Modules
messages: 303059
nosy: pdox
priority: normal
pull_requests: 3756
severity: normal
status: open
title: expose pthread_getcpuclockid in time module
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue27494] 2to3 parser failure caused by a comma after a generator expression

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

set(x for x in range(2),) can be interpreted as set(x for x in (range(2),)).

Wouldn't be better to forbid such ambiguous syntax? The trailing comma in 
argument list is supported because it helps to add new arguments (or temporary 
comment out arguments).

foo(x,
y,
#z,
   )

But set(x for x in range(2),) is not syntactically valid if add an argument 
after the comma. Parenthesis around a generator expression can be omitted only 
if it is the only argument in a function call. I think that it would be better 
to forbid a trailing comma in this case.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31595] Preferring MSVC 2017 in Python 3.5.x and 3.6.x new minor releases

2017-09-26 Thread xoviat

New submission from xoviat:

MSVC 2017 retains ABI compatibility with MSVC 2015, yet supports (as always 
with a newer compiler version) more features and compiles faster. Because it 
retains ABI compatibility with existing Python versions, I think it makes sense 
for distutils to prefer it (this could be fixed in setuptools, but distutils 
generally takes care of compiler detection).

Thoughts?

--
components: Distutils
messages: 303057
nosy: dstufft, merwok, xoviat
priority: normal
severity: normal
status: open
title: Preferring MSVC 2017 in Python 3.5.x and 3.6.x new minor releases
type: enhancement

___
Python tracker 

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



[issue31594] Make bytes and bytearray maketrans accept dictionaries as first argument as it's done in str

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Inconsistency is a weak argument. It itself is not enough to add a new feature. 
str.translate() accepts a mapping instead of a string (as it would be for 
consistency with bytes.translate()) because it would be inconvenient to provide 
a 1114112-character string. str.maketrans() just compile a mapping in the 
optimized representation, because using a general mapping is not very efficient.

A bytes object of length 256 already is the most efficient representation of 
the translation table for bytes. And you can create it from a mapping in Python:

def mymaketrans(mapping):
table = bytearray(range(256))
for x, y in mapping.items():
table[x] = y
return table

--

___
Python tracker 

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



[issue28293] Don't completely dump the regex cache when full

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your reviews.

Currently the caching logic is simpler, it no longer depends on the LOCALE flag 
and the current locale. But it still is too complex for lru_cache. It needs a 
way to bypass caching based on arguments or result.

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



[issue31594] Make bytes and bytearray maketrans accept dictionaries as first argument as it's done in str

2017-09-26 Thread Oleksandr Suvorov

Oleksandr Suvorov added the comment:

This change requested just because I find it inconsistent and passing
translation as key-value is much easier to read rather than two lists.
When translation table gets bigger than 10 pairs it gets annoying to match
in the head between from and to while reading it.
Could be marked as minor.
--_

> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue28293] Don't completely dump the regex cache when full

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 114454e9f6addbcb364e9a37102c8131ae2da1dd by Serhiy Storchaka in 
branch 'master':
bpo-28293: Don't completely dump the regex cache when full. (#3768)
https://github.com/python/cpython/commit/114454e9f6addbcb364e9a37102c8131ae2da1dd


--

___
Python tracker 

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



[issue29442] Replace optparse with argparse in setup.py

2017-09-26 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Thanks to Serhiy Storchaka's work in issue 30152, this patch can be simplified. 
I've rebased my branch and updated the pull request.

--

___
Python tracker 

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



[issue31594] Make bytes and bytearray maketrans accept dictionaries as first argument as it's done in str

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Why do you need this functionality?

--

___
Python tracker 

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



[issue31580] Defer compiling regular expressions

2017-09-26 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I'm flat-out opposed to changing the default behavior.  If some API change gets 
make it needs to strictly be opt-in.  

Even then, I don't think this is a great idea.  We already have ways to do it 
if people actually cared about this.

FWIW, other languages also have regex compile() and it always means compile 
immediate.  The proposed change alters the semantics of existing code and 
undermines the explicit decisions of people who wrote existing packages.  It is 
at odds with what re.compile() means everywhere else.

Having an opt-out IMMEDIATE flag makes it difficult for package writers to 
maintain code across versions.  Also flags further complicate an API that is 
already challenging.

--

___
Python tracker 

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



[issue31594] Make bytes and bytearray maketrans accept dictionaries as first argument as it's done in str

2017-09-26 Thread Oleksandr Suvorov

Oleksandr Suvorov added the comment:

str.maketrans in python3 is able to accept just one argument which is a
mapping of translations.
While bytearray and bytes are still using only old way where you should
pass two iterables from and to.

static str.maketrans(x [,y [,z]])
static bytes.maketrans(from, to)
static bytearray.maketrans(from, to)

On Tue, Sep 26, 2017 at 6:12 PM, Serhiy Storchaka 
wrote:

>
> New submission from Serhiy Storchaka:
>
> Could you please provide more information? What the problem you want to
> solve?
>
> --
> nosy: +serhiy.storchaka
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue31594] Make bytes and bytearray maketrans accept dictionaries as first argument as it's done in str

2017-09-26 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Could you please provide more information? What the problem you want to solve?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31594] Make bytes and bytearray maketrans accept dictionaries as first argument as it's done in str

2017-09-26 Thread Oleksandr Suvorov

Changes by Oleksandr Suvorov :


--
components: Interpreter Core
nosy: soosleek
priority: normal
severity: normal
status: open
title: Make bytes and bytearray maketrans accept dictionaries as first argument 
as it's done in str
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue31580] Defer compiling regular expressions

2017-09-26 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Sep 26, 2017, at 11:27, R. David Murray  wrote:
> 
> Precompiling as a compile-time optimization would be cool.  I think we are 
> currently favoring doing that kind of thing as an AST optimization step?

I was thinking about that too.

> I think Raymond and my point was that the current behavior should remain 
> unchanged by default.  So a re.DEFERRED flag whose default is False would be 
> a possible candidate for the "new API" I suggested :)

Yep, it’s definitely a behavior change, so its the classic “add a new api and 
most projects won’t get the benefits until they opt-in” problem.  But the 
problem with that of course is that there are module global re.compiles 
*everywhere* including probably most commonly in libraries X dependencies deep, 
which you can’t opt into even if you know it’s safe.  There are probably ways 
to deal with that, but it all adds complexity.  So adding a deferred 
compilation API may be valuable, but only in the very long run.

The backward compatibility issue may indeed be the fatal flaw here.  I’m not 
sure whether the far future payoff is worth adding the new API.  Maybe, but 
let’s see how far we can get in the meantime.

> However, compile time optimization could default to on like our peephole 
> optimizations do[*], I don't think anyone would be upset about that.
> 
> [*] There are complaints that you can't turn them *off*, but that's a 
> separate issue :)

Yep!  I think I’m going to see if I can make any interesting progress on that, 
and we’ll just leave this issue open as a placeholder in the meantime.

--

___
Python tracker 

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



[issue31580] Defer compiling regular expressions

2017-09-26 Thread R. David Murray

R. David Murray added the comment:

Precompiling as a compile-time optimization would be cool.  I think we are 
currently favoring doing that kind of thing as an AST optimization step?

I think Raymond and my point was that the current behavior should remain 
unchanged by default.  So a re.DEFERRED flag whose default is False would be a 
possible candidate for the "new API" I suggested :)

However, compile time optimization could default to on like our peephole 
optimizations do[*], I don't think anyone would be upset about that.

[*] There are complaints that you can't turn them *off*, but that's a separate 
issue :)

--

___
Python tracker 

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



[issue22140] "python-config --includes" returns a wrong path (double prefix)

2017-09-26 Thread Michał Górny

Michał Górny added the comment:

I've submitted a pull request with another fix. I've tried to keep the changes 
at minimal but I couldn't stand keeping meaningless 'echo $x | sed -e s/$x/$y/' 
;-).

I have to point out that the attached patch is wrong since it does readlink on 
CFLAGS 

--
versions: +Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue22140] "python-config --includes" returns a wrong path (double prefix)

2017-09-26 Thread Michał Górny

Changes by Michał Górny :


--
keywords: +patch
pull_requests: +3754
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



[issue28293] Don't completely dump the regex cache when full

2017-09-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +barry

___
Python tracker 

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



[issue28293] Don't completely dump the regex cache when full

2017-09-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +3753

___
Python tracker 

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



[issue31592] assertion failure in Python/ast.c in case of a bad unicodedata.normalize()

2017-09-26 Thread Oren Milman

Changes by Oren Milman :


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

___
Python tracker 

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



[issue31592] assertion failure in Python/ast.c in case of a bad unicodedata.normalize()

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, and passing arguments to this function is tricky. If faked 
unicodedata.normalize save the args tuple it will see a mutated tuple 
containing a hanging reference.

This is a good opportunity of using the fast call protocol.

--
nosy: +benjamin.peterson, brett.cannon, haypo, ncoghlan, serhiy.storchaka, 
yselivanov

___
Python tracker 

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



[issue31580] Defer compiling regular expressions

2017-09-26 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Let's separate the use of lru_cache from the deferred compilation.  I think 
I'll just revert the change to use lru_cache, although I'll note that the 
impetus for this was the observation that once MAXCACHE is reached the entire 
regexp cache is purged.  That seems suboptimal and my guess is that it was done 
because the current cache is just a dictionary so there's no good way to 
partially purge it.  My thought there was maybe to use an OrderedDictionary, 
but I'm not sure the complexity is worth it.  We can evaluate that separately.

I'm not sure RDB and Raymond noticed the addition of the re.IMMEDIATE flag.  
That's exactly the way you would say "compile this regexp right now", so that 
option is absolutely not taken away!  My claim is that most regexps at module 
scope do *not* need to be compiled at import time, and doing so is a waste of 
resources.  For cases where you really need it, you have it.

I did notice the warnings problem and mostly glossed over it, but for this 
patch to become "real" we'd have to try to restore that.

The other thought I had was this: if we can observe that most module scope 
re.compiles() are essentially constants, then maybe the 
compiler/peephole/PEP511 can help here.  It could recognize constant arguments 
to re.compile() and precompile them.

--

___
Python tracker 

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



[issue31151] socketserver.ForkingMixIn.server_close() leaks zombie processes

2017-09-26 Thread STINNER Victor

STINNER Victor added the comment:

I proposed the bpo-31593 to fix the issue differently in Python 3.6 (and maybe 
also Python 2.7).

--

___
Python tracker 

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



[issue31593] [2.7][3.6] test_socketserver ForkingMixIn tests leaks child processes on Python 3.6

2017-09-26 Thread STINNER Victor

Changes by STINNER Victor :


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

___
Python tracker 

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



[issue31593] [2.7][3.6] test_socketserver ForkingMixIn tests leaks child processes on Python 3.6

2017-09-26 Thread STINNER Victor

Changes by STINNER Victor :


--
title: test_socketserver ForkingMixIn tests leaks child processes -> [2.7][3.6] 
test_socketserver ForkingMixIn tests leaks child processes on Python 3.6
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



[issue31593] test_socketserver ForkingMixIn tests leaks child processes

2017-09-26 Thread STINNER Victor

New submission from STINNER Victor:

The bpo-31151 (socketserver.ForkingMixIn.server_close() leaks zombie processes) 
was fixed in the master branch, but 2.7 and 3.6 branches were not changed.

I proposed to modify test_socketserver to explicitly waits until child 
processes complete. See attached PR.

Example of leaked child processes the on "x86 Gentoo Refleaks 3.6" buildbot:

http://buildbot.python.org/all/builders/x86%20Gentoo%20Refleaks%203.6/builds/102/steps/test/logs/stdio

0:26:11 load avg: 5.72 [ 62/405] test_socketserver passed -- running: 
test_multiprocessing_forkserver (594 sec)
beginning 6 repetitions
123456
Warning -- reap_children() reaped child process 6891
.Warning -- reap_children() reaped child process 6976
Warning -- reap_children() reaped child process 6981
.Warning -- reap_children() reaped child process 7059
.Warning -- reap_children() reaped child process 7136
..Warning -- reap_children() reaped child process 7306
.

--
messages: 303040
nosy: haypo
priority: normal
severity: normal
status: open
title: test_socketserver ForkingMixIn tests leaks child processes
versions: Python 3.6

___
Python tracker 

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



[issue31588] SystemError in class creation in case of a metaclass with a bad __prepare__() method

2017-09-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +eric.snow, ncoghlan

___
Python tracker 

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



[issue31415] Add -X option to show import time

2017-09-26 Thread STINNER Victor

STINNER Victor added the comment:

> The output in PR 3765 partially duplicates the output of the -v option.

Right. But the idea is to be able to use "grep 'import time:'" to only extract 
importtime logs. "-v" logs different kind of informations.

--
nosy: +haypo

___
Python tracker 

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



[issue31415] Add -X option to show import time

2017-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The output in PR 3765 partially duplicates the output of the -v option.

--

___
Python tracker 

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



[issue31170] Update to expat 2.2.4 (expat: utf8_toUtf8 cannot properly handle exhausting buffer)

2017-09-26 Thread Larry Hastings

Larry Hastings added the comment:


New changeset 44c1b62939a6192776dc9d093546154044cb2ecb by larryhastings (Steve 
Dower) in branch '3.5':
[3.5] bpo-31170: Fix inclusion of expat in Windows build projects. (#3751)
https://github.com/python/cpython/commit/44c1b62939a6192776dc9d093546154044cb2ecb


--

___
Python tracker 

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



[issue31415] Add -X option to show import time

2017-09-26 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3750

___
Python tracker 

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



[issue31592] assertion failure in Python/ast.c in case of a bad unicodedata.normalize()

2017-09-26 Thread Oren Milman

New submission from Oren Milman:

The following code causes an assertion failure:

import unicodedata
def bad_normalize(*args):
return None

unicodedata.normalize = bad_normalize
import ast
ast.parse('\u03D5')


This is because init_normalization() (in Python/ast.c) assumes that
unicodedata.normalize() is valid, and stores it in the compiling struct.
Later, new_identifier() calls the stored function, assumes it returned a
string, and passes it to PyUnicode_InternInPlace(), which asserts it is a
string.

--
components: Interpreter Core
messages: 303036
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: assertion failure in Python/ast.c in case of a bad 
unicodedata.normalize()
type: crash
versions: Python 3.7

___
Python tracker 

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



[issue30844] selectors: Add urgent data to read event

2017-09-26 Thread STINNER Victor

STINNER Victor added the comment:

It would help to look how Twisted, eventlet, gevent and others handle "urgent 
data" and "exceptions". Check if they succeeded to formalize these events.

asyncore uses select() or poll().

asyncore.poll() uses select.select(). It adds the fd to exceptfds if the fd is 
in the readfds or writefds, then asyncore calls _exception():

r = []; w = []; e = []
for fd, obj in map.items():
is_r = obj.readable()
is_w = obj.writable()
(...)
if is_r or is_w:
e.append(fd)
(...)

try:
r, w, e = select.select(r, w, e, timeout)
except select.error, err:
(...)

(...)

for fd in e:
obj = map.get(fd)
if obj is None:
continue
_exception(obj)

asyncore.poll2() uses select.poll(). It only uses POLLPRI if the fd is readable 
but always checks for error condition (POLLERR) (if asyncio waits for read 
and/or write events):

for fd, obj in map.items():
flags = 0
if obj.readable():
flags |= select.POLLIN | select.POLLPRI
# accepting sockets should not be writable
if obj.writable() and not obj.accepting:
flags |= select.POLLOUT
if flags:
# Only check for exceptions if object was either readable
# or writable.
flags |= select.POLLERR | select.POLLHUP | select.POLLNVAL
pollster.register(fd, flags)

--

___
Python tracker 

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



[issue30844] selectors: Add urgent data to read event

2017-09-26 Thread STINNER Victor

STINNER Victor added the comment:

On Windows, exceptfds of select() is not only related to urgent ("out of band") 
data, it also notifies connect() failure:

exceptfds:

If processing a connect call (nonblocking), connection attempt failed.
OOB data is available for reading (only if SO_OOBINLINE is disabled).

https://msdn.microsoft.com/en-us/library/windows/desktop/ms740141(v=vs.85).aspx

I'm not sure that we can easily simplify the third parameter of select() as 
"urgent data". The exact semantics seems to not be portable at all.

poll() describes better the event types. Extract of my local Linux poll() 
manual:

POLLPRI: "There is urgent data to read (e.g., out-of-band data on TCP socket; 
pseudoterminal master in packet mode has seen state change in slave)."

POLLERR: "Error condition (only returned in revents; ignored in events)."

POLLHUP: "Hang up (only returned in revents; ignored in events).  Note that 
when reading from a channel such as a pipe or a stream socket, this event 
merely indicates that  the  peer closed its end of the channel.  Subsequent 
reads from the channel will return 0 (end of file) only after all outstanding 
data in the channel has been consumed."

etc.

--

___
Python tracker 

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



[issue30844] selectors: Add urgent data to read event

2017-09-26 Thread STINNER Victor

STINNER Victor added the comment:

Anothe piece of history, the creation of the selectors module, bpo-16853, 
directly with the win32 "select.select(r, w, w, timeout)":

commit 243d8d85debaa319a2be0143003a9e881a0f5646
Author: Charles-François Natali 
Date:   Wed Sep 4 19:02:49 2013 +0200

Issue #16853: Add new selectors module.

--

___
Python tracker 

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



[issue30844] selectors: Add urgent data to read event

2017-09-26 Thread Pim Klanke

Pim Klanke added the comment:

On 26-09-17 12:29, STINNER Victor wrote:
> 
> STINNER Victor added the comment:
> 
> Using Git history, I found the following commit which added "r, w, x = 
> select(r, w, w, timeout)" for Windows in tulip (old name of the asyncio 
> project, when it was developed outside CPython):
> 
> commit 84124f3d725c9931249d083e78f43fcda91c383a
> Author: Richard Oudkerk 
> Date:   Fri Jan 18 13:03:09 2013 +
> 
>  Minimal chages to make tests pass on Windows
> 
> https://github.com/python/asyncio/commit/84124f3d725c9931249d083e78f43fcda91c383a
Thanks!

Although this still does not teach us why the test failed on Windows and 
what is solved by adding the wrapper method, it does suggest that indeed 
the runtime behaviour will not be affected by removing the wrapper method.

The unit test might. To be honest, I did not run unit tests on Windows. 
Maybe by doing this, it might just tell us exactly what is accomplished 
with the wrapper method.
> 
> --
> 
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue30844] selectors: Add urgent data to read event

2017-09-26 Thread Pim Klanke

Pim Klanke added the comment:

On 26-09-17 11:51, STINNER Victor wrote:
> 
> STINNER Victor added the comment:
> 
> I'm not confortable with the change because of following questions:
> 
> * It seems like your patch changes the SelectSelector behaviour on Windows. 
> How is a selectors user supposed to upgrade his/her code to get the same 
> behaviour on Python 3.6 and 3.7? Would it make sense to add a flag to 
> SelectSelectors get the old behaviour?
The wrapper method around the winsock select method causes 
SelectSelector to behave differently on Windows, which is wrong IMHO. 
The behaviour should be the same. Why this wrapper exists is unclear to 
me and since it conflicts with the change I want to make, I asked 
questions about it 8 weeks ago. Now time has passed and no answers were 
given, I decided to remove it. Without further documentation I do not 
know how to modify it otherwise.

The other solution would be to add the new feature to all OS's but 
Windows, but again, since the wrapper method defies logic and is 
undocumented, I chose to remove it.
> 
> * KqueueSelector doesn't support urgent event. How is a selectors user 
> suppose to be aware of them? Use a blacklist of selectors which doesn't 
> support urgent events? This list might evolve in the future, so maybe the 
> selector should announce which events are supported?
KqueueSelector raises a ValueError on registering an invalid event. 
Accepted events defined in the base class are READ, WRITE and URGENT. 
Accepted events is overruled in KQueueSelector, allowing only READ and 
WRITE.

> 
> * This change alone is going to change asyncio behaviour on Windows, no? 
> Because of the SelectSelector behaviour change on Windows.
Reviewing the documentation of winsock select, I can think of no reason 
why this should change the runtime behaviour of SelectSelector, as well 
as asyncio.
> 
> --
> 
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue31588] SystemError in class creation in case of a metaclass with a bad __prepare__() method

2017-09-26 Thread Oren Milman

Changes by Oren Milman :


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

___
Python tracker 

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



[issue31591] Closing socket raises AttributeError: 'collections.deque' object has no attribute '_decref_socketios'

2017-09-26 Thread reidfaiv

New submission from reidfaiv:

We have one application misbehaving in production environment under the load: 
it segfaults occasionally and throws exception which does not seem to make 
sense. We have tested both on 3.4 and 3.5.

For a background - we have taken a bit unusual path - as server is heavy on IO, 
bound to wait for external services but sometimes requires a lot of CPU to 
process next batch, then we use a many threads. We suspect that issues are 
related to multi-threading or running out some system level resources. We 
create connections (sockets) in each thread and do not use these across 
different threads - due this we have large number of sockets in use.

We have seen such segfaults:

#0  0x004998a6 in sock_dealloc.50395 (s=0x7fafc2573800) at 
../Modules/socketmodule.c:3864
#1  0x005356c3 in subtype_dealloc.15489 (self=) at ../Objects/typeobject.c:1201
#2  0x0048b0a2 in PyEval_EvalFrameEx (f=f@entry=Frame 0x2281a08, for 
file /usr/lib/python3.4/ssl.py, line 669, in getpeercert (self=, binary_form=False), throwflag=throwflag@entry=0)
at ../Python/ceval.c:2421
#3  0x0048e45b in PyEval_EvalCodeEx (_co=, 
globals=, locals=, args=, 
argcount=, kws=0x7fb0232080b0, kwcount=0, defs=0x7fb075447178, 
defcount=1,
kwdefs=0x0, closure=0x0) at ../Python/ceval.c:3588
#4  0x0048a673 in fast_function (nk=, na=, n=, pp_stack=0x7fb00f4ee500, func=) at ../Python/ceval.c:4344
#5  call_function (oparg=, pp_stack=0x7fb00f4ee500) at 
../Python/ceval.c:4262
#6  PyEval_EvalFrameEx (
f=f@entry=Frame 0x7fb023207f08, for file 
/usr/local/lib/python3.4/dist-packages/boto/https_connection.py, line 132, in 
connect (self=, _abc_registry=, __init__=, __doc__=None, 
_abc_negative_cache=, 
__abstractmethods__=frozenset(), __module__='boto.connection', read=, _abc_negative_cache_version=28) at remote 
0x1a48bb8>, 
ca_certs='/usr/local/lib/python3.4/dist-packages/boto/cacerts/cacerts.txt', 
_tunnel_port=None, port=443, host='dynamodb.eu-
 west-1.amazonaws.com', source_address=No...(truncated), 
throwflag=throwflag@entry=0) at ../Python/ceval.c:2838


and

#0  PyObject_SetAttr (v=v@entry=, 
name='keyfile', value=value@entry=None) at ../Objects/object.c:913
#1  0x00486e0f in PyEval_EvalFrameEx (
f=f@entry=Frame 0x7f8ef2246e88, for file /usr/lib/python3.4/ssl.py, line 
546, in __init__ (self=, sock=, keyfile=None, certfile=None, server_side=False, 
cert_reqs=2, ssl_version=2, 
ca_certs='/usr/local/lib/python3.4/dist-packages/boto/cacerts/cacerts.txt', 
do_handshake_on_connect=True, family=) at remote 
0x7f8f4fc51748>, 1: ) at remote 0x7f8f4fc52108>, 2: <...>, 3: 
) at remote 
0x7f8f4fc516c8>, 4: ) at remote 0x7f8f4fc519c8>, 5: ) at remote 0x7f8f4fc52188>, 6: 
) at remote 0x7f8f4fc51bc8>, 7: <...(truncated), 
throwflag=throwflag@entry=0) at ../Python/ceval.c:2123
#2  0x0048f2df in PyEval_EvalCodeEx (closure=0x0, kwdefs=0x0, 
defcount=, defs=0x7f8f4edc5060, kwcount=, 
kws=0x7f8ed4376a20, argcount=1, args=, locals=0x0, 
globals=,
_co=) at ../Python/ceval.c:3588
#3  function_call.78485 (func=, arg=, 
kw=) at ../Objects/funcobject.c:632
#4  0x0053493d in PyObject_Call (
kw={'ciphers': None, 'suppress_ragged_eofs': True, 'sock': , 'server_side': False, 'ca_certs': 
'/usr/local/lib/python3.4/dist-packages/boto/cacerts/cacerts.txt', 
'do_handshake_on_connect': True, 'cert_reqs': 2, 'ssl_version': 2, 'certfile': 
None, 'keyfile': None}, arg=(,), 
func=) at ../Objects/abstract.c:2040


There are also Python level exceptions:

AttributeError: 'collections.deque' object has no attribute '_decref_socketios'

  .. application stack snipped ...

  File "application/readers/s3_state_reader.py", line 50, in read_state
bucket = 
s3_connection.get_bucket(conf.appconf[_version.version]['s3.bucket_name'])
  File "boto/s3/connection.py", line 506, in get_bucket
return self.head_bucket(bucket_name, headers=headers)
  File "boto/s3/connection.py", line 526, in head_bucket
body = response.read()
  File "boto/connection.py", line 410, in read
self._cached_response = http_client.HTTPResponse.read(self)
  File 

[issue30844] selectors: Add urgent data to read event

2017-09-26 Thread STINNER Victor

STINNER Victor added the comment:

Using Git history, I found the following commit which added "r, w, x = 
select(r, w, w, timeout)" for Windows in tulip (old name of the asyncio 
project, when it was developed outside CPython):

commit 84124f3d725c9931249d083e78f43fcda91c383a
Author: Richard Oudkerk 
Date:   Fri Jan 18 13:03:09 2013 +

Minimal chages to make tests pass on Windows

https://github.com/python/asyncio/commit/84124f3d725c9931249d083e78f43fcda91c383a

--

___
Python tracker 

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



[issue31589] Links for French documentation pdf is broken

2017-09-26 Thread Julien Palard

Julien Palard added the comment:

Hi Fabrice,

Thanks for reporting.

The whole archives/ directory is completly missing for french and japanese, 
I'll take a look.

Bug is probably really near 
https://github.com/python/docsbuild-scripts/blob/master/build_docs.py#L222

--

___
Python tracker 

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



[issue31587] Enum doesn't allow name

2017-09-26 Thread Robert Gomułka

Robert Gomułka added the comment:

It turns out that enum34 backports module was the culprit (it was first on 
search path). When using enum native module, everything works as expected:

> c:\Python\Python36-32\python.exe -I
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:14:34) [MSC v.1900 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import enum
>>> enum

>>> @enum.unique
... class A(enum.IntEnum):
... a = 1
... name = 2
... value = 3
...
>>> exit()

> c:\Python\Python36-32\python.exe
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:14:34) [MSC v.1900 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import enum
>>> enum

>>> @enum.unique
... class A(enum.IntEnum):
... a = 1
... name = 2
... value = 3
...
Traceback (most recent call last):
  File "", line 2, in 
  File "C:\Python27\Lib\site-packages\enum\__init__.py", line 835, in unique
(enumeration, duplicate_names)
ValueError: duplicate names found in : a -> A.name, name -> A.name, 
value -> A.name

Sorry for the noise.

--
resolution:  -> third party
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



[issue30844] selectors: Add urgent data to read event

2017-09-26 Thread STINNER Victor

STINNER Victor added the comment:

I'm not confortable with the change because of following questions:

* It seems like your patch changes the SelectSelector behaviour on Windows. How 
is a selectors user supposed to upgrade his/her code to get the same behaviour 
on Python 3.6 and 3.7? Would it make sense to add a flag to SelectSelectors get 
the old behaviour?

* KqueueSelector doesn't support urgent event. How is a selectors user suppose 
to be aware of them? Use a blacklist of selectors which doesn't support urgent 
events? This list might evolve in the future, so maybe the selector should 
announce which events are supported?

* This change alone is going to change asyncio behaviour on Windows, no? 
Because of the SelectSelector behaviour change on Windows.

--

___
Python tracker 

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



[issue31586] SystemError in _collections._count_element() in case of a bad mapping argument

2017-09-26 Thread Oren Milman

Changes by Oren Milman :


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

___
Python tracker 

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



[issue31590] CSV module incorrectly treats escaped newlines as new records if unquoted

2017-09-26 Thread Vaibhav Mallya

New submission from Vaibhav Mallya:

I'm writing python `csv` based-parsers as part of a data processing pipeline 
that includes Redshift and other data stores upstream and down. It's easy and 
expected in all of these data stores  
(http://docs.aws.amazon.com/redshift/latest/dg/r_UNLOAD.html) that CSV-style 
data can be generated with ESCAPE'd newlines, and with or without quotes on the 
columns.

Challenge: However, 2.x CSV module has a bug where ESCAPE'd newlines in 
unquoted CSVs are not actually treated as escaped newlines, but as entirely new 
record entries. This is at odds with expected behavior in most common data 
warehouses (See - Redshift docs I linked above for example) and is a subtle 
source of bugs for data processing pipelines. We changed our Redshift 
Parameters to ADDQUOTES so we could get around this bug, after some debugging. 

Note - This seems to be a continuation of https://bugs.python.org/issue15927 
which was closed as WONTFIX for 2.x. I think this is a legitimate bug, and 
should be fixed in 2.x. If someone is relying on old / bad behavior might mean 
something else is wrong. In my view, the current behavior effectively adds an 
implicit, undocumented dialect to the CSV module.

--
components: Library (Lib)
messages: 303025
nosy: mallyvai
priority: normal
severity: normal
status: open
title: CSV module incorrectly treats escaped newlines as new records if unquoted
type: behavior
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



  1   2   >