[issue25654] test_multiprocessing_spawn ResourceWarning with -Werror

2015-11-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is an alternative patch that uses closefd=False.

--
Added file: http://bugs.python.org/file41075/multiprocessing_no_close_fd.patch

___
Python tracker 

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



[issue25654] test_multiprocessing_spawn ResourceWarning with -Werror

2015-11-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Good point!

The question is whether we want to see resource warnings when override standard 
streams with open files (usually without closefd=False)?

--

___
Python tracker 

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



[issue25626] Gzip fails for file over 2**32 bytes

2015-11-19 Thread Martin Panter

Martin Panter added the comment:

Okay. For the gzip module, I cannot easily test this myself. Quickly looking at 
other cases, I guess it would look something like this, but I need to spend 
some time understanging the bigmemtest decorator properly:

@unittest.skipIf(sys.maxsize < _4G, "Requires non-32-bit system")
@test.support.bigmemtest(_4G, 1, dry_run=False)
def test_large_read(self, size):
...
data = reader.read(size)  # Should not raise OverflowError
self.assertEqual(data, b"data")

--

___
Python tracker 

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



[issue25654] test_multiprocessing_spawn ResourceWarning with -Werror

2015-11-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

You can commit your patch right now (it shouldn't make things worse), and 
continue to work on additional tests.

--

___
Python tracker 

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



[issue25626] Gzip fails for file over 2**32 bytes

2015-11-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you please add tests for other two functions? And tests for the gzip 
module?

--

___
Python tracker 

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



[issue25663] Make rlcompleter avoid duplicate global names

2015-11-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Nice work.

An alternative approach is to make "matches" a dict. And instead of

if match not in seen:
seen.add(word)
matches.append(match)

use just

matches[word] = match

I don't know what approach is better.

Added other minor comments on Rietveld.

--

___
Python tracker 

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



[issue25665] typing.NamedTuple instances are not picklable.

2015-11-19 Thread Ashwini Chaudhary

New submission from Ashwini Chaudhary:

Currently 
namedtuple(https://hg.python.org/cpython/file/3.5/Lib/collections/__init__.py#l418)
 sets the `__module__` attribute by looking up `__name__` in calling frame's 
globals. As in the case of `typing.NamedTuple` it is always going to be 
'typing' pickle will raise an error.

Instead of this `typing.NamedTuple` should override the `__module__` attribute 
itself because it has info about the actual caller frame.

Something like this should work fine:

```
def NamedTuple(typename, fields):

fields = [(n, t) for n, t in fields]
cls = collections.namedtuple(typename, [n for n, t in fields])
cls._field_types = dict(fields)
try:
cls.__module__ = sys._getframe(1).f_globals.get('__name__', '__main__')
except (AttributeError, ValueError):
pass
return cls
```

Related: http://stackoverflow.com/q/33796490/846892

--
components: Library (Lib)
messages: 254883
nosy: montysinngh
priority: normal
severity: normal
status: open
title: typing.NamedTuple instances are not picklable.
versions: Python 3.5

___
Python tracker 

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



[issue25665] typing.NamedTuple instances are not picklable.

2015-11-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +gvanrossum, rhettinger

___
Python tracker 

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



[issue12346] Python source code build fails with old mercurial

2015-11-19 Thread Luke Erlacher

Luke Erlacher added the comment:

This is not fixed in 2.7.10.

--
nosy: +Luke Erlacher

___
Python tracker 

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



[issue25666] Python unexpectedly ignores a signal after fork

2015-11-19 Thread jon orebro

New submission from jon orebro:

Description:
I found a slight problem with signal handling. It seems that if you have a 
signal handler setup for a signal, right after a fork the child ignores that 
signal for a short time. This is regardless of what the signal handler is setup 
to do. This can cause hangs if the parent immediately kills and then waits for 
the child. Since the timeframe is small, in practice this only happens 
sometimes (se example). There might be a reason for this behavour, but in that 
case I think it should me mentioned in the docs.

What I expected:
I expected the child to, at any point in time, either do the default action for 
the signal (terminate in this case), or to run the signal handler.

What happens:
It ignores the signal for a short while.

Tested versions:
Python 2.7.6
Python 3.4.0

--
assignee: docs@python
components: Documentation, Interpreter Core
files: example.py
messages: 254890
nosy: docs@python, jon orebro
priority: normal
severity: normal
status: open
title: Python unexpectedly ignores a signal after fork
type: behavior
versions: Python 2.7, Python 3.4
Added file: http://bugs.python.org/file41074/example.py

___
Python tracker 

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



[issue25665] typing.NamedTuple instances are not picklable.

2015-11-19 Thread Ashwini Chaudhary

Ashwini Chaudhary added the comment:

Attached patch.

--
keywords: +patch
Added file: http://bugs.python.org/file41073/issue25665.patch

___
Python tracker 

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



[issue20438] inspect: Deprecate getfullargspec?

2015-11-19 Thread Vedran Čačić

Vedran Čačić added the comment:

> Also, it is worth noting, that Signature API does not provide 100%
of functionality that deprecated APIs have.  It is important to do
a soft deprecation of outdated APIs in 3.5 to gather users feedback,
and improve Signature object.

Well, here is a feedback about lost functionality. inspect.getcallargs had a 
very nice property that it automatically bound the first argument to the 
instance of bound methods. It seems I have no general way to do it with 
Signature.bind. Of course I can put

arguments['self'] = method.__self__

afterwards, but theoretically, the argument doesn't have to be called 'self'. 
And anyway, I would like something that works seamlessly with bound methods and 
ordinary functions.

--
nosy: +Vedran.Čačić

___
Python tracker 

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



[issue25626] Gzip fails for file over 2**32 bytes

2015-11-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

You can commit your patch right now (it shouldn't make things worse) and add 
new tests later.

--

___
Python tracker 

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



[issue25634] Add a dedicated subclass for attribute missing errors

2015-11-19 Thread Jun Wang

Jun Wang added the comment:

I think this is a common problem while using both __getattr__ and 
descriptor/property. A descriptor example:

class Descriptor(): 
def __get__(self, instance, owner=None): 
raise AttributeError('Implicitly suppressed')

class A(): 
d = Descriptor()
def __getattr__(self, name): 
return 'default'

print(A().d)


Without descriptor, unexpected AttributeError could only come from overriding 
__getattribute__, which is a rare case, although still an imperfection. But in 
descriptor/property, AttributeError which is too general just occurs frequently 
like in normal method. 

Surely any modification would break the backward compatibility, although I 
wonder how often it is used of raising AttributeError purposely, maybe in 
__getattribute__, to call __getattr__, instead of explicitly calling 
__getattr__. In my understanding this is the only case that will be affected.


"An unexpected exception should not result in subtly altered behaviour, but 
should cause a noisy and easily-debugged traceback. "—from PEP479

About the implementation, maybe something like "RuntimeError: descriptor raised 
AttributeError" simulating PEP479. Or in my lay opinion, the best solution is: 
add object.__getattr__, with the only behavior of raising AttributeError; when 
normal attribute lookup fails, object.__getattribute__ calls __getattr__ 
explicitly; __getattr__ not triggered by AttributeError anymore.

I know little about the CPython implementation, so I might be completely wrong. 
However this seems deserving more detailed discussion.

--

___
Python tracker 

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



[issue25634] Add a dedicated subclass for attribute missing errors

2015-11-19 Thread R. David Murray

R. David Murray added the comment:

The more detailed discussion should happen on python-ideas.  I'm going to close 
this for now, but if there's a consensus there about what action to take this 
issue could be reopened.  (Or a new one created, whatever makes the most sense 
at that time.)

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



[issue25654] test_multiprocessing_spawn ResourceWarning with -Werror

2015-11-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, I forgot about issue21779. And there was at least yet one duplicate 
issue23827. Thanks for the reminder Davin.

The patch in issue21779 fixes only symptoms, makes failed test more lenient. I 
prefer to got rid of resource warnings at all.

--
nosy: +sbt

___
Python tracker 

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



[issue25673] unittest assertLessEqual not working properly with lists

2015-11-19 Thread kehlert

New submission from kehlert:

I attached a file that explains the issue. Basically, assertLessEqual only 
seems to compare the first elements of the two lists and ignores the others. 
Thus a test can pass when it shouldn't.

--
files: example.py
messages: 254920
nosy: kehlert
priority: normal
severity: normal
status: open
title: unittest assertLessEqual not working properly with lists
versions: Python 3.4
Added file: http://bugs.python.org/file41081/example.py

___
Python tracker 

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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-19 Thread Guido van Rossum

Guido van Rossum added the comment:

No, I mentioned the idea of a warning in the thread on the
python-tulip mailing list, but decided not to do it after all.

--

___
Python tracker 

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



[issue25672] set SSL_MODE_RELEASE_BUFFERS

2015-11-19 Thread Cory Benfield

Cory Benfield added the comment:

Ok, I've just uploaded an initial draft of the patch for review.

--
keywords: +patch
Added file: http://bugs.python.org/file41083/ssl.patch

___
Python tracker 

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



[issue21779] test_multiprocessing_spawn fails when ran with -Werror

2015-11-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch cures only the symptom, the failure of one rigid test. A warning 
still is emitted in applications that use multiprocessing.

Closed in favor of duplicate issue25654 with patches that are intended to fix 
the cause of warnings. In any case thank you for your contribution Davin.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> test_multiprocessing_spawn ResourceWarning with -Werror

___
Python tracker 

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



[issue25673] unittest assertLessEqual not working properly with lists

2015-11-19 Thread Ezio Melotti

Ezio Melotti added the comment:

This is how comparison works for sequences and it's not a bug:

>>> a = [1, 2]
>>> b = [2, 1]
>>> a <= b
True
>>> a = [2, 1]
>>> b = [1, 2]
>>> a <= b
False

See 
https://docs.python.org/3/tutorial/datastructures.html#comparing-sequences-and-other-types

--
nosy: +ezio.melotti
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-19 Thread Justin Mayfield

Justin Mayfield added the comment:

I should have commented more on the run_once removal.  The depiction given in 
its docstring seemed inconsistent with the new way stop works and I found no 
callers, so it seemed like it was best left out to avoid confusion.  No worries 
though, I didn't get to know that test module very well before messing with it. 
 It just came up in my scan for stop() callers.

Looks good, I've applied to a 3.5.0 build and will include it in my testing 
from now on.

Thanks Guido.

--

___
Python tracker 

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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-19 Thread Justin Mayfield

Justin Mayfield added the comment:

Ha, email race.

Regarding rev 2, the updated docstring and scheduled stop looks good along with 
alleviating the confusion I mentioned.

I'm not sure about your warning comment;  Perhaps that's a patch I didn't lay 
eyes on.

Cheers.

--

___
Python tracker 

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



[issue25672] Unconditionally set SSL_MODE_RELEASE_BUFFERS

2015-11-19 Thread Cory Benfield

New submission from Cory Benfield:

Originally raised by Ben Bangert on the python-dev mailing list.

It turns out that OpenSSL has a mode setting, SSL_MODE_RELEASE_BUFFERS, that 
can be set by a call to SSK_CTX_set_mode. This mode can potentially reduce 
connection overhead by nearly 18kB *per connection*, a reduction of something 
like 60%. Further, this does not change the behaviour of OpenSSL in any 
meaningful way.

For this reason, we should unconditionally set this mode on all SSL Context 
objects we create.

I'm happy to submit a patch to the standard library that will do this.

--
components: Library (Lib)
messages: 254918
nosy: Lukasa
priority: normal
severity: normal
status: open
title: Unconditionally set SSL_MODE_RELEASE_BUFFERS
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



[issue25533] Make pkgutil.iter_modules() yield built-in modules

2015-11-19 Thread Brett Cannon

Brett Cannon added the comment:

I say let it go and make sure the docs clearly document that only modules found 
off of sys.path are supported. Otherwise I would look at why walk_packages() 
and pydoc feel the need to import every module and if import simply needs to be 
tweaked to support this use case better (if at all).

--

___
Python tracker 

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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-19 Thread Guido van Rossum

Guido van Rossum added the comment:

OK, here's another revision of the patch, setting the timeout passed to the 
selector to 0 when the loop is pre-stopped.

--
Added file: http://bugs.python.org/file41084/issue25593_revised_3.patch

___
Python tracker 

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



[issue25660] tabs don't work correctly in python repl

2015-11-19 Thread Yury Selivanov

Yury Selivanov added the comment:

Attached is a patch that uses different logic for tabulation.  Instead of 
returning '\t' from the completion callback, it instead calls explicit readline 
API: "readline.insert_text('\t'); readline.redisplay()"

Please review.

--
keywords: +patch
Added file: http://bugs.python.org/file41085/rlcompleter.patch

___
Python tracker 

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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-19 Thread Guido van Rossum

Guido van Rossum added the comment:

OK, another revision, keep the mock selector.

--
Added file: http://bugs.python.org/file41086/issue25593_revised_4.patch

___
Python tracker 

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



[issue23788] test_urllib2_localnet.test_bad_address fails: OSError not raised by urlopen

2015-11-19 Thread Steve Harris

Steve Harris added the comment:

I experienced the same problem on my system:

OS: Xubuntu/Linux 12.04
$ uname -a
Linux ives 3.2.0-94-generic #134-Ubuntu SMP Fri Nov 6 18:17:08 UTC 2015 i686 
i686 i386 GNU/Linux
$ gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

=

In response to your last request, here's what I get:

$ ./python 
Python 3.5.0 (default, Nov 19 2015, 17:12:32) 
[GCC 4.6.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.create_connection(("sadflkjsasf.i.nvali.d.", 80))

>>> 

=

And:

$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
search domain.actdsltmp

=

My ISP is Verizon.

Hope this is help

--
nosy: +Steve Harris

___
Python tracker 

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



[issue9504] signal.signal/signal.alarm not working as expected

2015-11-19 Thread Martin Panter

Martin Panter added the comment:

With Python’s current technique for signal handling, I think there is always 
going to be a window where a signal can arrive at the low level after checking 
the Python flag and before starting a blocking call. If you need to robustly 
handle a signal maybe it is better to use set_signal_fd() and select() or 
something.

I haven’t looked at the patch closely, but it sounds like it could reduce the 
size of the window. This would make interactive signals like SIGINT more 
reliable, so it may be worthwhile. It probably needs properly reviewing in 
light of the recent EINTR (PEP 457) changes though.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25666] Python unexpectedly ignores a signal after fork

2015-11-19 Thread Martin Panter

Martin Panter added the comment:

Here is a modified version of the script that is not a slow fork bomb. In the 
original, if time.sleep(600) fails to be interrupted, the children end up 
continuing the loop and forking more children.

I tried Python 3.5, 2.7 and 3.4. I am seeing the signal completely ignored (at 
the Python level), not just ignored “for a short while”. Here is a sample 
output:

$ python3 example.py
Python handler called
Parent waiting for child
Got exit status 0x
===
Parent waiting for child
Child: 0
Child: 1
Child: 2
Child: 3
Child: 4
Child: 5
Got exit status 0x0100

David may be right that it is an OS thing, though it does not seem likely IMO. 
It needs more investigation or expert knowledge.

But I would like to point out that even if the bug of the signal being 
completely ignored is fixed, the code still has a race condition. The signal 
could arrive in the window between when Python checks for signals and when it 
calls sleep(). Then the signal will be ignored until sleep() has returned. If 
you need this code to be robust, I suggest looking at set_signal_fd() and 
select().

--
nosy: +martin.panter
versions: +Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41089/example.py

___
Python tracker 

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



[issue9504] signal.signal/signal.alarm not working as expected

2015-11-19 Thread Martin Panter

Martin Panter added the comment:

Sorry, EINTR changes were PEP 475.

--

___
Python tracker 

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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-19 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-19 Thread Andrew Svetlov

Changes by Andrew Svetlov :


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



[issue25670] ast.NodeTransformer: remove duplicate getattr()

2015-11-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM!

--
assignee:  -> haypo
components: +Library (Lib)
nosy: +serhiy.storchaka
stage:  -> commit review

___
Python tracker 

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



[issue23441] rlcompleter: tab on empty prefix => insert spaces

2015-11-19 Thread Yury Selivanov

Yury Selivanov added the comment:

Please see my patch for Issue 25660 -- instead of returning '\t' from the 
completion function, I use readline API to modify the input buffer directly.

--

___
Python tracker 

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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9b3144716d17 by Guido van Rossum in branch '3.4':
Issue #25593: Change semantics of EventLoop.stop().
https://hg.python.org/cpython/rev/9b3144716d17

New changeset 158cc5701488 by Guido van Rossum in branch '3.5':
Issue #25593: Change semantics of EventLoop.stop(). (Merge 3.4->3.5)
https://hg.python.org/cpython/rev/158cc5701488

New changeset 2ebe03a94f8f by Guido van Rossum in branch 'default':
Issue #25593: Change semantics of EventLoop.stop(). (Merge 3.5->3.6)
https://hg.python.org/cpython/rev/2ebe03a94f8f

--
nosy: +python-dev

___
Python tracker 

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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-19 Thread Guido van Rossum

Guido van Rossum added the comment:

Hopefully this is it!

--
assignee:  -> gvanrossum
resolution: later -> fixed
status: open -> closed

___
Python tracker 

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



[issue25672] set SSL_MODE_RELEASE_BUFFERS

2015-11-19 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +alex, christian.heimes, dstufft, giampaolo.rodola, janssen, pitrou
title: Unconditionally set SSL_MODE_RELEASE_BUFFERS -> set 
SSL_MODE_RELEASE_BUFFERS

___
Python tracker 

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



[issue25672] Unconditionally set SSL_MODE_RELEASE_BUFFERS

2015-11-19 Thread Cory Benfield

Cory Benfield added the comment:

Oh, one further requirement: we should *not* set this mode for OpenSSL releases 
1.x through 1.0.1g, which have a NULL pointer dereference vulnerability (CVE 
2014-0198). Thanks to Marc-Andre Lemburg for spotting this.

See also: https://www.rapid7.com/db/vulnerabilities/http-openssl-cve-2014-0198

--

___
Python tracker 

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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-19 Thread Guido van Rossum

Guido van Rossum added the comment:

New patch. Update test_utils.run_once() to use the recommended idiom. On second 
thought I don't like issuing a warning when stop() is called before the loop 
runs -- a warning seems overkill for something so minor. But I'm okay with no 
longer recommending the idiom.

--
Added file: http://bugs.python.org/file41082/issue25593_revised_2.patch

___
Python tracker 

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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-19 Thread Justin Mayfield

Justin Mayfield added the comment:

I see.  Seems like good discussion over there.  I joined up.

--

___
Python tracker 

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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-19 Thread Guido van Rossum

Guido van Rossum added the comment:

Whoops. Hopefully this one's right.

--
Added file: http://bugs.python.org/file41087/issue25593_revised_5.patch

___
Python tracker 

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



[issue25656] multiprocessing.dummy: pool.map hangs on empty list

2015-11-19 Thread Tomer

Changes by Tomer :


--
nosy: +jnoller, sbt

___
Python tracker 

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



[issue25674] test_ssl (test_algorithms) failures on bolen-ubuntu slaves: sha256.tbs-internet.com unknown host

2015-11-19 Thread David Bolen

David Bolen added the comment:

Ah, it appears that the transient_internet context manager in the test causes 
it to be skipped if the host is unknown.  So mine was just "lucky" in that it 
fell back to connecting somewhere else.

I've removed my resolver search path on bolen-ubuntu which will resolve the 
test failures on that slave, but I presume test_algorithms is never being run 
by anyone at this point.

--

___
Python tracker 

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



[issue25676] Bug

2015-11-19 Thread Zachary Ware

Changes by Zachary Ware :


Removed file: http://bugs.python.org/file41088/Garcinia Cambogia Free Trial 
UK.html

___
Python tracker 

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



[issue25083] Python can sometimes create incorrect .pyc files

2015-11-19 Thread Brett Cannon

Brett Cannon added the comment:

As I said previously, tzickel, this is an edge case in Python 2.7 which means 
it has a low priority for most core developers. Realize that we are also 
working towards a Python 3.5.1 release and a 3.4.4 release as well (which will 
be the first and last bugfix release for those feature releases, respectively). 
Compare that to Python 2.7 which probably has 10 more bugfix releases and where 
this issue has now existed for five years and this is the first report for it, 
meaning we are not rushing to get it done with other pressing issues to work on.

I realize it's serious to *you*, but that unfortunately doesn't translate it to 
it being as important to everyone else so please be patient. If this is still 
an issue for you then consider deleting all of your .pyc files and switching 
off bytecode file generation: 
https://docs.python.org/2/library/sys.html#sys.dont_write_bytecode .

--

___
Python tracker 

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



[issue25674] test_ssl (test_algorithms) failures on bolen-ubuntu slaves: sha256.tbs-internet.com unknown host

2015-11-19 Thread David Bolen

New submission from David Bolen:

It appears that the test host (sha256.tbs-internet.com) used by test_algorithms 
in test_ssl.py no longer exists.

It was showing up as a certificate failure in the test because it ended up 
falling back to a resolv.conf search path which yielded a host that did do SSL 
but obviously with the wrong certificate.

db3l@buildbot-ubuntu:~$ host sha256.tbs-internet.com
Host sha256.tbs-internet.com not found: 3(NXDOMAIN)

db3l@buildbot-ubuntu:~/tmp/python3.x/Lib/test$ dig +short ns tbs-internet.com
NS1.tbs-internet.com.
maj.pitux.com.
ns2.atdynet.com.
nsc.pitux.com.
db3l@buildbot-ubuntu:~/tmp/python3.x/Lib/test$ dig @ns1.tbs-internet.com 
sha256.tbs-internet.com

; <<>> DiG 9.9.5-3ubuntu0.5-Ubuntu <<>> @ns1.tbs-internet.com 
sha256.tbs-internet.com
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 25154
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;sha256.tbs-internet.com.   IN  A

;; AUTHORITY SECTION:
tbs-internet.com.   3600IN  SOA ovh12.tbs-internet.com. 
hostmaster.tbs-internet.com. 2015110705 21600 3600 2419200 3600

;; Query time: 93 msec
;; SERVER: 2001:41d0:8:380d::1#53(2001:41d0:8:380d::1)
;; WHEN: Thu Nov 19 16:51:58 EST 2015
;; MSG SIZE  rcvd: 105


What I can't yet understand is why this is not causing issues on other slaves.  
I suppose some might be skipping the test if SNI was not supported, but surely 
not all of them?

--
components: Tests
messages: 254938
nosy: db3l, zach.ware
priority: normal
severity: normal
status: open
title: test_ssl (test_algorithms) failures on bolen-ubuntu slaves: 
sha256.tbs-internet.com unknown host
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue18620] multiprocessing page leaves out important part of Pool example

2015-11-19 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: docs@python -> rhettinger

___
Python tracker 

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



[issue25675] doc for BaseEventLoop.run_in_executor() says its a coroutine, but it is not

2015-11-19 Thread Guido van Rossum

Changes by Guido van Rossum :


--
keywords: +easy
priority: normal -> low

___
Python tracker 

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



[issue25675] doc for BaseEventLoop.run_in_executor() says its a coroutine, but it is not

2015-11-19 Thread Nicolas Demarchi

Changes by Nicolas Demarchi :


--
nosy: +gilgamezh

___
Python tracker 

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



[issue25675] doc for BaseEventLoop.run_in_executor() says its a coroutine, but it is not

2015-11-19 Thread Ezequiel Alfie

New submission from Ezequiel Alfie:

Doc says:

coroutine BaseEventLoop.run_in_executor(executor, func, *args)
..
This method is a coroutine.

However, inspecting the code, I find that this function is not a coroutine. 
Also this function returns a Future instance, this fact should be mentioned in 
the doc.

--
components: asyncio
messages: 254939
nosy: ealfie, gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: doc for BaseEventLoop.run_in_executor() says its a coroutine, but it is 
not
type: enhancement
versions: Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue25676] Spam

2015-11-19 Thread Zachary Ware

Changes by Zachary Ware :


--
components:  -Windows
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
title: Bug -> Spam
type: enhancement -> 
versions:  -Python 2.6

___
Python tracker 

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



[issue25083] Python can sometimes create incorrect .pyc files

2015-11-19 Thread tzickel

tzickel added the comment:

Meador Inge any other questions regarding the issue ? I can't believe 2.7.11 is 
coming out soon, and nobody is taking this issue seriously enough...

--

___
Python tracker 

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



[issue25676] Bug

2015-11-19 Thread Richard Tupper

New submission from Richard Tupper:

resolved

--
components: Windows
files: Garcinia Cambogia Free Trial UK.html
messages: 254940
nosy: omskinbourbe1977, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Bug
type: enhancement
versions: Python 2.6
Added file: http://bugs.python.org/file41088/Garcinia Cambogia Free Trial 
UK.html

___
Python tracker 

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



[issue25674] test_ssl (test_algorithms) failures on bolen-ubuntu slaves: sha256.tbs-internet.com unknown host

2015-11-19 Thread Zachary Ware

Zachary Ware added the comment:

So the mystery of that buildbot is solved, but I think that test needs some 
work.

--
keywords: +buildbot
nosy: +alex, christian.heimes, dstufft, giampaolo.rodola, janssen, pitrou
stage:  -> needs patch

___
Python tracker 

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



[issue25646] Distutils and Windows SDK 7.0 / Windows SDK 7.1 / Visual C++ Build Tools 2015

2015-11-19 Thread JGoutin

JGoutin added the comment:

Hello,

I modified "msvc9compiler.py" with following changes : 

- Add automatic compatibility with standalone VC++ compilers from Windows SDK 
7.1. (Not for 6.1/7.0, because that finally don't work as good as it seem on 
first view and there is already MSVC++ for Python 2.7).
- Changed error when "include", "lib", "libpath" or "path" environment variable 
is missing to be more clear.
- Modified some comments and strings to not specify exclusively VS2008 (This 
file is also compatible with more recent VS and that was not really clear 
before)
- Remove "gen_preprocess_options" from import because it was unused.
- Fixed PEP8.

The file was tested with SDK7.1 on a Cython compilation + a Pip install from 
source on Python 3.4 and seem to work perfectly.

Ps: Forget my previous comment on VS2015, I didn't see that code for it was 
moved on "_msvccompiler.py". I'll wait the official release for the fix on 
Visual C++ Build Tools 2015 (Which is, anyway, only in technical preview since 
october)

--
versions: +Python 3.3, Python 3.4 -Python 2.7, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41076/msvc9compiler.py

___
Python tracker 

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



[issue25664] Unexpected UnicodeDecodeError in logging module

2015-11-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue25670] ast.NodeTransformer: remove duplicate getattr()

