[issue32191] TypeError does not work when function with type hint

2017-11-30 Thread Kyeongpil

Kyeongpil  added the comment:

Oh, I confused the syntax of type hint.
Sorry

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



[issue32147] improve performance of binascii.unhexlify() by using conversion table

2017-11-30 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I can't reproduce the performance difference.

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



[issue32191] TypeError does not work when function with type hint

2017-11-30 Thread Kyeongpil

New submission from Kyeongpil :

TypeError does not work when I input float variable into function that I give 
type hint.

example code is like this:
def a(b: int) -> int:
return b+1

a(1.1)

and the result is 1.1.
However, I think it should throw TypeError Exception because type of input is 
float, not int.

--
components: ctypes
messages: 307367
nosy: Kang
priority: normal
severity: normal
status: open
title: TypeError does not work when function with type hint
type: behavior
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



[issue28668] instanciation of multiprocessing.Queue raises ImportError in test_logging

2017-11-30 Thread Xavier de Gaye

Change by Xavier de Gaye :


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



[issue28668] instanciation of multiprocessing.Queue raises ImportError in test_logging

2017-11-30 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset bf2b65e413ca5ec705c7e2f463d0d75e947588a4 by xdegaye in branch 
'master':
bpo-28668: test.support.requires_multiprocessing_queue is removed (GH-4560)
https://github.com/python/cpython/commit/bf2b65e413ca5ec705c7e2f463d0d75e947588a4


--

___
Python tracker 

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



[issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell

2017-11-30 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue32189] SyntaxError for yield expressions inside comprehensions & genexps

2017-11-30 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
components: +Interpreter Core
keywords: +patch
nosy: +serhiy.storchaka
pull_requests: +4572
stage: needs patch -> patch review

___
Python tracker 

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



[issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 8bcd41040a5f1f9b48a86d0e21f196e4b1f90e4b by Victor Stinner (Miss 
Islington (bot)) in branch '3.6':
bpo-32186: Release the GIL during lseek and fstat (GH-4652) (#4661)
https://github.com/python/cpython/commit/8bcd41040a5f1f9b48a86d0e21f196e4b1f90e4b


--

___
Python tracker 

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



[issue25612] nested try..excepts don't work correctly for generators

2017-11-30 Thread Chris Jerdonek

Change by Chris Jerdonek :


--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue25683] __context__ for yields inside except clause

2017-11-30 Thread Chris Jerdonek

Change by Chris Jerdonek :


--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue32145] Wrong ExitStack Callback recipe

2017-11-30 Thread Nick Coghlan

Nick Coghlan  added the comment:

Hmm, I think that may actually qualify as a bug in the `pop_all()` 
implementation: 
https://docs.python.org/3/library/contextlib.html#contextlib.ExitStack.pop_all 
states that it returns an ExitStack instance, not an instance of the current 
type.

For 3.6 (and hence the online docs), we can fix the recipe to allow for 
`callback=None` (with the expectation that the callback will be added 
afterwards).

Barry, I'd be interested in your thoughts on what to do for 3.7+ - we can 
either leave the current behaviour alone, and amend the documentation, or else 
change the code to call ExitStack directly, rather than type(self).

I'm leaning towards only changing the docs as being lower risk - folks may be 
relying on the current behaviour, so changing it may break their code, whereas 
changing the docs doesn't risk breaking anything.

--
nosy: +barry
versions: +Python 3.7 -Python 3.4

___
Python tracker 

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



[issue27172] Undeprecate inspect.getfullargspec()

2017-11-30 Thread Nick Coghlan

Nick Coghlan  added the comment:

Independently of what we eventually decide to do for 4.0, there are some 
changes we could make at the documentation level to more clearly indicate "Even 
though this isn't deprecated, you still shouldn't use it for new code": 
https://bugs.python.org/issue32190

--

___
Python tracker 

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



[issue32190] Separate out legacy introspection APIs in the inspect docs

2017-11-30 Thread Nick Coghlan

New submission from Nick Coghlan :

(Follow up to https://bugs.python.org/issue27172)

The deprecation notice on inspect.getfullargspec has been removed, since we 
want folks porting from Python 2 to rely on it as part of the porting process, 
rather than feeling they need to upgrade to using inspect.signature() 
immediately.

At the same time, we really don't want folks relying on it for *new* code, 
since it has some inherent limitations (like failing to distinguish 
positional-only args from positional-and-keyword ones), and some odd historical 
quirks (like reporting the bound arg as part of the signature for already bound 
methods).

The subprocess modules clearly separates out the "Older high-level API" 
https://docs.python.org/3/library/subprocess.html#older-high-level-api to help 
make it clear that new code should use "subprocess.run" instead.

We could potentially add a similar final section to the inspect documentation 
for "Legacy introspection APIs".

That would also be useful if https://bugs.python.org/issue31230 is eventually 
implemented - the current generator and coroutine specific APIs could be moved 
down to the legacy section for backwards compatibility maintenance, with the 
type independent API being preferred for new code.

--
assignee: docs@python
components: Documentation
messages: 307362
nosy: brett.cannon, docs@python, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Separate out legacy introspection APIs in the inspect docs
type: enhancement
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



[issue10544] yield expression inside generator expression does nothing

2017-11-30 Thread Nick Coghlan

Nick Coghlan  added the comment:

With Serhiy's patch merged, I'm marking this as resolved. Thanks all!

https://bugs.python.org/issue32189 is the follow-up issue to turn the warning 
into an unconditional SyntaxError in 3.8.

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

___
Python tracker 

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



[issue32189] SyntaxError for yield expressions inside comprehensions & genexps

2017-11-30 Thread Nick Coghlan

New submission from Nick Coghlan :

This is the Python 3.8 follow-up to turn the DeprecationWarning from 
https://bugs.python.org/issue10544 into an unconditional SyntaxError.

--
messages: 307360
nosy: ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: SyntaxError for yield expressions inside comprehensions & genexps
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue10544] yield expression inside generator expression does nothing

2017-11-30 Thread Nick Coghlan

Nick Coghlan  added the comment:


New changeset 73a7e9b10b2ec9636e3c6396cf7b3695f8ed1856 by Nick Coghlan (Serhiy 
Storchaka) in branch 'master':
bpo-10544: Deprecate "yield" in comprehensions and generator expressions. 
(GH-4579)
https://github.com/python/cpython/commit/73a7e9b10b2ec9636e3c6396cf7b3695f8ed1856


--

___
Python tracker 

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



[issue32151] -mvenv vs minor python version updates

2017-11-30 Thread Tzu-ping Chung

Tzu-ping Chung  added the comment:

Not sure if it’s the same thing, but I want to plug in that this can happen 
when you do a micro upgrade (e.g. 3.5.1 → 3.5.2) as well. This is because micro 
updates sometimes bump versions of dependencies (e.g. OpenSSL, Tk), and that 
breaks theirs links in the venv. Should this also be expected?

--
nosy: +uranusjr

___
Python tracker 

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



[issue16487] Allow ssl certificates to be specified from memory rather than files.

2017-11-30 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

My impression was that progress on PEP 543 is temporarily stalled and not going 
to be finished for 3.7. Is that wrong?

