[issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks

2017-08-18 Thread Nick Coghlan

Nick Coghlan added the comment:

+1 for treating Queue.put() specifically as the case to be handled, as that's 
the mechanism that can be used to *avoid* running complex operations directly 
in __del__ methods and weakref callbacks.

For testing purposes, the current deadlock can be reliably reproduced with 
sys.settrace:

```
>>> import sys
>>> import queue
>>> the_queue=queue.Queue()
>>> counter = 0
>>> def bad_trace(*args):
... global counter
... counter += 1
... print(counter)
... the_queue.put(counter)
... return bad_trace
... 
>>> sys.settrace(bad_trace)
>>> the_queue.put(None)
1
2
3
4
5
6
7
[and here we have a deadlock]
```

--

___
Python tracker 

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



[issue30721] Show expected input for right shift operator usage in custom "print" error message

2017-08-18 Thread Nick Coghlan

Changes by Nick Coghlan :


--
pull_requests: +3192

___
Python tracker 

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



[issue31232] Backport the new custom "print >> sys.stderr" error message?

2017-08-18 Thread Nick Coghlan

Changes by Nick Coghlan :


--
pull_requests: +3191

___
Python tracker 

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



[issue31232] Backport the new custom "print >> sys.stderr" error message?

2017-08-18 Thread Nick Coghlan

Nick Coghlan added the comment:

The condition we (mostly Serhiy) came up with for the check is actually kinda 
neat, since it's based on the value of the LHS and is hard to trigger 
accidentally:

```
>>> printf = print
>>> print = 10
>>> print >> 1
5
>>> printf >> 1
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and 
'int'. Did you mean "print(, file=)"
```

Anyway, I'll put together a PR that combines both the original patch and the 
follow up fix to add the missing question mark.

--

___
Python tracker 

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



[issue31236] improve some error messages of min() and max()

2017-08-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
components: +Interpreter Core -IO
dependencies: +wrong error messages when too many kwargs are received
nosy: +serhiy.storchaka
stage:  -> patch review
type: behavior -> enhancement

___
Python tracker 

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



[issue31230] Define a general "asynchronous operation introspection" protocol

2017-08-18 Thread Nick Coghlan

Nick Coghlan added the comment:

I agree https://bugs.python.org/issue31197 is orthogonal - refactoring the 
current logic is useful regardless of what we do at the object attribute layer.

Regarding __delegated_to__/__returns_to__, the reason I like *not* having 
"async" in the attribute names is that generators are actually used as a 
synchronous construct (via synchronous for loops and next() calls), even though 
they technically define an asynchronous operation from the interpreter's point 
of view.

The reason I like omitting "call" (or "calls") from the name is that even 
though "yield from" and "await" are both sometimes described as providing 
syntax for asynchronous calls, that terminology is really only defensible for 
"await" - PEP 380 describes the "yield from" operation as delegating to a 
subgenerator, and I think that's a better way of framing the general concept.

--

___
Python tracker 

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



[issue31206] IDLE, configdialog: Factor out HighPage class from ConfigDialog

2017-08-18 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +3189

___
Python tracker 

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



[issue31205] IDLE, configdialog: Factor out KeysPage class from ConfigDialog

2017-08-18 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +3190

___
Python tracker 

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



[issue31239] namedtuple comparison ignores types

2017-08-18 Thread Vlad Shcherbina

Vlad Shcherbina added the comment:

While we are at it, namedtuple inherits other operations that make no sense for 
fixed-length tuples:

>>> Rectangle(width=1, height=2) * 3
(1, 2, 1, 2, 1, 2)
>>> Rectangle(width=1, height=2) + Ellipse(x_axis=3, y_axis=4)
(1, 2, 3, 4)

But those are not so problematic because they are less likely to occur in 
practice.

--

___
Python tracker 

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



[issue31239] namedtuple comparison ignores types

2017-08-18 Thread Vlad Shcherbina

New submission from Vlad Shcherbina:

Toy example:

>>> from collections import namedtuple
>>> Rectangle = namedtuple('Rectangle', 'width height')
>>> Ellipse = namedtuple('Ellipse', 'x_axis y_axis')
>>> Rectangle(width=1, height=2) == Ellipse(x_axis=1, y_axis=2)
True

I understand this happens because namedtuple inherits comparisons and hash from 
the regular tuple.
However, this seems like confusing and dangerous behavior.
It is especially annoying to debug when these tuples are used as dict keys 
(repr() shows one thing and dict item access shows another).

Why would anyone mix named tuples of different types?
Here is a use case: typing.NamedTuple together with typing.Union would be a 
neat way to express algebraic data types.

Haskell's
data Shape = Rectangle Int Int | Ellipse Int Intderiving(Eq, Show)

would become
Shape = Union[Rectangle, Ellipse]

except that it does not work as expected because of the flawed comparisons.

--
components: Library (Lib)
messages: 300562
nosy: vlad
priority: normal
severity: normal
status: open
title: namedtuple comparison ignores types
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:


New changeset b50e7683acac36ff16e6c6c2c32d9a15e46b5174 by Victor Stinner in 
branch '3.6':
bpo-31234: test_threading: fix ref cycle (#3150) (#3152)
https://github.com/python/cpython/commit/b50e7683acac36ff16e6c6c2c32d9a15e46b5174


--

___
Python tracker 

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



[issue30983] eval frame rename in pep 0523 broke gdb's python extension

2017-08-18 Thread Łukasz Langa

Changes by Łukasz Langa :


--
pull_requests: +3187

___
Python tracker 

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



[issue30983] eval frame rename in pep 0523 broke gdb's python extension

2017-08-18 Thread Łukasz Langa

Changes by Łukasz Langa :


--
pull_requests: +3187, 3188

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3186

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 3d284c081fc3042036adfe1bf2ce92c34d743b0b by Victor Stinner in 
branch 'master':
bpo-31234: test_threading: fix ref cycle (#3150)
https://github.com/python/cpython/commit/3d284c081fc3042036adfe1bf2ce92c34d743b0b


--

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

test_logging: see bpo-30830.

--

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

test_pydoc: see bpo-31238.

--

___
Python tracker 

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



[issue31238] pydoc: ServerThread.stop() leaves a dangling thread

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

This issue is similar to bpo-31151: socketserver ForkingMixIn.server_close() 
leaks zombie processes.

--

___
Python tracker 

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



[issue31238] pydoc: ServerThread.stop() leaves a dangling thread

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3185

___
Python tracker 

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



[issue31238] pydoc: ServerThread.stop() leaves a dangling thread

2017-08-18 Thread STINNER Victor

New submission from STINNER Victor:

When using https://github.com/python/cpython/pull/3138 I see that test_pydoc 
leaves a dangling thread. The bug comes from test_server() which uses pydoc 
ServerThread.

ServerThread.stop() and test_pydoc don't join the thread. Moreover, 
ServerThread.docserver has a reference cycle through the DocServer.callback 
attribute.

Attached PR modifies ServerThread.stop() to join itself (the thread), to wait 
until the HTTP server completes, and then explicitly break the reference cycle.

With the PR, pydoc may hang if a bad HTTP client. So another option is to only 
modify test_pydoc to join() + break the ref cycle.

--
components: Library (Lib)
messages: 300556
nosy: haypo
priority: normal
severity: normal
status: open
title: pydoc: ServerThread.stop() leaves a dangling thread
type: resource usage
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



[issue31237] test_gdb disables 25% of tests in optimized builds

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

Sadly, python-gdb fails to get required data for some commands, so python-gdb 
doesn't work fully on optimized builds.

--

___
Python tracker 

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



[issue31237] test_gdb disables 25% of tests in optimized builds

2017-08-18 Thread Łukasz Langa

New submission from Łukasz Langa:

We are skipping a lot of tests when optimizations are enabled (which 
essentially means: compiled without `--with-pydebug`). This seems overly 
aggressive since most Python users are using the gdb bindings with a non-debug 
build.

I think we should have tests for py-bt, py-up, printing globals, etc. that run 
on a non-debug build.

--
components: Tests
messages: 300554
nosy: benjamin.peterson, haypo, lukasz.langa, pitrou
priority: normal
severity: normal
status: open
title: test_gdb disables 25% of tests in optimized builds
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

test_threading: https://github.com/python/cpython/pull/3150

--

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3184

___
Python tracker 

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



[issue30983] eval frame rename in pep 0523 broke gdb's python extension

2017-08-18 Thread Łukasz Langa

Łukasz Langa added the comment:

The issue originally stems from the fact that a non-debug Python build with 
--enable-shared is inlining PyEval_EvalFrameEx into _PyEval_EvalFrameDefault.

So, the patch should really become to *replace* discovering PyEval_EvalFrameEx 
with the discovery of _PyEval_EvalFrameDefault. This might be problematic in 
the future when there is an actual JIT but currently it's strictly better than 
the current situation where the gdb bindings simply don't work for shared 
builds.

--

___
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-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
title: test_socketserver: Warning -- reap_children() reaped child process -> 
socketserver.ForkingMixIn.server_close() leaks zombie processes

___
Python tracker 

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



[issue30391] test_threading_handled() and test_threading_not_handled() of test_socketserver hangs randomly on AMD64 FreeBSD 10.x Shared 3.6

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

I recently found two issues in socketserver:

* bpo-31233: socketserver.ThreadingMixIn leaks running threads after 
server_close()
* bpo-31151: socketserver.ForkingMixIn.server_close() leaks zombie processes

Fixing these two issues is likely to help to fix this one.

--

___
Python tracker 

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



[issue30849] test_stress_delivery_dependent() of test_signal randomly fails on AMD64 Debian root 3.6/3.x

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

test_stress_delivery_dependent() failed on AMD64 Debian root 3.x too, it's not 
specific to 3.6:

http://buildbot.python.org/all/builders/AMD64%20Debian%20root%203.x/builds/1192/steps/test/logs/stdio

http://buildbot.python.org/all/builders/AMD64%20Debian%20root%203.x/builds/1191/steps/test/logs/stdio

--

___
Python tracker 

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



[issue30849] test_stress_delivery_dependent() of test_signal randomly fails on AMD64 Debian root 3.6/3.x

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
title: test_stress_delivery_dependent() of test_signal randomly fails on AMD64 
Debian root 3.6 -> test_stress_delivery_dependent() of test_signal randomly 
fails on AMD64 Debian root 3.6/3.x

___
Python tracker 

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



[issue31235] test_logging: ResourceWarning: unclosed

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue31235] test_logging: ResourceWarning: unclosed

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 3e866dfaecaa4eb8f98c12782d2488f681225c37 by Victor Stinner in 
branch '3.6':
bpo-31235: Fix ResourceWarning in test_logging (#3147) (#3149)
https://github.com/python/cpython/commit/3e866dfaecaa4eb8f98c12782d2488f681225c37


--

___
Python tracker 

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



[issue30947] Update embeded copy of libexpat from 2.2.1 to 2.2.3

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:


New changeset ec4ab09b7c0b5070bdb27351f979cbecc4636245 by Victor Stinner in 
branch '2.7':
bpo-30947: Update libexpat from 2.2.1 to 2.2.3 (#3106) (#3145)
https://github.com/python/cpython/commit/ec4ab09b7c0b5070bdb27351f979cbecc4636245


--

___
Python tracker 

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



[issue30947] Update embeded copy of libexpat from 2.2.1 to 2.2.3

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 83e37e16f3065086d721d4e62a3788e01db3431c by Victor Stinner in 
branch '3.6':
bpo-30947: Update libexpat from 2.2.1 to 2.2.3 (#3106) (#3143)
https://github.com/python/cpython/commit/83e37e16f3065086d721d4e62a3788e01db3431c


--

___
Python tracker 

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



[issue31235] test_logging: ResourceWarning: unclosed

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

Python 2.7 is not affected: it doesn't have SMTPHandlerTest.

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



[issue31235] test_logging: ResourceWarning: unclosed

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3183

___
Python tracker 

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



[issue31206] IDLE, configdialog: Factor out HighPage class from ConfigDialog

2017-08-18 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I cannot do the backport at the moment, so at your convenience, please run 
cherry picker for PR3141 for 3.6.  You can submit the 2nd PR for 3.7 without 
waiting for me to merge the backport.

--

___
Python tracker 

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



[issue31206] IDLE, configdialog: Factor out HighPage class from ConfigDialog

2017-08-18 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset a32e40561a24de373d1c5a437a8aa329758ba8e4 by Terry Jan Reedy 
(Cheryl Sabella) in branch 'master':
bpo-31206: IDLE: Factor HighPage class from ConfigDialog (#3141)
https://github.com/python/cpython/commit/a32e40561a24de373d1c5a437a8aa329758ba8e4


--

___
Python tracker 

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



[issue31205] IDLE, configdialog: Factor out KeysPage class from ConfigDialog

2017-08-18 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset a32e40561a24de373d1c5a437a8aa329758ba8e4 by Terry Jan Reedy 
(Cheryl Sabella) in branch 'master':
bpo-31206: IDLE: Factor HighPage class from ConfigDialog (#3141)
https://github.com/python/cpython/commit/a32e40561a24de373d1c5a437a8aa329758ba8e4


--

___
Python tracker 

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



[issue31235] test_logging: ResourceWarning: unclosed

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:


New changeset a7719e27b3cad0f2b86cb932a76cbe55c541b02e by Victor Stinner in 
branch 'master':
bpo-31235: Fix ResourceWarning in test_logging (#3147)
https://github.com/python/cpython/commit/a7719e27b3cad0f2b86cb932a76cbe55c541b02e


--

___
Python tracker 

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



[issue5001] Remove assertion-based checking in multiprocessing

2017-08-18 Thread drallensmith

drallensmith added the comment:

Sorry! I was starting to wonder if the PR had been overlooked somehow...

--

___
Python tracker 

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



[issue31235] test_logging: ResourceWarning: unclosed

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3182

___
Python tracker 

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



[issue31235] test_logging: ResourceWarning: unclosed

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

Traceback from tracemalloc:

10-STABLE-amd64% ./python -X tracemalloc=10 -m test -v test_logging 
--fail-env-changed 

(...)

/usr/home/haypo/cpython/Lib/test/support/__init__.py:1515: ResourceWarning: 
unclosed 
  gc.collect()
Object allocated at (most recent call first):
  File "/usr/home/haypo/cpython/Lib/socket.py", lineno 210
sock = socket(self.family, type, self.proto, fileno=fd)
  File "/usr/home/haypo/cpython/Lib/asyncore.py", lineno 348
conn, addr = self.socket.accept()
  File "/usr/home/haypo/cpython/Lib/asyncore.py", lineno 492
pair = self.accept()
  File "/usr/home/haypo/cpython/Lib/asyncore.py", lineno 417
self.handle_accept()
  File "/usr/home/haypo/cpython/Lib/asyncore.py", lineno 83
obj.handle_read_event()
  File "/usr/home/haypo/cpython/Lib/asyncore.py", lineno 150
read(obj)
  File "/usr/home/haypo/cpython/Lib/asyncore.py", lineno 203
poll_fun(timeout, map)
  File "/usr/home/haypo/cpython/Lib/test/test_logging.py", lineno 782
asyncore.loop(poll_interval, map=self._map)
  File "/usr/home/haypo/cpython/Lib/threading.py", lineno 865
self._target(*self._args, **self._kwargs)
  File "/usr/home/haypo/cpython/Lib/threading.py", lineno 917
self.run()

So it seems like the socket was created in TestSMTPServer.serve_forever() of 
test_logging, which is used by SMTPHandlerTest.test_basic().

--

___
Python tracker 

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



[issue31236] improve some error messages of min() and max()

2017-08-18 Thread Oren Milman

Changes by Oren Milman :


--
pull_requests: +3181

___
Python tracker 

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



[issue30947] Update embeded copy of libexpat from 2.2.1 to 2.2.3

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3180

___
Python tracker 

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



[issue30947] Update embeded copy of libexpat from 2.2.1 to 2.2.3

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3179

___
Python tracker 

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



[issue31236] improve some error messages of min() and max()

2017-08-18 Thread Oren Milman

New submission from Oren Milman:

currently, we have the following:
>>> min(0, a=1)
TypeError: 'a' is an invalid keyword argument for this function
>>> max(0, a=1)
TypeError: 'a' is an invalid keyword argument for this function
>>> max(0, a=1, b=2, c=3)
TypeError: function takes at most 2 arguments (3 given)
>>> min(0, a=1, b=2, c=3)
TypeError: function takes at most 2 arguments (3 given)

ISTM it would be preferable for min() and max() to have error messages similar
to those of int():
>>> int(0, a=1)
TypeError: 'a' is an invalid keyword argument for int()
>>> int(0, a=1, b=2)
TypeError: int() takes at most 2 arguments (3 given)

we can achieve this by making a small change in Python/bltinmodule.c in
min_max (I would open a PR soon), and by resolving #31229.

--
components: IO
messages: 300539
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: improve some error messages of min() and max()
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



[issue30947] Update embeded copy of libexpat from 2.2.1 to 2.2.3

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3178

___
Python tracker 

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



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

> New changeset 6966960468327c958b03391f71f24986bd697307 by Victor Stinner in 
> branch 'master':
> bpo-30830: test_logging uses threading_setup/cleanup (#3137)

With this commit, test_logging should detect better bugs in the code.

The commit also skips all tests using socketserver, until bpo-31233 is fixed, 
just to reduce the failure rate on the FreeBSD buildbots.

This issue (bpo-30830) made FreeBSD 10 buildbot very unstable.

--

___
Python tracker 

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



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 6966960468327c958b03391f71f24986bd697307 by Victor Stinner in 
branch 'master':
bpo-30830: test_logging uses threading_setup/cleanup (#3137)
https://github.com/python/cpython/commit/6966960468327c958b03391f71f24986bd697307


--

___
Python tracker 

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



[issue31233] socketserver.ThreadingMixIn leaks running threads after server_close()

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 6966960468327c958b03391f71f24986bd697307 by Victor Stinner in 
branch 'master':
bpo-30830: test_logging uses threading_setup/cleanup (#3137)
https://github.com/python/cpython/commit/6966960468327c958b03391f71f24986bd697307


--

___
Python tracker 

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



[issue30947] Update embeded copy of libexpat from 2.2.1 to 2.2.3

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 93d0cb58b4da2a88c56f472c6c19491cc7a390df by Victor Stinner in 
branch 'master':
bpo-30947: Update libexpat from 2.2.1 to 2.2.3 (#3106)
https://github.com/python/cpython/commit/93d0cb58b4da2a88c56f472c6c19491cc7a390df


--

___
Python tracker 

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



[issue31235] test_logging: ResourceWarning: unclosed

2017-08-18 Thread STINNER Victor

New submission from STINNER Victor:

Sometimes, running test_logging emits such warning:

ResourceWarning: unclosed 

I'm not sure where it does come from.

See also bpo-30830 (test_logging leaks dangling threads on FreeBSD).

--
messages: 300534
nosy: haypo
priority: normal
severity: normal
status: open
title: test_logging: ResourceWarning: unclosed 
type: resource usage
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



[issue31233] socketserver.ThreadingMixIn leaks running threads after server_close()

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

Oh, test_socketserver just failed with ENV_CHANGED on AMD64 Windows7 SP1 3.x:

http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/865/steps/test/logs/stdio

test_TCPServer (test.test_socketserver.SocketServerTest) ... creating server
(...)
waiting for server
done

Warning -- threading_cleanup() failed to cleanup -1 threads after 5 sec (count: 
0, dangling: 1)

--

___
Python tracker 

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



[issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks

2017-08-18 Thread Guido van Rossum

Guido van Rossum added the comment:

Given the date from that comment I assume that I told Raymond this during the 
2016 core sprint. I can't recall that conversation but I am still pretty 
worried about using an RLock. (What if someone slightly more insane decides to 
call get() from inside a GC callback or signal handler?)

However I do think we have to do something here. It's also helpful that all 
mutable state except for unfinished_tasks is just a deque or list, and the 
_get()/_put() operations for these are atomic. (I betcha heappop() is too when 
implemented in C, but not when implemented in Python.)

I can't say I understand all of Antoine's patch, but it's probably okay to do 
it this way; however I would rather see if we can add _is_owned() to Lock, 
assuming it can be implemented using any of the threading/locking libraries we 
still support (I presume that's basically posix and Windows).

IIUC the end result would be a Queue whose put() works from signal handlers, GC 
callbacks and __del__, as long as it's unbounded, right? And when it *is* 
bounded, it will give a decent message if the queue is full and the lock is 
already taken, right? Antoine, can you confirm?

--

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:


New changeset c99d41f9c0304fcf06550515c3db55f93a629e9e by Victor Stinner in 
branch 'master':
bpo-31234: fork_wait tests now join threads (#3139)
https://github.com/python/cpython/commit/c99d41f9c0304fcf06550515c3db55f93a629e9e


--

___
Python tracker 

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



[issue28777] Add asyncio.Queue __aiter__, __anext__ methods

2017-08-18 Thread Guido van Rossum

Guido van Rossum added the comment:

Let's not do this.

--
resolution:  -> rejected
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



[issue30983] eval frame rename in pep 0523 broke gdb's python extension

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

> You have to rebuild python for /Tools/gdb/libpython.py to land in
/python-gdb.py. The latter is used during test_gdb.py.

Ah yes, sorry, that's not obvious. "make" does the copy for you.

--

___
Python tracker 

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



[issue30983] eval frame rename in pep 0523 broke gdb's python extension

2017-08-18 Thread Łukasz Langa

Łukasz Langa added the comment:

OK, I got the repro. You have to rebuild python for /Tools/gdb/libpython.py to 
land in /python-gdb.py. The latter is used during test_gdb.py.

--

___
Python tracker 

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



[issue30923] Add -Wimplicit-fallthrough=0 to Makefile ?

2017-08-18 Thread Stefan Krah

Stefan Krah added the comment:


New changeset d73a960c575207539c3f9765cff26d4fff400b45 by Stefan Krah in branch 
'master':
bpo-30923: Disable warning that has been part of -Wextra since gcc-7.0. (#3142)
https://github.com/python/cpython/commit/d73a960c575207539c3f9765cff26d4fff400b45


--

___
Python tracker 

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



[issue30923] Add -Wimplicit-fallthrough=0 to Makefile ?

2017-08-18 Thread Stefan Krah

Changes by Stefan Krah :


--
pull_requests: +3177

___
Python tracker 

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



[issue30923] Add -Wimplicit-fallthrough=0 to Makefile ?

2017-08-18 Thread Stefan Krah

Stefan Krah added the comment:

So I installed gcc-7.2.0 from source. Hilariously compiling gcc *itself*
emits fallthrough warnings!

Then I tried to be a good open source drone and add 20 /* fall through */
comments to libmpdec.

gcc is too stupid to recognize the /* fall through */ at the #endif
position.


Perhaps the author of this gcc warning wants to submit a patch.

--

___
Python tracker 

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



[issue31232] Backport the new custom "print >> sys.stderr" error message?

2017-08-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It will not break this code. The only visible effect is changing error messages 
of some TypeError exceptions.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31109] zipimport argument clinic conversion

2017-08-18 Thread Brett Cannon

Brett Cannon added the comment:


New changeset 02f3b7d5ab2206d256879e5a8a34f560218ed397 by Brett Cannon (Yaron 
de Leeuw) in branch 'master':
bpo-31109: Convert zipimport to use Argument Clinic (GH-2990)
https://github.com/python/cpython/commit/02f3b7d5ab2206d256879e5a8a34f560218ed397


--
nosy: +brett.cannon

___
Python tracker 

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



[issue31232] Backport the new custom "print >> sys.stderr" error message?

2017-08-18 Thread Raymond Hettinger

Raymond Hettinger added the comment:

But this backport would break my code:

>>> print = 10
>>> print >> 1
5

Just kidding ;-)

+1 for the backport.  It will likely save some headaches.

--
nosy: +rhettinger

___
Python tracker 

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



[issue31206] IDLE, configdialog: Factor out HighPage class from ConfigDialog

2017-08-18 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +3176

___
Python tracker 

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



[issue31232] Backport the new custom "print >> sys.stderr" error message?

2017-08-18 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

It's probably fine, since it should be a rare occurrence, but it of course has 
the potential to break things like tests (doc and otherwise).  Unlikely, but it 
should be pointed out.  Still, I'm also fine with backporting it.

--
nosy: +barry

___
Python tracker 

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



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

I opened bpo-31233: socketserver.ThreadingMixIn leaks running threads after 
server_close().

--
dependencies: +socketserver.ThreadingMixIn leaks running threads after 
server_close()

___
Python tracker 

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



[issue9566] Compilation warnings under x64 Windows

2017-08-18 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests: +3174

___
Python tracker 

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



[issue30747] _Py_atomic_* not actually atomic on Windows with MSVC

2017-08-18 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests: +3175

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

test_fork1, test_wait3: https://github.com/python/cpython/pull/3139

--

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3173

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3172

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-08-18 Thread STINNER Victor

New submission from STINNER Victor:

Currently, support.threading_cleanup() waits 1 second before emitting a warning 
about threads running in the background. I propose to emit immediately the 
warning to be able to catch bugs quicker, bugs like bpo-31233 or bpo-30830.

The problem is that currently, 12 test files still leak threads:
---
12 tests altered the execution environment:
test_asyncio test_concurrent_futures test_fork1 test_httpservers
test_logging test_pydoc test_ssl test_thread test_threaded_import
test_threading test_wait3 test_xmlrpc
---

Since threading_cleanup() warnings now mark tests as failed, we should first 
fix these tests before being able to make support.threading_cleanup() stricter.

--
components: Tests
messages: 300519
nosy: haypo
priority: normal
severity: normal
status: open
title: Make support.threading_cleanup() stricter
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



[issue31233] socketserver.ThreadingMixIn leaks running threads after server_close()

2017-08-18 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The difference is that letting a thread run doesn't create a zombie thread, so 
I don't think the issue is really similar.

--
nosy: +pitrou

___
Python tracker 

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



[issue31230] Define a general "asynchronous operation introspection" protocol

2017-08-18 Thread syncosmic

syncosmic added the comment:

I like where this is heading! Aside from the cleaner patterns for handling 
these objects, I think it'll make it a little easier for people who are just 
starting to use asynchronous objects in Python (e.g. me) to grasp what's 
similar about them.

+1 that `__async_call__` could be confusing, for the general reason you 
mention, but in particular because it would look exactly analogous to 
`function.__call__()` (what the French call a "faux ami").

A not-thought-out alternative: what about noun-ing the verbs into 
`__async_calls__` and `__async_returns__` (or maybe `__async_returns_to__`)?

BTW, I was thinking of taking a quick run at bpo-31197 while this simmers. I 
don't /think/ that risks being eventually mooted by these changes; if anything, 
it might be easier to adapt `dis` to this proposal if that refactoring has 
already been done. LMK if you think that's the wrong order, though.

--

___
Python tracker 

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



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3171

___
Python tracker 

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



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

> Example:
>
> 10-STABLE-amd64% ./python -m test -v test_logging --fail-env-changed -F -m 
> test.test_logging.DatagramHandlerTest.test_output -m 
> test.test_logging.ConfigDictTest.test_listen_config_10_ok  
> --match=test.test_logging.SocketHandlerTest.test_output

Oh, I forgot to mention that I also run "./python -m test -j4" in a different 
terminal in parallel to make the bug more likely.

--

___
Python tracker 

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



[issue31211] distutils/util.py get_platform() does not identify linux-i686 platforms

2017-08-18 Thread Éric Araujo

Éric Araujo added the comment:

> both wheel/pip makes calls to distutils.util.get_platform(). Fixing it in one 
> location
> would fix it across the board.

True, but it may have unintended effects in other places that disrupt or break 
parts of the CPython build process, or downstream packaging toolchains.

> using just distutils.core.setup() and doing a bdist (built-in command 
> available in
> distutils) is still generating a wrong tag in linux 32-bit arch.

I would say that this is irrelevant, since these kinds of bdist are not well 
defined and not really used.

> within distutils.util.get_platform() the code under sunos makes attempts to 
> identify the > correct bitness: [...]
> why would the linux logic not handle the same problem?

That’s always the question with distutils, and the reason for us being 
over-cautious with these requests for changes.  One needs to do VCS archaeology 
to understand if a specific line was a conscious decision, an assumption, an 
oversight or a mistake.  My suggestion of bringing this to setuptools is 
because they have a much faster release cycle, and broad testing.  They can 
change only the wheel compatibility tags and get feedback immediately, whereas 
changing distutils.util.get_plaform may break many things and we’ll only know 
in a couple years when the next release is packaged by distributions and 
third-party vendors.

[removing Raymond from nosy and adding Jason the setuptools maintainer]

--
nosy: +jason.coombs -rhettinger

___
Python tracker 

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



[issue31233] socketserver.ThreadingMixIn leaks running threads after server_close()

2017-08-18 Thread STINNER Victor

New submission from STINNER Victor:

test_logging has a race condition: sometimes, it leaks dangling threads on 
FreeBSD: bpo-30830.

I identified the root issue: socketserver.ThreadingMixIn spawns threads without 
waiting for their completion in server_close(). This issue is very similar to 
socketserver.ForkingMixIn which leaks child processes and so create zombie 
processes. See bpo-31151.

--
components: Library (Lib)
messages: 300514
nosy: haypo
priority: normal
severity: normal
status: open
title: socketserver.ThreadingMixIn leaks running threads after server_close()
type: resource usage
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



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

The problem is that socketserver.ThreadingMixIn spawns threads without waiting 
for their completion in server_close(). For example, the following two tests 
use socketserver.ThreadingMixIn and so can leak a running thread:

* test.test_logging.SocketHandlerTest.test_output()
* test.test_logging.DatagramHandlerTest.test_output()

Example:

10-STABLE-amd64% ./python -m test -v test_logging --fail-env-changed -F -m 
test.test_logging.DatagramHandlerTest.test_output -m 
test.test_logging.ConfigDictTest.test_listen_config_10_ok  
--match=test.test_logging.SocketHandlerTest.test_output

(...)

0:00:09 load avg: 2.54 [  7] test_logging
test_output (test.test_logging.SocketHandlerTest) ... ok
test_output (test.test_logging.DatagramHandlerTest) ... ok
test_listen_config_10_ok (test.test_logging.ConfigDictTest) ... threading_setup 
(1, <_weakrefset.WeakSet object at 0x806243398>)

--

___
Python tracker 

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



[issue18156] Add an 'attr' attribute to AttributeError

2017-08-18 Thread Brett Cannon

Changes by Brett Cannon :


--
keywords:  -easy

___
Python tracker 

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



[issue5001] Remove assertion-based checking in multiprocessing

2017-08-18 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Please allow us a bit of time :-)  We are all volunteers here.

--

___
Python tracker 

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



[issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks

2017-08-18 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 18/08/2017 à 17:37, Yury Selivanov a écrit :
> 
> Is it guaranteed that the GC will happen in the same thread that is holding 
> the lock?

By design, if it's called from a different thread, Queue will cope fine:
__del__ implicitly calls RLock.acquire which, if the RLock is already
taken, releases the GIL and waits until the RLock is released by the
other thread.

The contentious case is when a Queue method call is interrupted by some
asychronous event (signal handler, GC callback) that calls another Queue
method in the same thread.

Note, in my patch, the RLock isn't even used for its recursive
properties, but only because it allows to query if it's already taken by
the current thread (using a private method that's already used by
threading.Condition, and which could reasonably be made public IMHO).

(on that topic, the pure Python implementation of RLock doesn't
guarantee proper reentrancy against asynchronous events itself -- see
https://bugs.python.org/issue13697 --, but fortunately we use a C
implementation by default which is pretty much ok)

--

___
Python tracker 

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



[issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks

2017-08-18 Thread Yury Selivanov

Yury Selivanov added the comment:

> Here is a pure Python PoC patch that allows unbounded Queue and LifoQueue to 
> have reentrant put().

Is it guaranteed that the GC will happen in the same thread that is holding the 
lock?  IOW will RLock help with all GC/__del__ deadlocking scenarios?

--

___
Python tracker 

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



[issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks

2017-08-18 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Also, to elaborate a bit, I don't think we should aim to make Queue fully 
reentrant, as that would be extremely involved.  I think we can settle on the 
simpler goal of making put() reentrant for unbounded LIFO and FIFO queues, 
which is what most people care about (and which is incidentally what the posted 
patch claims to do).

--

___
Python tracker 

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



[issue31231] Travis CI mac test broken: ./python: is a directory

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

Thanks Han Lee for the bug report, the issue should now be fixed.

--

___
Python tracker 

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



[issue31231] Travis CI mac test broken: ./python: is a directory

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
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



[issue31231] Travis CI mac test broken: ./python: is a directory

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 92b1f90143286385c0ff5be98d3721b90580a912 by Victor Stinner in 
branch 'master':
bpo-31231: Fix pythoninfo in Travis config (#3134)
https://github.com/python/cpython/commit/92b1f90143286385c0ff5be98d3721b90580a912


--

___
Python tracker 

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



[issue30871] Add test.pythoninfo

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 92b1f90143286385c0ff5be98d3721b90580a912 by Victor Stinner in 
branch 'master':
bpo-31231: Fix pythoninfo in Travis config (#3134)
https://github.com/python/cpython/commit/92b1f90143286385c0ff5be98d3721b90580a912


--

___
Python tracker 

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



[issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks

2017-08-18 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Guido, apparently you are opposed to the Queue implementation using a RLock 
instead of a Lock, according to Raymond in 
https://bugs.python.org/issue14976#msg275377.  I find this a bit surprising, so 
could you confirm it yourself?

--
nosy: +gvanrossum

___
Python tracker 

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



[issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks

2017-08-18 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I'll believe it when Guido chimes in and actually says so himself.  Otherwise, 
I am skeptical Guido cares a lot about whether the internal implementation of 
Queue uses a Lock, a RLock or whatever else.

--

___
Python tracker 

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



[issue30830] test_logging leaks dangling threads on FreeBSD

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3170

___
Python tracker 

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



[issue31231] Travis CI mac test broken: ./python: is a directory

2017-08-18 Thread R. David Murray

R. David Murray added the comment:

Ah, this is probably the issue: https://github.com/python/cpython/pull/3134

--

___
Python tracker 

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



[issue31231] Travis CI mac test broken: ./python: is a directory

2017-08-18 Thread R. David Murray

R. David Murray added the comment:

Heh.  I saw the PR but didn't realize it was attached to this issue :)

--

___
Python tracker 

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



[issue31231] Travis CI mac test broken: ./python: is a directory

2017-08-18 Thread STINNER Victor

STINNER Victor added the comment:

The error comes from "./python -m test.pythoninfo": see bpo-30871.

Attached PR should fix this bug.

--
nosy: +haypo

___
Python tracker 

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



[issue30871] Add test.pythoninfo

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3169

___
Python tracker 

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



[issue31231] Travis CI mac test broken: ./python: is a directory

2017-08-18 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3168

___
Python tracker 

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



[issue31231] Travis CI mac test broken: ./python: is a directory

2017-08-18 Thread R. David Murray

R. David Murray added the comment:

The docs you point to are correct (they mention python.exe).  The Travis log 
also shows it using python.exe.  So the error message about the directory must 
be about some other operation than just running the python command.

--
components: +macOS
nosy: +ned.deily, r.david.murray, ronaldoussoren

___
Python tracker 

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



[issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks

2017-08-18 Thread mike bayer

mike bayer added the comment:

> Here is a pure Python PoC patch that allows unbounded Queue and LifoQueue to 
> have reentrant put().

per http://bugs.python.org/msg275377 guido does not want an RLock here.

--

___
Python tracker 

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



[issue31232] Backport the new custom "print >> sys.stderr" error message?

2017-08-18 Thread Ned Deily

Ned Deily added the comment:

I am OK with adding it to 3.6.x.

--

___
Python tracker 

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



  1   2   >