2015-11-19 Thread STINNER Victor

New submission from STINNER Victor:

ast.NodeTransformer.generic_visit() calls getattr() whereas iter_fields() 
already returns the attribute. The getattr() is useless, attached patch removes 
it.

Sadly, it looks like test_ast doesn't test this class at all :-(

The class is tested *indirectly* by test_inspect.

--
files: node_transformer.patch
keywords: patch
messages: 254903
nosy: haypo
priority: normal
severity: normal
status: open
title: ast.NodeTransformer: remove duplicate getattr()
type: performance
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41078/node_transformer.patch

___
Python tracker 

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



[issue25669] unittest.assertEqual() on un-equal types inheriting from collections.Mapping

2015-11-19 Thread Nathan Herring

Nathan Herring added the comment:

FWIW, it's also pretty easy to write

self.assertEqual({'key': 'value'}, dict(foo))

and get the right behavior, but it'd be nice if it was done automagically by 
type checking.

--

___
Python tracker 

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



[issue25668] Deadlock in logging caused by a possible race condition with "format"

2015-11-19 Thread Florent Viard

Florent Viard added the comment:

I understand that it should have been the reason of this.

But in my opinion, it is very bad to possibly have calculations and user space 
arbitrary operations inside the logging lock.

If you look at my proposition, you can do the format after the filter, but just 
before acquiring the lock. As most handlers start by calling the self.format() 
soon in the "emit()", I don't expect a big difference.