There's going to need to be a significant amount of shimming to implement the 
PEP 543 interfaces on top of ssl no matter what you do. Maybe it would be best 
to merge a simple load_cert_chain_from_buffer method now for 3.7, and worry 
about redesigning the world later?

--

___
Python tracker 

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



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

2017-11-30 Thread stevezh

stevezh  added the comment:

It maybe the semaphore tracker process doesn't unlink the semaphore as soon as 
possible when child process exit when the system is slow. Increase test case's 
time in the child and before assertRaises will help.

--
nosy: +stevezh

___
Python tracker 

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



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

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:

x86 Tiger 3.x:

http://buildbot.python.org/all/#/builders/30/builds/260

==
FAIL: test_semaphore_tracker 
(test.test_multiprocessing_forkserver.TestSemaphoreTracker)
--
Traceback (most recent call last):
  File 
"/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/_test_multiprocessing.py",
 line 4380, in test_semaphore_tracker
_multiprocessing.sem_unlink(name2)
AssertionError: OSError not raised

==
FAIL: test_forkserver_sigkill 
(test.test_multiprocessing_forkserver.WithProcessesTestProcess)
--
Traceback (most recent call last):
  File 
"/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/_test_multiprocessing.py",
 line 653, in test_forkserver_sigkill
self.check_forkserver_death(signal.SIGKILL)
  File 
"/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/_test_multiprocessing.py",
 line 643, in check_forkserver_death
self.assertTrue(evt.is_set())
AssertionError: False is not true

--

___
Python tracker 

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



[issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server

2017-11-30 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4571

___
Python tracker 

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



[issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 6a89481680b921e7b317c29877bdda9a6031e5ad by Victor Stinner (Nir 
Soffer) in branch 'master':
bpo-32186: Release the GIL during lseek and fstat (#4652)
https://github.com/python/cpython/commit/6a89481680b921e7b317c29877bdda9a6031e5ad


--

___
Python tracker 

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



[issue32188] ImpImporter.find_modules removes symlinks in paths

2017-11-30 Thread Henk-Jaap Wagenaar

New submission from Henk-Jaap Wagenaar :

ImpImporter.find_modules calls os.path.real on the path used:

https://github.com/python/cpython/blob/be6b74c0795b709c7a04e2187a7e32d08f5155f6/Lib/pkgutil.py#L181

This means if there is a submodule (foo.bar) which first appears on the path 
involving a symlink that

pkgutil.find_loader('foo').get_filename()

has the path with the symlinks removed whereas

import foo
foo.__file__

does have the symlinks. Note that is in the absence of any PEP302 import hooks.

This behaviour comes up in pytest test/plugin collection in virtual 
environments in Py2.7 on linux where they have a symlinked venv/local/lib 
before venv/lib on the path and creates problems.

There might very well be a good reason the path is made absolute here, however 
the test suite passes when it is reverted to path = [self.path].

--
components: Library (Lib)
messages: 307353
nosy: Henk-Jaap Wagenaar
priority: normal
severity: normal
status: open
title: ImpImporter.find_modules removes symlinks in paths
type: behavior
versions: Python 2.7, 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



[issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell

2017-11-30 Thread Dan Snider

Dan Snider  added the comment:

The hacked cell object using this method appears to be changed to NULL when 
accessed by frame.f_localsplus. I don't know C well enough to find out what's 
happening because nothing looks different to me in 
PyFrame_FastToLocalsWithError.


Also creating a closure with:
from ctypes import pythonapi, py_object

new_cell = pythonapi.PyCell_New
new_cell.argtypes = (py_object, )
new_cell.restype = py_object

doesn't solve this either.

--

___
Python tracker 

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



[issue32132] Android5

2017-11-30 Thread Berker Peksag

Change by Berker Peksag :


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



[issue32145] Wrong ExitStack Callback recipe

2017-11-30 Thread Berker Peksag

Change by Berker Peksag :


--
nosy: +ncoghlan
type: crash -> behavior

___
Python tracker 

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



[issue20891] PyGILState_Ensure on non-Python thread causes fatal error

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:

Ok, the bug is now fixed in Python 2.7, 3.6 and master (future 3.7). On 3.6 and 
master, the fix comes with an unit test.

Thanks Steve Dower for the bug report, sorry for the long delay, I completely 
forgot this old bug!

Marcin Kasperski: Thanks for the reminder. Sadly, we will have to wait for the 
next release to get the fix. In the meanwhile, you can workaround the bug by 
calling PyEval_InitThreads() after Py_Initialize() but before running actual 
code.

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



[issue20891] PyGILState_Ensure on non-Python thread causes fatal error

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset e10c9de9d74fd4c26b32e6719d96f04a5be6987d by Victor Stinner in 
branch '3.6':
bpo-20891: Fix PyGILState_Ensure() (#4650) (#4655)
https://github.com/python/cpython/commit/e10c9de9d74fd4c26b32e6719d96f04a5be6987d


--

___
Python tracker 

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



[issue20891] PyGILState_Ensure on non-Python thread causes fatal error

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset be6b74c0795b709c7a04e2187a7e32d08f5155f6 by Victor Stinner in 
branch '2.7':
bpo-20891: Fix PyGILState_Ensure() (#4650) (#4657)
https://github.com/python/cpython/commit/be6b74c0795b709c7a04e2187a7e32d08f5155f6


--

___
Python tracker 

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



[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:

"LGTM. Do you want to write this a pull request?"

Michael? You didn't answer to my question.

--

___
Python tracker 

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



[issue32072] Issues with binary plists

2017-11-30 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 8cd31082fba88cf0064590fd3d55b6c1c964f11c by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
bpo-32072: Fix issues with binary plists. (GH-4455) (#4654)
https://github.com/python/cpython/commit/8cd31082fba88cf0064590fd3d55b6c1c964f11c


--

___
Python tracker 

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



[issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:

We already release the GIL when calling lseek() in fileio.c, in the 
portable_lseek() function. So it makes sense to also do it in 
_io_FileIO_readall_impl() in the same file. os.lseek() also releases the GIL. 

I found another functions which calls lseek() without releasing the GIL:

* the Windows implementation of new_mmap_object()
* _Py_DisplaySourceLine()
* fp_setreadl() of Parser/tokenizer.c

I'm not sure that these 3 functions should be modified. In case of doubt, I 
prefer to not touch the code.

--

___
Python tracker 

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



[issue32072] Issues with binary plists

2017-11-30 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4570

___
Python tracker 

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



[issue20891] PyGILState_Ensure on non-Python thread causes fatal error

2017-11-30 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4569

___
Python tracker 

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



[issue32072] Issues with binary plists

2017-11-30 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4568

___
Python tracker 

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



[issue20891] PyGILState_Ensure on non-Python thread causes fatal error

2017-11-30 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4567

___
Python tracker 

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



[issue28416] defining persistent_id in _pickle.Pickler subclass causes reference cycle

2017-11-30 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset c91bf742e542dceaf71042a44b5a04fb08bdda70 by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
bpo-28416: Break reference cycles in Pickler and Unpickler subclasses (GH-4080) 
(#4653)
https://github.com/python/cpython/commit/c91bf742e542dceaf71042a44b5a04fb08bdda70


--

___
Python tracker 

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



[issue32072] Issues with binary plists

2017-11-30 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +larry

___
Python tracker 

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



[issue32072] Issues with binary plists

2017-11-30 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4566

___
Python tracker 

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



[issue32072] Issues with binary plists

2017-11-30 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset a897aeeef647259a938a36cb5eb6680c86021c6a by Serhiy Storchaka in 
branch 'master':
bpo-32072: Fix issues with binary plists. (#4455)
https://github.com/python/cpython/commit/a897aeeef647259a938a36cb5eb6680c86021c6a


--

___
Python tracker 

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



[issue32184] pdb/ipdb is not usable on Linux (which works on Windows) from a single multiprocessing.Process when the main process is stuck at process.join()

2017-11-30 Thread nartes

nartes  added the comment:

https://gist.github.com/efe828a7bbac97e02a7d83d2a2d78540

import io
import os
import sys
import multiprocessing


class B(multiprocessing.Process):
@classmethod
def _my_thread(self, a, b):
print("Class method as a separate process entry point. (%s, %s)" % (a, 
b))

def __init__(self, glock, *args, **kwargs):
multiprocessing.Process.__init__(self, *args, **kwargs)

self.glock = glock

def run(self):
try:
sys.stdin = os.fdopen(0, 'r')
sys.stdout = os.fdopen(1, 'w')

self._run()
except Exception as e:
raise e
finally:
print("Sort of a process destructor, PID = %s" % os.getpid())
for s in [sys.stdin, sys.stdout]:
if s is not None and\
   hasattr(s, 'close'):
s.close()

def _run(self):
print("Hello, World!")


class A:
def __init__(self):
self.glock = multiprocessing.Lock()

def run(self):
jobs = []
for k in range(3):
jobs.append(B(self.glock))
#jobs.append(B(self.glock, None, None, None))
jobs.append(multiprocessing.Process(
target=B._my_thread,
args=("one", "two")))

for j in jobs:
j.start()

for j in jobs:
j.join()


if __name__ == '__main__':
A().run()

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

___
Python tracker 

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



[issue20891] PyGILState_Ensure on non-Python thread causes fatal error

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset b4d1e1f7c1af6ae33f0e371576c8bcafedb099db by Victor Stinner in 
branch 'master':
bpo-20891: Fix PyGILState_Ensure() (#4650)
https://github.com/python/cpython/commit/b4d1e1f7c1af6ae33f0e371576c8bcafedb099db


--

___
Python tracker 

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



[issue28416] defining persistent_id in _pickle.Pickler subclass causes reference cycle

2017-11-30 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4565

___
Python tracker 

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



[issue28416] defining persistent_id in _pickle.Pickler subclass causes reference cycle

2017-11-30 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 986375ebde0dd5ff2b7349e445a06bd28a3a8ee2 by Serhiy Storchaka in 
branch 'master':
bpo-28416: Break reference cycles in Pickler and Unpickler subclasses (#4080)
https://github.com/python/cpython/commit/986375ebde0dd5ff2b7349e445a06bd28a3a8ee2


--

___
Python tracker 

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



[issue32187] tab completion fails in pdb/ipdb/ipython for python3.7

2017-11-30 Thread nartes

nartes  added the comment:

installing parse 0.1.1 solves the issue

--
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue32187] tab completion fails in pdb/ipdb/ipython for python3.8

2017-11-30 Thread nartes

New submission from nartes :

Python 3.7.0a2+ (heads/master:bc8ac6b00e, Nov 30 2017, 22:14:00)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import multiException in thread Thread-38:
Traceback (most recent call last):
  File 
"/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/parso/grammar.py",
 line 265, in load_grammar
return _loaded_grammars[path]
KeyError: 
'/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/parso/python/grammar37.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/parso/grammar.py",
 line 268, in load_grammar
with open(path) as f:
FileNotFoundError: [Errno 2] No such file or directory: 
'/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/parso/python/grammar37.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/threading.py",
 line 917, in _bootstrap_inner
self.run()
  File 
"/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/threading.py",
 line 865, in run
self._target(*self._args, **self._kwargs)
  File 
"/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/prompt_toolkit/interface.py",
 line 865, in run
completions = list(buffer.completer.get_completions(document, 
complete_event))
  File 
"/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/terminal/ptutils.py",
 line 84, in get_completions
yield from self._get_completions(body, offset, cursor_position, 
self.ipy_completer)
  File 
"/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/terminal/ptutils.py",
 line 94, in _get_completions
for c in completions:
  File 
"/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/core/completer.py",
 line 438, in _deduplicate_completions
completions = list(completions)
  File 
"/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/core/completer.py",
 line 1791, in completions
for c in self._completions(text, offset, 
_timeout=self.jedi_compute_type_timeout/1000):
  File 
"/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/core/completer.py",
 line 1831, in _completions
full_text=full_text, cursor_line=cursor_line, cursor_pos=cursor_column)
  File 
"/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/core/completer.py",
 line 1998, in _complete
cursor_pos, cursor_line, full_text)
  File 
"/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/core/completer.py",
 line 1348, in _jedi_matches
text, namespaces, column=cursor_column, line=cursor_line + 1)
  File 
"/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/jedi/api/__init__.py",
 line 386, in __init__
super(Interpreter, self).__init__(source, **kwds)
  File 
"/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/jedi/api/__init__.py",
 line 110, in __init__
self._grammar = parso.load_grammar()
  File 
"/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/parso/grammar.py",
 line 283, in load_grammar
return load_grammar(**kwargs)
  File 
"/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/parso/grammar.py",
 line 275, in load_grammar
raise NotImplementedError(message)
NotImplementedError: Python version None is currently not supported.

--
files: Screenshot from 2017-11-30 23-04-28.png
messages: 307339
nosy: nartes
priority: normal
severity: normal
status: open
title: tab completion fails in pdb/ipdb/ipython for python3.8
type: crash
versions: Python 3.7
Added file: https://bugs.python.org/file47310/Screenshot from 2017-11-30 
23-04-28.png

___
Python tracker 

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



[issue32187] tab completion fails in pdb/ipdb/ipython for python3.7

2017-11-30 Thread nartes

Change by nartes :


--
title: tab completion fails in pdb/ipdb/ipython for python3.8 -> tab completion 
fails in pdb/ipdb/ipython for python3.7

___
Python tracker 

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



[issue32182] Infinite recursion in email.message.as_string()

2017-11-30 Thread Silla Rizzoli

New submission from Silla Rizzoli :

Sometimes RFC-correct email headers do not get folded correctly; the example 
code below results in an infinite recursion exception.

import sys
import mailbox
from email.message import EmailMessage
from email.headerregistry import Address
from email import policy

ePol = policy.SMTP.clone(refold_source='long',max_line_length=78)
msg = EmailMessage(ePol)
msg['From'] = Address("abcdefgh ijklnopq","a.ijklnopq","antani.com")
msg['To'] = 
(Address("abcdef.ghijkl...@pqrstuvwxyz12345678.it","abcdef.ghijklmnop","pqrstuvwxyz12345678.it"),
 Address("Jane Doe", "jane", "doe.com"))
msg['Subject'] = "Test"
msg.set_content("Body")
finalMail = msg.as_string()

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.6/email/message.py", line 968, in as_string
return super().as_string(maxheaderlen=maxheaderlen, policy=policy)
  File "/usr/lib/python3.6/email/message.py", line 158, in as_string
g.flatten(self, unixfrom=unixfrom)
  File "/usr/lib/python3.6/email/generator.py", line 116, in flatten
self._write(msg)
  File "/usr/lib/python3.6/email/generator.py", line 195, in _write
self._write_headers(msg)
  File "/usr/lib/python3.6/email/generator.py", line 222, in _write_headers
self.write(self.policy.fold(h, v))
  File "/usr/lib/python3.6/email/policy.py", line 183, in fold
return self._fold(name, value, refold_binary=True)
  File "/usr/lib/python3.6/email/policy.py", line 205, in _fold
return value.fold(policy=self)
  File "/usr/lib/python3.6/email/headerregistry.py", line 255, in fold
return header.fold(policy=policy)
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 300, in fold
self._fold(folded)
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 1226, in _fold
rest._fold(folded)
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold
if folded.append_if_fits(part, tstr):
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in 
append_if_fits
token._fold(self)
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold
if folded.append_if_fits(part, tstr):
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in 
append_if_fits
token._fold(self)
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold
if folded.append_if_fits(part, tstr):
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in 
append_if_fits
token._fold(self)
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold
if folded.append_if_fits(part, tstr):
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in 
append_if_fits
token._fold(self)
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold
if folded.append_if_fits(part, tstr):
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in 
append_if_fits
token._fold(self)
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold
if folded.append_if_fits(part, tstr):
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in 
append_if_fits
token._fold(self)
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold
if folded.append_if_fits(part, tstr):
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in 
append_if_fits
token._fold(self)
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold
if folded.append_if_fits(part, tstr):
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in 
append_if_fits
token._fold(self)
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold
if folded.append_if_fits(part, tstr):
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in 
append_if_fits
token._fold(self)
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold
if folded.append_if_fits(part, tstr):
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in 
append_if_fits
token._fold(self)
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold
if folded.append_if_fits(part, tstr):
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in 
append_if_fits
token._fold(self)
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold
if folded.append_if_fits(part, tstr):
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in 
append_if_fits
token._fold(self)
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold
if folded.append_if_fits(part, tstr):
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in 
append_if_fits
token._fold(self)
  File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold
if folded.append_if_fits(part, tstr):
  File 

[issue32171] Inconsistent results for fractional power of -infinity

2017-11-30 Thread Tim Peters

Tim Peters  added the comment:

Mark, indeed, in the email from Vincent Lefevre you linked to, his entire 
argument was:  (a) we already specified what happens when the base is a zero; 
so, (b) for each of the six pow(a_zero, y) cases we specified, derive a 
matching rule for an inf base via:

pow(an_inf, y) = 1/pow(1/an_inf, y) = 1/pow(the_same_sign_zero, y)

Looking at the other msgs in that thread, everyone found that instantly 
compelling.

Pierre, give up ;-)  These standards are years old already, so it's exceedingly 
unlikely any specified behavior will ever change again, for "backward 
compatibility" reasons alone.

--

___
Python tracker 

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



[issue27172] Undeprecate inspect.getfullargspec()

2017-11-30 Thread Brett Cannon

Brett Cannon  added the comment:

I'm not saying we remove getfullargspec() **right now**, just that we don't 
keep it around long-term as it simply can't evolve to keep up with how rich our 
parameter support is today and might become in the future. And that's why, for 
me, the deprecation was enough to signal, "this code is here for now and you 
can use it, but you really need to be aware of some issues that are leading to 
it being removed". Now obviously you prefer the doc approach for this, Nick, 
and that's fine since this is quickly devolving into "agree to disagree" as 
while "there are plenty of other standard library APIs that we keep around 
primarily for backwards compatibility reasons", I personally would say we 
should be prepared to deprecate them for Python 4 (which is what I'm talking 
about here, not e.g. 3.8).

--

___
Python tracker 

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



[issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server

2017-11-30 Thread Nir Soffer

Change by Nir Soffer :


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

___
Python tracker 

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



[issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server

2017-11-30 Thread Nir Soffer

Change by Nir Soffer :


--
pull_requests: +4564

___
Python tracker 

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



[issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server

2017-11-30 Thread Nir Soffer

Nir Soffer  added the comment:

Forgot to mention - reproducible with python 2.7.

Similar issues exists in python 3, but I did not try to reproduce since we
are using python 2.7.

I posted patches for both 2.7 and master:
- https://github.com/python/cpython/pull/4651
- https://github.com/python/cpython/pull/4652

--
nosy: +benjamin.peterson, stutzbach, vstinner

___
Python tracker 

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



[issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server

2017-11-30 Thread Nir Soffer

New submission from Nir Soffer :

Using io.FileIO can hang all threads when accessing an inaccessible NFS
server.

To reproduce this, you need to open the file like this:

fd = os.open(filename, ...)
fio = io.FileIO(fd, "r+", closefd=True)

Inside fileio_init, there is a checkfd call, calling fstat without releasing
the GIL. This will hang all threads.

The expected behavior is blocking only the thread blocked on the system call,
so a system stay responsive and can serve other tasks.

Here is the log showing this issue, created with the attached reproducer
script (fileio_nfs_test.py).

# python fileio_nfs_test.py mnt/fileio.out dumbo.tlv.redhat.com
2017-11-30 18:41:49,159 - (MainThread) - pid=3436
2017-11-30 18:41:49,159 - (MainThread) - Opening mnt/fileio.out
2017-11-30 18:41:49,160 - (MainThread) - OK fd=3
2017-11-30 18:41:49,161 - (MainThread) - Starting canary thread
2017-11-30 18:41:49,161 - (Canary) - Blocking access to storage
2017-11-30 18:41:49,169 - (Canary) - If this test is hang, please run: iptables 
-D OUTPUT -p tcp -d dumbo.tlv.redhat.com --dport 2049 -j DROP
2017-11-30 18:41:49,169 - (Canary) - check 0
2017-11-30 18:41:49,169 - (MainThread) - Waiting until storage is blocked...
2017-11-30 18:41:50,170 - (Canary) - check 1
2017-11-30 18:41:51,170 - (Canary) - check 2
2017-11-30 18:41:52,171 - (Canary) - check 3
2017-11-30 18:41:53,171 - (Canary) - check 4
2017-11-30 18:41:54,172 - (Canary) - check 5
2017-11-30 18:41:55,172 - (Canary) - check 6
2017-11-30 18:41:56,172 - (Canary) - check 7
2017-11-30 18:41:57,173 - (Canary) - check 8
2017-11-30 18:41:58,173 - (Canary) - check 9
2017-11-30 18:41:59,174 - (MainThread) - Opening io.FileIO

Everything is hang now!

After some time I run this from another shell:
 iptables -D OUTPUT -p tcp -d dumbo.tlv.redhat.com --dport 2049 -j DROP

And now the script is unblocked and finish.

2017-11-30 18:45:29,683 - (MainThread) - OK
2017-11-30 18:45:29,684 - (MainThread) - Creating mmap
2017-11-30 18:45:29,684 - (Canary) - check 10
2017-11-30 18:45:29,684 - (MainThread) - OK
2017-11-30 18:45:29,685 - (MainThread) - Filling mmap
2017-11-30 18:45:29,685 - (MainThread) - OK
2017-11-30 18:45:29,685 - (MainThread) - Writing mmap to storage
2017-11-30 18:45:29,719 - (MainThread) - OK
2017-11-30 18:45:29,719 - (MainThread) - Syncing
2017-11-30 18:45:29,719 - (MainThread) - OK
2017-11-30 18:45:29,720 - (MainThread) - Done

We have a canary thread logging every second. Once we tried to open
the FileIO, the canary thread stopped - this is possible only if the io
extension module was holding the GIL during a blocking call.

And here is the backtrace of the hang process in the kernel:

# cat /proc/3436/stack
[] rpc_wait_bit_killable+0x24/0xb0 [sunrpc]
[] __rpc_execute+0x154/0x410 [sunrpc]
[] rpc_execute+0x68/0xb0 [sunrpc]
[] rpc_run_task+0xf6/0x150 [sunrpc]
[] nfs4_call_sync_sequence+0x63/0xa0 [nfsv4]
[] _nfs4_proc_getattr+0xcc/0xf0 [nfsv4]
[] nfs4_proc_getattr+0x72/0xf0 [nfsv4]
[] __nfs_revalidate_inode+0xbf/0x310 [nfs]
[] nfs_getattr+0x95/0x250 [nfs]
[] vfs_getattr+0x46/0x80
[] vfs_fstat+0x45/0x80
[] SYSC_newfstat+0x24/0x60
[] SyS_newfstat+0xe/0x10
[] system_call_fastpath+0x16/0x1b
[] 0x

You cannot attach to the process with gdb, since it is in D state, but once
the process is unblocked, gbd takes control, and we see:

Thread 2 (Thread 0x7f97a2ea5700 (LWP 4799)):
#0  0x7f97ab925a0b in do_futex_wait.constprop.1 () from 
/lib64/libpthread.so.0
#1  0x7f97ab925a9f in __new_sem_wait_slow.constprop.0 () from 
/lib64/libpthread.so.0
#2  0x7f97ab925b3b in sem_wait@@GLIBC_2.2.5 () from /lib64/libpthread.so.0
#3  0x7f97abc455f5 in PyThread_acquire_lock () from 
/lib64/libpython2.7.so.1.0
#4  0x7f97abc11156 in PyEval_RestoreThread () from 
/lib64/libpython2.7.so.1.0
#5  0x7f97a44f9086 in time_sleep () from 
/usr/lib64/python2.7/lib-dynload/timemodule.so
#6  0x7f97abc18bb0 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#7  0x7f97abc1aefd in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#8  0x7f97abc183fc in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#9  0x7f97abc1aefd in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#10 0x7f97abc183fc in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#11 0x7f97abc1aefd in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#12 0x7f97abba494d in function_call () from /lib64/libpython2.7.so.1.0
#13 0x7f97abb7f9a3 in PyObject_Call () from /lib64/libpython2.7.so.1.0
#14 0x7f97abc135bd in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#15 0x7f97abc1857d in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#16 0x7f97abc1857d in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
#17 0x7f97abc1aefd in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
#18 0x7f97abba4858 in function_call () from /lib64/libpython2.7.so.1.0
#19 0x7f97abb7f9a3 in PyObject_Call () from 

[issue32185] SSLContext.wrap_socket sends SNI Extension when server_hostname is IP

2017-11-30 Thread Christian Heimes

Christian Heimes  added the comment:

Thanks!

3.4 and 3.5 are out of scope. They only receive security fixes.

For 3.7 
https://github.com/python/cpython/compare/master...tiran:openssl_check_hostname 
will take care of the issue

2.7 and 3.6 are a bit tricky. There is no platform-compatible way to detect if 
a string is an IP address. inet_pton() is not available on Windows. I cannot 
use the OpenSSL parser because it is only available in 1.0.2+. 2.7 and 3.6 
still support 0.9.8.

--
nosy: +alex, dstufft, janssen
versions:  -Python 3.4, Python 3.5

___
Python tracker 

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



[issue32185] SSLContext.wrap_socket sends SNI Extension when server_hostname is IP

2017-11-30 Thread Matt Davis

New submission from Matt Davis :

The current implementation of SSLContext.wrap_socket blindly sends whatever is 
passed in server_hostname in the SNI extension, assuming it's a DNS hostname. 
RFC6066 describes the SNI TLS extension, and specifically states that 'Literal 
IPv4 and IPv6 addresses are not permitted in "HostName".' The RFC makes no 
recommendation on how a server implementation that violates this requirement 
should behave; Microsoft's kernel HTTP listener (http.sys) chooses to abort the 
connection if SNI has been enabled. In the http.sys case, SNI is a global 
setting, currently off by default, but if any registered listener has SNI 
enabled, the connection abort behavior applies to all listeners.

SSLContext.wrap_socket() should determine whether server_hostname is an IP 
address before including the SNI extension. 

I've submitted a PR to work around this issue in urllib3 
(https://github.com/shazow/urllib3/pull/1287) in the meantime, but would be 
good to get this fixed, especially if Microsoft decides to enable SNI by 
default at some point.

--
assignee: christian.heimes
components: SSL
messages: 307333
nosy: christian.heimes, nitzmahone
priority: normal
severity: normal
status: open
title: SSLContext.wrap_socket sends SNI Extension when server_hostname is IP
versions: Python 2.7, 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



[issue32184] pdb/ipdb is not usable on Linux (which works on Windows) from a single multiprocessing.Process when the main process is stuck at process.join()

2017-11-30 Thread nartes

New submission from nartes :

https://asciinema.org/a/Sl7BTmS4krLdrLb9c4YeMgAG1

--
components: Interpreter Core, Library (Lib)
files: parallel_sandbox.py
messages: 307332
nosy: nartes
priority: normal
severity: normal
status: open
title: pdb/ipdb is not usable on Linux (which works on Windows) from a single 
multiprocessing.Process when the main process is stuck at process.join()
type: behavior
versions: Python 2.7, Python 3.6
Added file: https://bugs.python.org/file47308/parallel_sandbox.py

___
Python tracker 

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



[issue20891] PyGILState_Ensure on non-Python thread causes fatal error

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:

I have to check if Python 2.7 is impacted as well.

--
versions: +Python 3.6, Python 3.7 -Python 3.4

___
Python tracker 

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



[issue20891] PyGILState_Ensure on non-Python thread causes fatal error

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:

> Is this fix released? I can't find it in the changelog…

Oops, I lost track of this issue, but it wasn't fixed, no.

I just proposed my old fix as a pull requets: PR 4650.

> (I faced this bug on 3.5.2, released a couple of months after this bug was 
> closed…)

The workaround is to call PyEval_InitThreads() before spawning your first 
non-Python thread.
https://docs.python.org/dev/c-api/init.html#c.PyEval_InitThreads

--

___
Python tracker 

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



[issue20891] PyGILState_Ensure on non-Python thread causes fatal error

2017-11-30 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset bc8ac6b00efcb3c601224b73f64071281f434bcd by Victor Stinner in 
branch 'master':
bpo-32030: Fix _Py_InitializeEx_Private() (#4649)
https://github.com/python/cpython/commit/bc8ac6b00efcb3c601224b73f64071281f434bcd


--

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-11-30 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4561

___
Python tracker 

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



[issue27931] Email parse IndexError <""@wiarcom.com>

2017-11-30 Thread Константин Волков

Константин Волков  added the comment:

ping

--

___
Python tracker 

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



[issue25394] CoroWrapper breaks gen.throw

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:

Sadly, Python 3.5 doesn't accept bugfixes anymore (only security fixes), so I 
close this issue.

Happy to read that a bug was fixed in Python 3.6 ;-)

FYI the fix was copied from the GitHub asyncio project to CPython in the commit 
e3c65a7a228a5808a7af48a47fdd77e982f95d00.

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



[issue32151] -mvenv vs minor python version updates

2017-11-30 Thread Ric Anderson

Ric Anderson  added the comment:

Okay, are virtual env's expected to not be compatible as well?  

E.g., I built a venv under 3.5; venv copied in the 3.5 python executable, but 
not the needed library; should not -mvenv also copy libpython3.5 into the 
virutal setup or at least include the LD_LIBRARY_PATH to libpython3.5 in 
bin/activate, so that myenv/bin/python3.5 can find its needed library?

--

___
Python tracker 

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



[issue32182] Infinite recursion in email.message.as_string()

2017-11-30 Thread R. David Murray

R. David Murray  added the comment:

This is almost certainly either a duplicate or will be fixed by a PR I have 
pending, that I don't have time to look for right now, that rewrites the 
folder.  I'll try to get to merging that PR soonish, but it might not happen 
before the holidays ;)

--

___
Python tracker 

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



[issue32144] email.policy.SMTP and SMTPUTF8 doesn't honor linesep's value

2017-11-30 Thread R. David Murray

R. David Murray  added the comment:

A note would be too heavy handed.  And get_content is a different function from 
get_payload, so there is no change in behavior, there is a new API with a more 
consistent behavior.  Basically, Python programs in general use \n line endings 
internally, and email was an exception to that rule (and is no longer, in the 
new API).  (There's a now closed issue about this somewhere in the tracker.)

--

___
Python tracker 

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



[issue25394] CoroWrapper breaks gen.throw

2017-11-30 Thread Mike Nerone

Mike Nerone  added the comment:

This was fixed in Python 3.6. See https://github.com/python/asyncio/issues/429

--
nosy: +Manganeez

___
Python tracker 

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



[issue16487] Allow ssl certificates to be specified from memory rather than files.

2017-11-30 Thread Martin Richard

Martin Richard  added the comment:

FWIW, PyOpenSSL allows to load certificates and keys from a memory buffer and 
much more. It's also fairly easy to switch from ssl to PyOpenSSL.

It's probably a viable alternative in many cases.

--

___
Python tracker 

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



[issue32183] Coverity: CID 1423264: Insecure data handling (TAINTED_SCALAR)

2017-11-30 Thread Christian Heimes

Change by Christian Heimes :


--
assignee:  -> christian.heimes
stage:  -> needs patch

___
Python tracker 

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



[issue32183] Coverity: CID 1423264: Insecure data handling (TAINTED_SCALAR)

2017-11-30 Thread STINNER Victor

New submission from STINNER Victor :

I got a new report from Coverity: CID 1423264: Insecure data handling  
(TAINTED_SCALAR)



** CID 1423265:  Insecure data handling  (TAINTED_SCALAR)
/Modules/main.c: 1393 in pymain_get_env_var_dup()



*** CID 1423265:  Insecure data handling  (TAINTED_SCALAR)
/Modules/main.c: 1393 in pymain_get_env_var_dup()
1387 if (!var || var[0] == '\0') {
1388 *dest = NULL;
1389 return 0;
1390 }
1391
1392 size_t len;
>>> CID 1423265:  Insecure data handling  (TAINTED_SCALAR)
>>> Passing tainted variable "var" to a tainted sink. [Note: The source 
>>> code implementation of the function has been overridden by a user model.]
1393 wchar_t *wvar = Py_DecodeLocale(var, );
1394 if (!wvar) {
1395 if (len == (size_t)-2) {
1396 /* don't set pymain->err */
1397 return -2;
1398 }

** CID 1423264:  Insecure data handling  (TAINTED_SCALAR)
/Modules/getpath.c: 909 in calculate_init()



*** CID 1423264:  Insecure data handling  (TAINTED_SCALAR)
/Modules/getpath.c: 909 in calculate_init()
903 return err;
904 }
905
906 size_t len;
907 char *path = getenv("PATH");
908 if (path) {
>>> CID 1423264:  Insecure data handling  (TAINTED_SCALAR)
>>> Passing tainted variable "path" to a tainted sink. [Note: The source 
>>> code implementation of the function has been overridden by a user model.]
909 calculate->path_env = Py_DecodeLocale(path, );
910 if (!calculate->path_env) {
911 return DECODE_FAILED("PATH environment variable", len);
912 }
913 }
914


Christian Heimes told me on IRC that Coverity "thinks that all values from 
getenv are bad". Ok.

__coverity_tainted_data_sink__() is supposed to say that we sanitized data, and 
this is what Py_DecodeLocale() model does:

wchar_t *Py_DecodeLocale(const char* arg, size_t *size)
{
   wchar_t *w;
__coverity_tainted_data_sink__(arg);
__coverity_tainted_data_sink__(size);
   return w;
}


I refactored recently Modules/main.c, Modules/getpath.c and PC/getpathp.c code, 
but the code isn't really new, I mostly "moved" code. Maybe these warnings were 
simply ignored previously?

--
components: Interpreter Core
messages: 307321
nosy: christian.heimes, vstinner
priority: normal
severity: normal
status: open
title: Coverity: CID 1423264:  Insecure data handling  (TAINTED_SCALAR)
type: security
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



[issue16487] Allow ssl certificates to be specified from memory rather than files.

2017-11-30 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

OP here, lurking.
The need to load server certificates from memory is quite real. Some seven
years ago I wrote custom code to handle that for CCPs python branch, and
contributed patches to that effect.
It's always dismaying to see how peoples efforts get bogged down by one
thing or another.  So, now there is a pep that prohibits this change?  Fun
times.

2017-11-30 12:03 GMT+00:00 Christian Heimes :

>
> Christian Heimes  added the comment:
>
> I'm working on a PEP that builds on top of PEP 543 and addresses some
> issues like IDNA #28414, OpenSSL/LibreSSL compatibility, hostname
> verification, verification chain, and TLS 1.3. As part of the PEP
> implementation, I'll add a certificate class.
>
> I don't to introduce yet another way to load a certificate. The C code is
> already complicated enough.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue32142] heapq.heappop - documentation misleading or doesn't work

2017-11-30 Thread R. David Murray

R. David Murray  added the comment:

I would suggested following the statement "To create a heap, use a list 
initialized to [], or you can transform a populated list into a heap via 
function heapify()." with "Any mutation of the list thereafter must maintain 
the heap invariant in order for the list to remain a heap."

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



[issue31851] test_subprocess hangs randomly on Windows with Python 3.x

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:

Bug occurred on AMD64 Windows8.1 Refleaks 3.6:

http://buildbot.python.org/all/#/builders/64/builds/52

...
running: test_subprocess (134462 sec)
running: test_subprocess (134492 sec)
running: test_subprocess (134522 sec)
running: test_subprocess (134552 sec)
running: test_subprocess (134582 sec)
running: test_subprocess (134612 sec)
running: test_subprocess (134642 sec)
program finished with exit code 1

--

___
Python tracker 

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



[issue27606] Android cross-built for armv5te with clang and '-mthumb' crashes with SIGSEGV or SIGILL

2017-11-30 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

ARMV5TE is deprecated in NDK r16 and will be removed in r17.
See https://developer.android.com/ndk/guides/abis.html
Closing as won't fix.

--
resolution:  -> wont fix
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



[issue31705] test_sha256 from test_socket fails on ppc64le arch

2017-11-30 Thread Charalampos Stratakis

Charalampos Stratakis  added the comment:

Thanks for the fix Victor!

--

___
Python tracker 

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



[issue32175] Add hash auto-randomization

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:

It was decided to leave the hash randomization disabled by default for backward 
compatibility. It's a deliberate choice.

I don't think that we need to go further for Python 2.7. I never considered 
this denial of service attach as major, there are many other ways to trigger a 
DoS, and fixing the dict type is not the right way to prevent this class of 
attacks.

HTTP clients and frameworks like http.client and Django implemented other 
countermeasures like limiting the number of HTTP headers.

The problem was correctly fixed in Python 3: randomization enabled by default 
since Python 3.3, and Python 3.4 now uses SipHash which better hides the hash 
secret.

More info at:
* http://python-security.readthedocs.io/vuln/cve-2012-1150_hash_dos.html
* 
http://python-security.readthedocs.io/vuln/cve-2013-7040_hash_not_properly_randomized.html

--

___
Python tracker 

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



[issue32180] bool() vs len() > 0 on lists

2017-11-30 Thread Дилян Палаузов

Дилян Палаузов  added the comment:

Is the speedup a matter of adding "__bool__" to list_methods in 
object/listobject.c?

In any case, I am not in the internals of cpython, so that I am not going to 
provide a patch.

With PyObject_Bool I meant PyObject_IsTrue.

--

___
Python tracker 

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



[issue31705] test_sha256 from test_socket fails on ppc64le arch

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:

"And this issue occurs not only ppc64le but also x86_64. (...) I think that 
this issue does not depend on arch."

Thanks for the confirmation. This is what I understood from the Red Hat report, 
but also the kernel bugfix.

test_sha256() is now skipped on all architectures on kernel < 4.5.

Thank you for the bug report Charalampos Stratakis! Sorry for the delay, I 
wasn't sure how to fix it. I didn't know which kernels were impacted, which 
architectures, and if it was a Python or a kernel bug. (It's definitively a 
kernel bug.)

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



[issue32180] bool() vs len() > 0 on lists

2017-11-30 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I don't know what should mean PyObject_Bool(), but in C code you should use 
PyObject_IsTrue() for getting the boolean value of the object.

--

___
Python tracker 

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



[issue31705] test_sha256 from test_socket fails on ppc64le arch

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 92a2c07b71aefc01f84ba4b0eda8e2a45c1a6b65 by Victor Stinner (Miss 
Islington (bot)) in branch '3.6':
Skip test_socket.test_sha256() on linux < 4.5 (GH-4643) (#4645)
https://github.com/python/cpython/commit/92a2c07b71aefc01f84ba4b0eda8e2a45c1a6b65


--

___
Python tracker 

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



[issue32180] bool() vs len() > 0 on lists

2017-11-30 Thread Дилян Палаузов

Дилян Палаузов  added the comment:

Under these circumstances 
https://wiki.python.org/moin/PythonSpeed/PerformanceTips shall be updated to 
state that 

"len('a list') > 0" is slower than "True if 'a list' else False"

--

___
Python tracker 

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



[issue31705] test_sha256 from test_socket fails on ppc64le arch

2017-11-30 Thread Fomalhaut Weisszwerg

Fomalhaut Weisszwerg  added the comment:

STINNER Victor

Thank you for your info.

And this issue occurs not only ppc64le but also x86_64.
`uname -a` on my CentOS returns following:

Linux localhost.localdomain 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 
20:32:50 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

I think that this issue does not depend on arch.

--

___
Python tracker 

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



[issue32180] bool() vs len() > 0 on lists

2017-11-30 Thread Дилян Палаузов

Дилян Палаузов  added the comment:

To my understanding this optimization (bool([]) faster than len([])) cannot be 
made until PyObject_Bool is introduced, similar to PyObject_Repr and 
PyObject_Length.

Am I not going to provide a patch.

--
status: pending -> open

___
Python tracker 

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



[issue32181] runaway Tasks with Task.cancel() ignored.

2017-11-30 Thread Oleg K

New submission from Oleg K :

(tested in VM and in real linux)

there is an issue with Task, in some cases task will ignore cancellation and 
will keep running for a while.

there is some explanation needed regarding the python_task_cancel.py example.

1)there is a async Integer Generator (my_generator) it has sleep() inside, and 
produces integers.

2)there is  async coro test(), which is consumer of integers , it has several
while True:
consume = yield

3) there are tasks "a_task()", the job task is doing: it reads from generator, 
and pushes integer to active "async coro test()"

my_generator -iterated by->  a_task() -sends Int to-> test()


4) "async coro test()" is protected by lock, so only one task may push value to 
it at a time. 

5) "task_context" is a context manager, a helper which starts tasks and cancels 
them 

__aenter__ -> loop.create_task(self.task)
__aexit__ -> self.running_task.cancel()



here is how is it used

async with task_context( async-coro-to-be-started-as-a-task ):
# task is created 
while True:
consume = yield
if consume > 10 :break
# task is CANCELLED  


--


The Case:   


the issue is there when there is sequential aenters and aexits 


async with task_context( async-coro-to-be-started-as-a-task ):
# task #1 is created 
while True:
consume = yield
if consume > 10 :break
# task #1 is CANCELLED   


async with task_context( async-coro-to-be-started-as-a-task ):
# task #2 is created 
while True:
consume = yield
if consume > 20 :break
# task #2 is CANCELLED   


async with task_context( async-coro-to-be-started-as-a-task ):
# task #3 is created 
while True:
consume = yield
if consume > 10 :break
# task #3 is CANCELLED   



what may go wrong here? - at the end there will be 3 live task reading from 
same generator!
2 tasks have clearly got cancel() call but, according to output they still 
there and working:

there is part of output as a proof:

my_generator: [0.3] PRODUCE VALUE 28
send done: 20 task id= 1
will send : 28 task id= 4
consume 3  28
my_generator: [0.3] PRODUCE VALUE 29
send done: 28 task id= 4
will send : 29 task id= 2
consume 3  29
send done: 29 task id= 2
my_generator: [0.4] PRODUCE VALUE 21
will send : 21 task id= 1
consume 3  21
send done: 21 task id= 1
my_generator: [0.3] PRODUCE VALUE 30
will send : 30 task id= 3
consume 3  30
send done: 30 task id= 3
my_generator: [0.3] PRODUCE VALUE 31
will send : 31 task id= 3


"task id= 3"
"task id= 2"
"task id= 4" 

that means that all tasks are there!, which should not happen. 
but, these tasks WILL GET cancellation call execute just after "async coro 
test()" will exit, that exit somehow  will trigger pending exit of tasks, which 
should have happened long ago!.


also, there is no reliable way to wait task termination, which is also major 
issue with real life asyncio usage,
i need to have a mean to wait for task to complete wait until its "finally:" is 
done and all resources are free.

--
components: asyncio
files: python_task_cancel.py
messages: 307307
nosy: Oleg K2, yselivanov
priority: normal
severity: normal
status: open
title: runaway Tasks with Task.cancel() ignored.
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47307/python_task_cancel.py

___
Python tracker 

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



[issue32166] Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:

> Thank you Andrew! This have made the code cleaner.

Yeah! I really love to see old these old crappy legacy stuff to go away. The 
asyncio code behave shorter, simpler and with less "#ifdef" ;-)

I understand that the Python language and stdlib became better the last 2-3 
years ;-)

--

___
Python tracker 

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



[issue31705] test_sha256 from test_socket fails on ppc64le arch

2017-11-30 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4560

___
Python tracker 

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



[issue31705] test_sha256 from test_socket fails on ppc64le arch

2017-11-30 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 86afc1f2a7fb3afe00779c6426bc141bc795d9a3 by Victor Stinner in 
branch 'master':
Skip test_socket.test_sha256() on linux < 4.5 (#4643)
https://github.com/python/cpython/commit/86afc1f2a7fb3afe00779c6426bc141bc795d9a3


--

___
Python tracker 

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



[issue27172] Undeprecate inspect.getfullargspec()

2017-11-30 Thread Nick Coghlan

Nick Coghlan  added the comment:

I'll also note that one possible alternative would be to accept Ryan's original 
proposal, which was to make "skip_bound_arg=False" part of the public API for 
`inspect.Signature.from_callable`.

Keeping `getfullargspec` around (but discouraged for new code), seems nicer to 
me than doing that, though, since the *only* use case we're aware of for that 
behaviour toggle is to be able to emulate inspect.getfullargspec() atop 
inspect.Signature().

TOOWTDI simply doesn't strike me as a good enough reason to break working code 
in this case - there *is* an obvious way for new code (inspect.signature), and 
there are plenty of other standard library APIs that we keep around primarily 
for backwards compatibility reasons, even though we don't necessarily recommend 
using them any more.

--

___
Python tracker 

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



[issue27172] Undeprecate inspect.getfullargspec()

2017-11-30 Thread Nick Coghlan

Nick Coghlan  added the comment:

If there was a documented deprecation that said "Use  
instead", I'd be OK with that.

The part I wasn't OK with is multiple projects each copying & pasting their own 
variant of the getfullargspec code and accessing private inspect module APIs in 
order to get the old behaviour back.

So in order to move this to PyPI instead, we'd need to offer a completely 
public API that was equivalent to `_signature_from_callable(func, 
follow_wrapper_chains=False, skip_bound_arg=False, sigcls=Signature)`

`inspect.Signature.from_callable(func, follow_wrapped=False)` comes very close, 
but misses a subtlety where "getfullargspec" will mention "self" for bound 
methods, even though it's implicitly supplied, and doesn't need to be supplied 
by the caller.

That aspect could potentially just be deprecated outright though, with the PyPI 
replacement following inspect.signature's behaviour and reporting the actual 
call signature of the bound method.

--

___
Python tracker 

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



[issue32166] Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events

2017-11-30 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

You are welcome!
Thanks for review

--

___
Python tracker 

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



[issue32180] bool() vs len() > 0 on lists

2017-11-30 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The cause of len() been faster than bool() is the same as why repr() is faster 
than str(). [1] len() and repr() are functions that just call corresponding 
slots, while bool() and str() are constructors.

In most cases you shouldn't use `bool(obj)` or `len(obj) > 0`. Instead use just 
`obj` in conditions.

If you can provide a patch that speeds up constructions of simple class 
instances, please open a pull request on GitHub. Otherwise this issue will be 
closed.

[1] 
https://stackoverflow.com/questions/45376719/why-is-reprint-faster-than-strint

--
nosy: +serhiy.storchaka
status: open -> pending
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue16487] Allow ssl certificates to be specified from memory rather than files.

2017-11-30 Thread Christian Heimes

Christian Heimes  added the comment:

I'm working on a PEP that builds on top of PEP 543 and addresses some issues 
like IDNA #28414, OpenSSL/LibreSSL compatibility, hostname verification, 
verification chain, and TLS 1.3. As part of the PEP implementation, I'll add a 
certificate class.

I don't to introduce yet another way to load a certificate. The C code is 
already complicated enough.

--

___
Python tracker 

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



[issue16487] Allow ssl certificates to be specified from memory rather than files.

2017-11-30 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Christian, what is the status of PEP 543? Is someone actively working on it?  
Should we hope for a resolution (i.e. an implementation accepted in the stdlib) 
in the near future?

I'm worried about such purity arguments.  It reminds me of when we decided to 
freeze distutils because distutils2 was to become the future (and then distlib 
took that place, etc.).  In the end "the future" hasn't really happened and 
distutils has rotten without a clear path forward for users (except the 
venerable setuptools, which has its own issues).

--

___
Python tracker 

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



[issue32166] Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events

2017-11-30 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thank you Andrew! This have made the code cleaner.

--

___
Python tracker 

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



[issue16487] Allow ssl certificates to be specified from memory rather than files.

2017-11-30 Thread Christian Heimes

Christian Heimes  added the comment:

I'm -1 on the patch. Any new feature and API shall follow 
https://www.python.org/dev/peps/pep-0543/. I have some code that adds a proper 
Certificate class that wraps OpenSSL's X509* type.

--

___
Python tracker 

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



[issue32175] Add hash auto-randomization

2017-11-30 Thread Christian Heimes

Christian Heimes  added the comment:

Raymond, dicts are your area of expertise.

I'm -0 on the patch. The check is going to slow down dicts and it's really easy 
to enable randomization with an env var or command line argument.

--
assignee:  -> rhettinger
nosy: +christian.heimes, rhettinger, vstinner

___
Python tracker 

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



[issue32166] Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events

2017-11-30 Thread Andrew Svetlov

Change by Andrew Svetlov :


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



[issue32180] bool() vs len() > 0 on lists

2017-11-30 Thread Дилян Палаузов

New submission from Дилян Палаузов :

Please make bool() on lists at least as fast as len() > 0 on lists is.

The trivial approach would be to define __bool__ on lists, that do something 
like  "True if self else False".

python3 
Python 3.6.3+ (heads/3.6-dirty:2b5cbbb13c, Nov  1 2017, 19:03:09) 
[GCC 6.4.1 20171025] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import timeit
>>> timeit.timeit('len([]) > 0')
0.0983404889702797
>>> timeit.timeit('bool([])')
0.15502946823835373
>>> timeit.timeit('True if [] else False')
0.03108721226453781
>>> timeit.timeit('len([1]) > 0')
0.11656427383422852
>>> timeit.timeit('bool([1])')
0.19317257404327393
>>> timeit.timeit('True if [1] else False')
0.057590410113334656

--
messages: 307294
nosy: dilyan.palauzov
priority: normal
severity: normal
status: open
title: bool() vs len() > 0 on lists
type: performance
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



[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError

2017-11-30 Thread Massimiliano Torromeo

Massimiliano Torromeo  added the comment:

Disregard my last message, I posted it in the wrong bug report by mistake.
Sorry about the noise

--

___
Python tracker 

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



  1   2   >