I'm not entirely sure that it is a good solution, but I think that the issue is 
pretty bad.

--

___
Python tracker 

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



[issue25671] Fix venv activate.fish to maintain $status

2015-11-19 Thread Nathan West

New submission from Nathan West:

Many fish_prompts use display the $status (fish's equivalent to $?) somewhere 
in the prompt. Currently, venv's activate.fish overwrites and wraps the user's 
fish_prompt, the wrapping doesn't preserve this $status. This patch ensures 
that the $status is correctly restored before invoking the user's fish_prompt.

This is based on my similar work in virtualenv, at 
https://github.com/pypa/virtualenv/pull/799

--
components: Library (Lib)
files: patch.diff
keywords: patch
messages: 254906
nosy: Lucretiel
priority: normal
severity: normal
status: open
title: Fix venv activate.fish to maintain $status
type: enhancement
versions: Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41079/patch.diff

___
Python tracker 

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



[issue25677] Syntax error caret confused by indentation

2015-11-19 Thread Michael Layzell

New submission from Michael Layzell:

It appears that syntax errors generated by checking the AST will get confused 
by indentation and place the caret incorrectly.

With no indentation:
===
1 + 1 = 2
===
  File "/Users/mlayzell/test.py", line 1
1 + 1 = 2
^
SyntaxError: can't assign to operator
===

With 4 spaces of indentation:
===
if True:
1 + 1 = 2
===
  File "/Users/mlayzell/test.py", line 2
1 + 1 = 2
   ^
SyntaxError: can't assign to operator
===

As you can see, the caret appears to be placed randomly in the middle of the 
second statement, apparently offset (probably by the 4 space indentation).

The above examples were run with Python3.5 on Mac OS X 10.10.4, though my 
somewhat-recent trunk clone exhibits the same problems.

--
components: Interpreter Core
messages: 254951
nosy: Michael Layzell
priority: normal
severity: normal
status: open
title: Syntax error caret confused by indentation
type: behavior
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue25665] typing.NamedTuple instances are not picklable.

2015-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 33df0056c148 by Guido van Rossum in branch '3.5':
Issue #25665: Make NamedTuple picklable.
https://hg.python.org/cpython/rev/33df0056c148

New changeset 8a32d44b8359 by Guido van Rossum in branch 'default':
Issue #25665: Make NamedTuple picklable. (Merge 3.5->3.6)
https://hg.python.org/cpython/rev/8a32d44b8359

--
nosy: +python-dev

___
Python tracker 

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



[issue25665] typing.NamedTuple instances are not picklable.

2015-11-19 Thread Guido van Rossum

Guido van Rossum added the comment:

Fixed it! Thanks for the report *and* the patch. I wrote a different test 
though.

--
assignee:  -> gvanrossum
resolution:  -> fixed
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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-19 Thread Guido van Rossum

Guido van Rossum added the comment:

I'm going to fix up the patch and apply it so this can make 3.5.1 rc1.

--

___
Python tracker 

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



[issue25670] ast.NodeTransformer: remove duplicate getattr()

2015-11-19 Thread STINNER Victor

STINNER Victor added the comment:

Oh, the getattr() is as old as the Lib/ast.py module: change 7d824fd131ad.

--

___
Python tracker 

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



[issue25583] os.makedirs with exist_ok=True raises PermissionError on Windows 7^

2015-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 05d6ddf2b7c2 by Martin Panter in branch '3.4':
Issue #25583: Avoid incorrect errors raised by os.makedirs(exist_ok=True)
https://hg.python.org/cpython/rev/05d6ddf2b7c2

New changeset 515f76bf1254 by Martin Panter in branch '3.5':
Issue #25583: Merge makedirs fix from 3.4 into 3.5
https://hg.python.org/cpython/rev/515f76bf1254

New changeset f0ad5067879b by Martin Panter in branch 'default':
Issue #25583: Merge makedirs fix from 3.5
https://hg.python.org/cpython/rev/f0ad5067879b

New changeset 6ec093f78266 by Martin Panter in branch 'default':
Issue #25583: Add news to 3.6 section
https://hg.python.org/cpython/rev/6ec093f78266

--
nosy: +python-dev

___
Python tracker 

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



[issue25583] os.makedirs with exist_ok=True raises PermissionError on Windows 7^

2015-11-19 Thread Martin Panter

Martin Panter added the comment:

None of the Windows buildbots are failing my particular test. There are other 
failures, but they look unrelated, so I am calling this fixed.

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



[issue25669] unittest.assertEqual() on un-equal types inheriting from collections.Mapping

2015-11-19 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue20898] Missing 507 response description

2015-11-19 Thread SilentGhost

SilentGhost added the comment:

Re msg233465: it doesn't seem like a particularly good justification to remove 
something that is not hurting anyone. The problem now is that because 
http.HTTPStatus is an enumeration, it cannot be extended, therefore when 
someone encounters these non-standard codes, the only option is to just use the 
integers. I trust what Demian is saying, that there might be some clashing 
between the non-standard codes, but until it's shown to be a problem removing 
real-world use cases just actively reduces usefulness of the library. For 
comparison, the module that is actually used by people includes the whole lot 
https://github.com/kennethreitz/requests/blob/master/requests/status_codes.py

--
nosy: +SilentGhost

___
Python tracker 

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



[issue7676] IDLE shell shouldn't use TABs

2015-11-19 Thread irdb

Changes by irdb :


--
nosy: +irdb

___
Python tracker 

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



[issue25672] set SSL_MODE_RELEASE_BUFFERS

2015-11-19 Thread Benjamin Peterson

Benjamin Peterson added the comment:

It might be better to do a runtime OpenSSL version check in case someone 
upgrades or downgrades to an vulnerable version without recompiling Python.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue25670] ast.NodeTransformer: remove duplicate getattr()

2015-11-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7789f338447f by Victor Stinner in branch '3.5':
Issue #25670: Remove duplicate getattr() from ast.NodeTransformer
https://hg.python.org/cpython/rev/7789f338447f

New changeset 2d90f4b27743 by Victor Stinner in branch 'default':
Merge 3.5 (issue #25670)
https://hg.python.org/cpython/rev/2d90f4b27743

--
nosy: +python-dev

___
Python tracker 

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



[issue25668] Deadlock in logging caused by a possible race condition with "format"

2015-11-19 Thread R. David Murray

R. David Murray added the comment:

Using the lock to cover as little as possible makes sense, but there may be a 
reason format is covered by the lock.  I don't know the code well enough to 
say, we'll have to wait for Vinay.

--

___
Python tracker 

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



[issue25667] Supply dual-stack (IPv4/IPv6) socket bind routine

2015-11-19 Thread Jason R. Coombs

New submission from Jason R. Coombs:

When binding to a socket for creating a service, the socket API provides a 
mechanism for selecting only IPv4 or IPv6, but the simple operation of binding 
to all interfaces in a dual-stack environment is not easy, as is revealed in 
issue20215 and issue24209, but also in third-party packages. I ran into this 
during the implementation of aiosmtpd 
(https://gitlab.com/python-smtpd-hackers/aiosmtpd). As a long time maintainer 
of CherryPy, I've enjoyed the [dual stack 
support](https://bitbucket.org/cherrypy/cherrypy/src/536a9cb66e91de92502e766b2b0cf53d1cb5cb4a/cherrypy/wsgiserver/wsgiserver2.py?at=default=file-view-default#wsgiserver2.py-2007:2020)
 there.

I propose the Python stdlib provide a routine to facilitate this need more 
generally, and then invoke that implementation to address these other use-cases.

As it is a new feature, a backports package should be created to supply the 
same functionality for older Pythons.

Would this effort require a PEP? Is there a good place for such a routine 
(maybe socketserver)? Any other thoughts?

--
components: Library (Lib)
messages: 254895
nosy: jason.coombs
priority: normal
severity: normal
status: open
title: Supply dual-stack (IPv4/IPv6) socket bind routine
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



[issue25667] Supply dual-stack (IPv4/IPv6) socket bind routine

2015-11-19 Thread R. David Murray

R. David Murray added the comment:

I don't think it should require a PEP, it looks like a fairly straightforward 
small enhancement.  What is the reason to not put it in the socket module?

--
nosy: +r.david.murray
stage:  -> needs patch
type:  -> enhancement

___
Python tracker 

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



[issue25668] Deadlock in logging caused by a possible race condition with "format"

2015-11-19 Thread R. David Murray

R. David Murray added the comment:

But not doing the format until the last moment is part of the design of logging 
(as low overhead as possible unless a message is actually emitted).

I suspect you are just going to have to pre-calculate that variable if you want 
to log it.  Let's see what Vinay thinks, though :)

--
nosy: +r.david.murray, vinay.sajip

___
Python tracker 

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



[issue25669] unittest.assertEqual() on un-equal types inheriting from collections.Mapping

2015-11-19 Thread Nathan Herring

New submission from Nathan Herring:

We have some code that generates objects that inherit from Mapping that are not 
nearly as straightforward to instantiate in a test. It's much easier to have 
something like the follows:

foo = … # some collections.Mapping subtype
self.assertEqual({'key': 'value'}, foo)

unittest/case.py's _baseAssertEqual will print out both sides and let me do 
visual inspection, but I'd prefer it if it knew both sides supported Mapping 
and in the != case, performed an analog of assertDictEqual so I could just get 
the keys/values that were mismatched, especially in the cases of large 
dictionaries.

--
components: Tests
messages: 254902
nosy: Nathan Herring
priority: normal
severity: normal
status: open
title: unittest.assertEqual() on un-equal types inheriting from 
collections.Mapping
type: enhancement
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



[issue25654] test_multiprocessing_spawn ResourceWarning with -Werror

2015-11-19 Thread Davin Potts

Davin Potts added the comment:

Note issue21779 has been around for quite some time with its own patch 
specifically for multiprocessing, making its tests more robust.

I am hesitant to embrace the patch suggested here.

--
nosy: +davin

___
Python tracker 

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



[issue25668] Deadlock in logging caused by a possible race condition with "format"

2015-11-19 Thread Florent Viard

New submission from Florent Viard:

When an user, use logging, to try to display an object that uses some threading 
locks, there could be a race condition and the logging module will deadlock. 
So, any thread that will try to use logging, will then be stuck forever.

Please see the following test case that is a simplification of a case that I 
have encountered. I'm able to reproduce the issue on python 3.4.3, and python 
2.7.9. But, based on the code, I think that all versions are affected.

Basically, I try to log a variable that is like a property or the __unicode__ 
function of an object. But this value will not be calculated before entering 
the "logging.warning" code but in the "self.format" of the logging handler. 
This self.format is called under the umbrella of the big lock of "logging".

So, if function to get my variable value involve taking another lock and then 
performing a logging call. There is great chances that another thread also took 
the variable lock between the time that I took the logging lock and before it 
take the variable lock.

So, the first thread will wait for the variable lock but will have the logging 
lock.
But the other thread will have the variable lock but will wait the logging lock.


Traceback of the current situation:
# ThreadID: 140410437482240
File: "/usr/lib/python2.7/threading.py", line 783, in __bootstrap
  self.__bootstrap_inner()
File: "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
  self.run()
File: "/usr/lib/python2.7/threading.py", line 763, in run
  self.__target(*self.__args, **self.__kwargs)
File: "testcase-bug-python-deadlock-logging.py", line 37, in second_thread
  my_db.log_pid()
File: "testcase-bug-python-deadlock-logging.py", line 24, in log_pid
  logging.warning(u"my_db pid is: %s", u"1234")
File: "/usr/lib/python2.7/logging/__init__.py", line 1604, in warning
  root.warning(msg, *args, **kwargs)
File: "/usr/lib/python2.7/logging/__init__.py", line 1164, in warning
  self._log(WARNING, msg, args, **kwargs)
File: "/usr/lib/python2.7/logging/__init__.py", line 1271, in _log
  self.handle(record)
File: "/usr/lib/python2.7/logging/__init__.py", line 1281, in handle
  self.callHandlers(record)
File: "/usr/lib/python2.7/logging/__init__.py", line 1321, in callHandlers
  hdlr.handle(record)
File: "/usr/lib/python2.7/logging/__init__.py", line 747, in handle
  self.acquire()
File: "/usr/lib/python2.7/logging/__init__.py", line 698, in acquire
  self.lock.acquire()
File: "/usr/lib/python2.7/threading.py", line 173, in acquire
  rc = self.__block.acquire(blocking)

# ThreadID: 140410445874944
File: "/usr/lib/python2.7/threading.py", line 783, in __bootstrap
  self.__bootstrap_inner()
File: "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
  self.run()
File: "/usr/lib/python2.7/threading.py", line 763, in run
  self.__target(*self.__args, **self.__kwargs)
File: "testcase-bug-python-deadlock-logging.py", line 31, in first_thread
  logging.warning(u"My slow pid is: %s", my_db)
File: "/usr/lib/python2.7/logging/__init__.py", line 1604, in warning
  root.warning(msg, *args, **kwargs)
File: "/usr/lib/python2.7/logging/__init__.py", line 1164, in warning
  self._log(WARNING, msg, args, **kwargs)
File: "/usr/lib/python2.7/logging/__init__.py", line 1271, in _log
  self.handle(record)
File: "/usr/lib/python2.7/logging/__init__.py", line 1281, in handle
  self.callHandlers(record)
File: "/usr/lib/python2.7/logging/__init__.py", line 1321, in callHandlers
  hdlr.handle(record)
File: "/usr/lib/python2.7/logging/__init__.py", line 749, in handle
  self.emit(record)
File: "/usr/lib/python2.7/logging/__init__.py", line 851, in emit
  msg = self.format(record)
File: "/usr/lib/python2.7/logging/__init__.py", line 724, in format
  return fmt.format(record)
File: "/usr/lib/python2.7/logging/__init__.py", line 464, in format
  record.message = record.getMessage()
File: "/usr/lib/python2.7/logging/__init__.py", line 328, in getMessage
  msg = msg % self.args
File: "testcase-bug-python-deadlock-logging.py", line 17, in __unicode__
  with db_lock:
File: "/usr/lib/python2.7/threading.py", line 173, in acquire
  rc = self.__block.acquire(blocking)

--
components: Library (Lib)
files: testcase-bug-python-deadlock-logging.py
messages: 254896
nosy: fviard
priority: normal
severity: normal
status: open
title: Deadlock in logging caused by a possible race condition with "format"
type: crash
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: 
http://bugs.python.org/file41077/testcase-bug-python-deadlock-logging.py

___
Python tracker 

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



[issue25668] Deadlock in logging caused by a possible race condition with "format"

2015-11-19 Thread Florent Viard

Florent Viard added the comment:

Looking at the code, this issue makes sense

in logging/__init__.py (+738):
def handle(self, record):
"""
Conditionally emit the specified logging record.
Emission depends on filters which may have been added to the handler.
Wrap the actual emission of the record with acquisition/release of
the I/O thread lock. Returns whether the filter passed the record for
emission.
"""
rv = self.filter(record)
if rv:
self.acquire()
try:
self.emit(record)
finally:
self.release()
return rv

Than, in the "emit()" of whatever handler used, there is first:
msg = self.format(record)

In my opinion, a possible fix would be to change this code to something like:
rv = self.filter(record)
if rv:
record.formatted_msg = self.format(record)
self.acquire()
try:
self.emit(record)
finally:
self.release()
return rv

And then, change all the "emit()" of log handlers from:
 msg = self.format(record)
to
 msg = record.processed_msg

By not modifying the "msg" and "args" parameters of the record, all the code 
that would have reimplemented the standard log handler will still be working 
fine (even if they will still be at risk of encountering the deadlock)

--

___
Python tracker 

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



[issue25666] Python unexpectedly ignores a signal after fork

2015-11-19 Thread R. David Murray

R. David Murray added the comment:

Are you sure this is a python issue and not an OS issue?  That is, does an 
equivalent C program work correctly?  Since the operation is a fork, I don't 
think there's anything that python does that would cause the signal to be 
ignored.

The comment block in the example code here: 
https://www.win.tue.nl/~aeb/linux/lk/lk-5.html makes me think that the signal 
getting ignored is a possibility at the OS level, though it isn't explicitly 
clear.

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



[issue20438] inspect: Deprecate getfullargspec?

2015-11-19 Thread R. David Murray

R. David Murray added the comment:

Please open a new issue for that observation/request.

--

___
Python tracker 

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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-19 Thread Guido van Rossum

Guido van Rossum added the comment:

Here's a better patch.

- Renamed _stopped to _stopping.
- Restore test_utils.run_once() and add a test for it.
- Change logic so if _stopping is True upon entering run_forever(), it will run 
once.

Please try it out!!

--

___
Python tracker 

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



[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-19 Thread Guido van Rossum

Guido van Rossum added the comment:

Here's the file.

--
Added file: http://bugs.python.org/file41080/issue25593_revised.patch

___
Python tracker 

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