[issue29965] MatchObject __getitem__() should support slicing and len

2017-04-03 Thread Xiang Zhang

Xiang Zhang added the comment:

See also #24454.

--
nosy: +serhiy.storchaka, xiang.zhang

___
Python tracker 

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



[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-03 Thread Dominic Mayers

Dominic Mayers added the comment:

The key point, IMHO, is that the BaseRequestHandler class is just provided as 
an option and its API (setup, handle and finish) is ignored by the code that we 
support. 

Some applications may have used the API, but these are details in applications. 
Simply, we keep BaseRequestHandler as it is so that we do not break these 
applications. 

So, yes, we should keep supporting the API, but we do not expect this API on 
our side. The latter is the key point.

--

___
Python tracker 

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



[issue19225] lack of PyExc_BufferError doc

2017-04-03 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +1146

___
Python tracker 

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



[issue19225] lack of PyExc_BufferError doc

2017-04-03 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +1147

___
Python tracker 

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



[issue29965] MatchObject __getitem__() should support slicing and len

2017-04-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This has already been discussed in other issues. Adding support of indexing 
opened a can of worms.

len() for match objects is ambiguous because of the group 0. Implementing len() 
will make the match object iterable, but in a way incompatible with issue9529 
(because of the group 0).

As for slicing and negative indexes, what is the use case? Do you know that you 
can get a tuple of groups by passing several arguments to group()? A regular 
expression usually has known set of groups, so you can just enumerate the 
indices (or better names) of needed groups (they can be not sequential).

--

___
Python tracker 

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



[issue29966] typing.get_type_hints doesn't really work for classes with ForwardRefs

2017-04-03 Thread Simon Percivall

New submission from Simon Percivall:

For classes with ForwardRef annotations, typing.get_type_hints is unusable.

As example, we have two files:

a.py:
class Base:
a: 'A'

class A:
pass

b.py:
from a import Base

class MyClass(Base):
b: 'B'

class B:
pass


>>> from typing import get_type_hints
>>> from b import MyClass
>>> get_type_hints(MyClass) #  NameError


What should globals/locals be here?

--
messages: 291058
nosy: simon.percivall
priority: normal
severity: normal
status: open
title: typing.get_type_hints doesn't really work for classes with ForwardRefs
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



[issue29967] "AMD64 FreeBSD 9.x 3.x" tries to rebuild Include/opcode.h, timestamp issue

2017-04-03 Thread STINNER Victor

New submission from STINNER Victor:

"make buildbottest" on "AMD64 FreeBSD 9.x 3.x" fails with:
---
Cannot generate ./Include/opcode.h, python not found !
To skip re-generation of ./Include/opcode.h run  or .
Otherwise, set python in PATH and run configure or run .
*** [./Include/opcode.h] Error code 1
---
http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.x/builds/123/steps/test/logs/stdio

Python has a "make touch" command which uses "hg --config 
extensions.touch=Tools/hg/hgtouch.py touch -v", but CPython moved to Git.

--
components: Build
messages: 291059
nosy: haypo, koobs, zach.ware
priority: normal
severity: normal
status: open
title: "AMD64 FreeBSD 9.x 3.x" tries to rebuild Include/opcode.h, timestamp 
issue
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



[issue29967] "AMD64 FreeBSD 9.x 3.x" tries to rebuild Include/opcode.h, timestamp issue

2017-04-03 Thread STINNER Victor

STINNER Victor added the comment:

See issue #23404: "'make touch' does not work with git clones of the source 
repository".

--

___
Python tracker 

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



[issue29966] typing.get_type_hints doesn't really work for classes with ForwardRefs

2017-04-03 Thread Jim Fasarakis-Hilliard

Changes by Jim Fasarakis-Hilliard :


--
components: +Library (Lib)
type:  -> behavior

___
Python tracker 

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



[issue29967] "AMD64 FreeBSD 9.x 3.x" tries to rebuild Include/opcode.h, timestamp issue

2017-04-03 Thread STINNER Victor

STINNER Victor added the comment:

According to koobs, the buildbot slave has "python2" and "python2.7" commands, 
but no "python".

See issue #26662 for my previous complain on "python": Python build system 
should use "python2" or "python3", not "python".

--

___
Python tracker 

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



[issue29925] test_uuid fails on OS X Tiger

2017-04-03 Thread STINNER Victor

STINNER Victor added the comment:

Ping. Buildbot is still failing.

--

___
Python tracker 

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



[issue27838] test_os.test_chown() failure on koobs-freebsd-{current, 9}

2017-04-03 Thread STINNER Victor

STINNER Victor added the comment:

Similar (or same?) failure on "x86 Gentoo Non-Debug with X 3.x":

==
ERROR: test_chown (test.test_os.ChownFileTests)
--
Traceback (most recent call last):
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_os.py", 
line 1218, in test_chown
os.chown(support.TESTFN, uid, gid_1)
PermissionError: [Errno 1] Operation not permitted: '@test_19914_tmp'

http://buildbot.python.org/all/builders/x86%20Gentoo%20Non-Debug%20with%20X%203.x/builds/542/steps/test/logs/stdio

--

___
Python tracker 

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



[issue29925] test_uuid fails on OS X Tiger

2017-04-03 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +1148

___
Python tracker 

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



[issue29925] test_uuid fails on OS X Tiger

2017-04-03 Thread STINNER Victor

STINNER Victor added the comment:

I proposed the most obvious fix: skip the test on OS X Tiger, see attached PR.

--

___
Python tracker 

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



[issue29851] Have importlib.reload() raise ImportError when a spec can't be found

2017-04-03 Thread Garvit Khatri

Changes by Garvit Khatri :


--
pull_requests: +1149

___
Python tracker 

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



[issue28087] macOS 12 poll syscall returns prematurely

2017-04-03 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +1150

___
Python tracker 

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



[issue28087] macOS 12 poll syscall returns prematurely

2017-04-03 Thread STINNER Victor

STINNER Victor added the comment:

test_asyncore also fails on Python 2.7 on macOS Sierra. So I proposed a 
backport: see my PR 973.

==
FAIL: test_handle_expt (test.test_asyncore.TestAPI_UsePoll)
--
Traceback (most recent call last):
  File 
"/Users/buildbot/buildarea/2.7.billenstein-sierra/build/Lib/test/test_asyncore.py",
 line 620, in test_handle_expt
self.loop_waiting_for_flag(client)
  File 
"/Users/buildbot/buildarea/2.7.billenstein-sierra/build/Lib/test/test_asyncore.py",
 line 519, in loop_waiting_for_flag
self.fail("flag not set")
AssertionError: flag not set

http://buildbot.python.org/all/builders/x86-64%20Sierra%202.7/builds/2/steps/test/logs/stdio

--
nosy: +haypo

___
Python tracker 

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



[issue5672] Implement a way to change the python process name

2017-04-03 Thread Patrick van der Leer

Changes by Patrick van der Leer :


--
nosy: +Patrick van der Leer

___
Python tracker 

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



[issue29967] "AMD64 FreeBSD 9.x 3.x" tries to rebuild Include/opcode.h, timestamp issue

2017-04-03 Thread Martin Panter

Martin Panter added the comment:

I think this is the same underlying problem as Issue 23404. Either we get “make 
touch” working without Mercurial, or we use some other mechanism to either 
disable regeneration by default (my preference), or disable regeneration by 
explicit request (possible compromise with Nick who liked the automatic 
regeneration because it saved him remembering other commands: 
).

--
nosy: +martin.panter

___
Python tracker 

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



[issue29968] Document that no characters are allowed to proceed \ in explicit line joining

2017-04-03 Thread Jim Fasarakis-Hilliard

New submission from Jim Fasarakis-Hilliard:

After looking through the code, the tokenizer only allows a new line character 
to proceed `\` in explicit line joining [1].

The Devguide section on it [2] actually states many of the limitations of using 
`\` but not directly that nothing is allowed after it (it does have a remark on 
comments). 

Would it be a good idea to amend it to state that no characters are allowed 
after `\`?

[1]: 
https://github.com/python/cpython/blob/734125938d4653459593ebd28a0aec086efb1f27/Parser/tokenizer.c#L1847
[2]: 
https://docs.python.org/3/reference/lexical_analysis.html#explicit-line-joining

--
assignee: docs@python
components: Documentation
messages: 291067
nosy: Jim Fasarakis-Hilliard, docs@python
priority: normal
severity: normal
status: open
title: Document that no characters are allowed to proceed \ in explicit line 
joining

___
Python tracker 

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



[issue29968] Document that no characters are allowed to proceed \ in explicit line joining

2017-04-03 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

Alternatively, stripping all white-space that proceed `\` could be considered 
if it seems like a good idea.

--

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2017-04-03 Thread Martin Panter

Martin Panter added the comment:

I had mainly been using my boot-flag.patch with BSD Make (bmake) rather than 
Gnu Make. It seems I was relying on a bug in BSD Make that merges escaped 
newlines in command lines, despite Posix and Gnu Make. Anyway, Chi’s fix seems 
appropriate.

I am posting the patches I used for 3.5 and 2.7, in case others are interested. 
The 3.5 one would also need Chi’s fix merging the “_freeze_importlib” line.

It may be possible to have the configure script adjust the default for the BOOT 
flag rather than setting GENERATED_COMMENT. But the side effect would be 
disabling regeneration of additional things (e.g. that aren’t specifically 
broken with cross compilation.

Anyway my preference was to stop automatically regenerating files, and to keep 
the build system as simple as practical without hacks like the BOOT="#" flag.

--
Added file: http://bugs.python.org/file46772/boot-flag.py3.5.patch

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2017-04-03 Thread Martin Panter

Changes by Martin Panter :


Added file: http://bugs.python.org/file46773/boot-flag.py2.patch

___
Python tracker 

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



[issue29969] Typo in decimal error message

2017-04-03 Thread Angus Hollands

New submission from Angus Hollands:

When passing an object that fails Py_FloatCheck, the error message raised reads
"argument must be int of float", rather than "argument must be int or float"

--
components: Extension Modules
messages: 291070
nosy: Angus Hollands
priority: normal
severity: normal
status: open
title: Typo in decimal error message
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue29969] Typo in decimal error message

2017-04-03 Thread Angus Hollands

Changes by Angus Hollands :


--
pull_requests: +1151

___
Python tracker 

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



[issue29970] Severe open file leakage running asyncio SSL server

2017-04-03 Thread kyuupichan

New submission from kyuupichan:

Original report at old repo here:  https://github.com/python/asyncio/issues/483

There this is reported fixed by https://github.com/python/cpython/pull/480

I wish to report that whilst the above patch might have a small positive 
effect, it is far from solving the actual issue.  Several users report eventual 
exhaustion of the open file resource running SSL asyncio servers.

Here are graphs provided by a friend running my ElectrumX server software, 
first accepting SSL connections and the second accepting TCP connections only.  
Both of the servers were monkey-patched with the pull-480 fix above, so this is 
evidence it isn't solving the issue.

http://imgur.com/a/cWnSu

As you can see, the TCP server (which has far less connections; most users use 
SSL) has no leaked file handles, whereas the SSL server has over 300.

This becomes an easy denial of service vector against asyncio servers.  One way 
to trigger this (though I doubt it explains the numbers above) is simply to 
connect to the SSL server from telnet, and do nothing.  asyncio doesn't time 
you out, the telnet session seems to sit there forever, and the open file 
resources are lost in the SSL handshake stage until the remote host kindly 
decides to disconnect.

I suspect these resource issues all revolve around the SSL handshake process, 
certainly at the opening of a connection, but also perhaps when closing.

As the application author I am not informed by asyncio of a potential 
connection until the initial handshake is complete, so I cannot do anything to 
close these phantom socket connections.  I have to rely on asyncio to be 
properly handling DoS issues and it is not currently doing so robustly.

--
components: asyncio
messages: 291071
nosy: kyuupichan, yselivanov
priority: normal
severity: normal
status: open
title: Severe open file leakage running asyncio SSL server
type: resource usage
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



[issue29971] Lock.acquire() not interruptible on Windows

2017-04-03 Thread Antoine Pitrou

New submission from Antoine Pitrou:

On Windows, Lock.acquire() (and other synchronization primitives derived from 
it, such as queue.Queue) cannot be interrupted with Ctrl-C, which makes it 
difficult to interrupt a process waiting on such a primitive.

Judging by the code in Python/_thread_nt.h, it should be relatively easy to add 
such support for the "legacy" semaphore-based implementation (by using 
WaitForMultipleObjects instead of WaitForSingleObject), but it would be much 
hairier for the new condition variable-based implementation.

Of course, many other library calls are prone to this limitation (not being 
interruptible with Ctrl-C on Windows).

See https://github.com/dask/dask/pull/2144#issuecomment-290556996 for original 
report.

--
components: Library (Lib), Windows
messages: 291072
nosy: kristjan.jonsson, paul.moore, pitrou, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Lock.acquire() not interruptible on Windows
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue29972] Skip tests known to fail on AIX

2017-04-03 Thread STINNER Victor

New submission from STINNER Victor:

Extract of David Edelsohn's email:
"""
The testsuite failures on AIX are issues with the AIX kernel and C
Library, often corner cases.  I don't want to get into arguments about
the POSIX standard.  Some of the issues are actual conformance issues
and some are different interpretations of the standard.  Addressing
the problems in AIX is a slow process. If the failing testcases are
too annoying, I would recommend to skip the testcases.

Despite the testsuite failures, Python builds and runs on AIX for the
vast majority of users and applications.  I don't see the benefit in
dropping support for a platform that functions because it doesn't
fully pass the testsuite.
"""
ref: https://mail.python.org/pipermail/python-dev/2017-April/147748.html

I agree, so let's skip tests known to fail on AIX!

--
components: Tests
messages: 291073
nosy: haypo
priority: normal
severity: normal
status: open
title: Skip tests known to fail on AIX
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



[issue29972] Skip tests known to fail on AIX

2017-04-03 Thread Eric N. Vander Weele

Changes by Eric N. Vander Weele :


--
nosy: +ericvw

___
Python tracker 

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



[issue29972] Skip tests known to fail on AIX

2017-04-03 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +1152

___
Python tracker 

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



[issue29972] Skip tests known to fail on AIX

2017-04-03 Thread STINNER Victor

STINNER Victor added the comment:

See also https://github.com/python/cpython/pull/978 which should fix one unit 
test of test_ssl.

--

___
Python tracker 

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



[issue29973] Travis CI docs broken: UnboundLocalError: local variable 'prefix' referenced before assignment

2017-04-03 Thread STINNER Victor

New submission from STINNER Victor:

https://travis-ci.org/python/cpython/jobs/218107336

CPython: master branch
Sphinx 1.5.4

make[1]: Entering directory `/home/travis/build/python/cpython/Doc'
./venv/bin/python -m sphinx -b suspicious -d build/doctrees -D 
latex_elements.papersize= -q -W . build/suspicious 

Exception occurred:
  File 
"/home/travis/virtualenv/python3.6.0/lib/python3.6/site-packages/sphinx/domains/python.py",
 line 317, in before_content
if prefix:
UnboundLocalError: local variable 'prefix' referenced before assignment

--
assignee: docs@python
components: Documentation, Tests
messages: 291075
nosy: docs@python, haypo
priority: normal
severity: normal
status: open
title: Travis CI docs broken: UnboundLocalError: local variable 'prefix' 
referenced before assignment
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



[issue29973] Travis CI docs broken: UnboundLocalError: local variable 'prefix' referenced before assignment

2017-04-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This already is fixed in mainstream. 
https://github.com/sphinx-doc/sphinx/issues/3597

Sphinx 1.5.5 will be released soon. 
https://github.com/sphinx-doc/sphinx/issues/3598

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29973] Travis CI docs broken: UnboundLocalError: local variable 'prefix' referenced before assignment

2017-04-03 Thread STINNER Victor

STINNER Victor added the comment:

https://pypi.org/project/Sphinx/1.5.5/ has been released. How can I schedule a 
recheck on Travis CI on PRs where the docs job failed?

--

___
Python tracker 

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



[issue28087] macOS 12 poll syscall returns prematurely

2017-04-03 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 23d6eb656ec29140fcca1c9261b7953e2312b171 by Victor Stinner in 
branch '2.7':
bpo-28087: Skip test_asyncore and test_eintr poll failures on macOS. (#462) 
(#973)
https://github.com/python/cpython/commit/23d6eb656ec29140fcca1c9261b7953e2312b171


--

___
Python tracker 

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



[issue29973] Travis CI docs broken: UnboundLocalError: local variable 'prefix' referenced before assignment

2017-04-03 Thread STINNER Victor

STINNER Victor added the comment:

Oh, Zachary Were "restarted the docs job on most of the blocked PRs". So I 
close this issue.

That one was hopefully quickly fixed :-)

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



[issue29969] Typo in decimal error message

2017-04-03 Thread Stefan Krah

Stefan Krah added the comment:

Merged, thank you.

--
assignee:  -> skrah
nosy: +skrah
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



[issue29851] Have importlib.reload() raise ImportError when a spec can't be found

2017-04-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Wouldn't ModuleNotFoundError be more appropriate?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29941] Confusion between asserts and Py_DEBUG

2017-04-03 Thread Thomas Wouters

Changes by Thomas Wouters :


--
pull_requests: +1153

___
Python tracker 

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



[issue28087] macOS 12 poll syscall returns prematurely

2017-04-03 Thread STINNER Victor

STINNER Victor added the comment:

Ah! Python 2.7 tests succeeded on Sierra!

http://buildbot.python.org/all/builders/x86-64%20Sierra%202.7/builds/3

--

___
Python tracker 

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



[issue29971] Lock.acquire() not interruptible on Windows

2017-04-03 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
nosy: +josh.r

___
Python tracker 

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



[issue29406] asyncio SSL contexts leak sockets after calling close with certain Apache servers

2017-04-03 Thread Michael Sghaier

Changes by Michael Sghaier :


--
pull_requests: +1154

___
Python tracker 

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



[issue29941] Confusion between asserts and Py_DEBUG

2017-04-03 Thread Thomas Wouters

Thomas Wouters added the comment:

PR #980 adds a configure flag (--with-assertions), defaulting to the old 
behaviour (no assertions by default, except when --with-pydebug is passed). I 
would like to backport that to (at least) 3.6 so that we can set up a buildbot 
with it, to prevent regressions. Opinions on that?

--

___
Python tracker 

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



[issue29965] MatchObject __getitem__() should support slicing and len

2017-04-03 Thread Eric V. Smith

Eric V. Smith added the comment:

Short of a compelling use case, I suggest we reject this enhancement request. 
len() was deliberately not added in #24454. It's not like any normal code would 
be iterating over match groups.

--
nosy: +eric.smith

___
Python tracker 

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



[issue29974] typing.TYPE_CHECKING doc example is incorrect

2017-04-03 Thread Mathias Rav

New submission from Mathias Rav:

The documentation of typing.TYPE_CHECKING has an example (introduced in issue 
#26141) that would lead to NameError at runtime. The example shows how to limit 
the import of "expensive_mod" to type checkers, but then goes on to use 
"expensive_mod.some_type" in a type annotation that is evaluated at runtime 
("local_var: expensive_mod.some_type"). The use case of TYPE_CHECKING is 
probably meant for type annotations placed in comments, e.g. "local_var  # 
type: expensive_mod.some_type".

--
assignee: docs@python
components: Documentation
messages: 291085
nosy: docs@python, rav
priority: normal
severity: normal
status: open
title: typing.TYPE_CHECKING doc example is incorrect
type: enhancement
versions: 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



[issue29974] typing.TYPE_CHECKING doc example is incorrect

2017-04-03 Thread Mathias Rav

Changes by Mathias Rav :


--
pull_requests: +1155

___
Python tracker 

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



[issue29964] %z directive has no effect on the output of time.strptime

2017-04-03 Thread R. David Murray

R. David Murray added the comment:

Yes, that's exactly right.  'time' is a low-level os-function wrapper, and 
inherits many of the deficiencies of the platform.  datetime attempts to be a 
more comprehensive, portable solution.  (But even it has its quirks...timezones 
are *hard*.)

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



[issue29965] MatchObject __getitem__() should support slicing and len

2017-04-03 Thread Michael Selik

Michael Selik added the comment:

Yesterday I wanted to do a destructuring bind on a slice of groups in a 
finditer. Similar situation to the use case of Issue #24454. It might not be 
"normal code" but I end up in that situation every month or so when parsing 
semi-structured documents. I found myself wishing for a mapping-destructuring 
bind, but that's another story.

I haven't read the full discussion of ``len`` on MatchObject yet, but I 
tentatively agree with Brandon Rhodes' comment in Issue #19536:

"My retort is that concentric groups can happen anyway:
that Group Zero, holding the entire match, is not really
as special as the newcomer might suspect, because you can
always wind up with groups inside of other groups; it is
simply part of the semantics of regular expressions that
groups might overlap or might contain one another ..."

@Serhiy, I was unaware of the feature of passing several arguments to groups. 
Unfortunately, the regex pattern I was using had a very large set of groups. A 
slice would have been particularly elegant. Passing several arguments to 
mo.groups() will be helpful, but still more awkward than a slice.

Perhaps it is a can of worms, but I was pleased to see indexing available and 
was disappointed not to find the typically supported corresponding features.

--

___
Python tracker 

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



[issue29965] MatchObject __getitem__() should support slicing and len

2017-04-03 Thread Michael Selik

Michael Selik added the comment:

Sorry, it looks like I got the issue number wrong. My comparison should not 
have been with #24454, but instead with an issue I can't locate at the moment. 
Reproducing the example:

for g0, g1, g2 in re.finditer(r'(\d+)/(\d+)', 'Is 1/3 the same as 2/6?'):
ratio = Fraction(int(g1), int(g2))

Better:

for mo in re.finditer(r'(\d+)/(\d+)', 'Is 1/3 the same as 2/6?'):
ratio = Fraction(*map(int, mo[1:3]))

The map in the last one isn't very pretty, but I hope it illustrates the gist 
of what I'd like to do for a much larger pattern with many capture groups.

--

___
Python tracker 

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



[issue29971] Lock.acquire() not interruptible on Windows

2017-04-03 Thread Eryk Sun

Eryk Sun added the comment:

>From the linked issue:

> proc.send_signal(CTRL_C_EVENT) raises the KeyboardInterrupt
> in both the original and subprocess on Windows

GenerateConsoleCtrlEvent takes process group IDs, so it should have been used 
to implement os.killpg, not os.kill. If you call it on a process ID that's 
attached to the console that isn't also a group ID (i.e. the group leader), 
then it defaults to group 0, which includes every process that's attached to 
the console. 

Popen.send_signal should only send CTRL_C_EVENT or CTRL_BREAK_EVENT when the 
child process was created with CREATE_NEW_PROCESS_GROUP in its creationflags. 
Also, since kill() falls back on TerminateProcess, for added safety send_signal 
also needs to call poll() instead of using returncode because Windows reuses 
process IDs. Also, to avoid confusion, it should be noted that CTRL_C_EVENT 
will be ignored by a process in a new group unless said process manually 
enables Ctrl+C handling by calling SetConsoleCtrlHandler(NULL, FALSE). This 
setting will be inherited by child processes.

In the long run I think it would be better to clarify this by implementing 
os.killpg on Windows using GenerateConsoleCtrlEvent, with support for 
CTRL_C_EVENT, CTRL_BREAK_EVENT, SIGINT, and SIGBREAK. Deprecate using os.kill 
to send console control events. There is no Windows API to send a console 
control event to a particular process ID.

--
nosy: +eryksun

___
Python tracker 

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



[issue29965] MatchObject __getitem__() should support slicing and len

2017-04-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

You can use mo.group(1, 2). If you need to slice arbitrary groups, you can 
slice the result of the groups() method (which is just a tuple).

The re module is already complex, and let use existing API rather than add the 
new one.

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



[issue29897] itertools.chain behaves strangly when copied with copy.copy

2017-04-03 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Perhaps all this deserves a PEP.

If Serhiy and Kristján are on a course of action, that will suffice.  Copying 
iterators is an esoteric endeavor of interest to very few users (no one has 
even noticed until now).

--

___
Python tracker 

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



[issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error

2017-04-03 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Can this be closed now?

--

___
Python tracker 

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



[issue29964] %z directive has no effect on the output of time.strptime

2017-04-03 Thread Brett Cannon

Brett Cannon added the comment:

There's actually a footnote pointing out that %z is not supported by all libc 
implementations: https://docs.python.org/3/library/time.html#id2. Probably 
adding a note for %z in the strftime() table would be good.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue29971] Lock.acquire() not interruptible on Windows

2017-04-03 Thread Eryk Sun

Eryk Sun added the comment:

Alternatively we could use the SleepEx and WaitFor*Ex functions with alertable 
waits (i.e. using APCs) instead of the SIGINT Event. This avoids having to 
replace all single-object waits with multiple-object waits, and would even 
allow calling SleepEx in pysleep. 

That said, issue 29871 proposes to switch to the condition variable and SRW 
lock implementation, so first it needs to be decided whether to continue to use 
kernel waits or switch to conditional variables. Or maybe refactor to use 
condition variables in performance-critical code and otherwise use kernel 
waits, if that makes sense.

An orthogonal improvement is to have the signal handler call 
CancelSynchronousIo. This would entail handling ERROR_OPERATION_ABORTED in 
_winapi Readfile, WriteFile, and WaitNamedPipe by calling PyErr_CheckSignals. 
Also in _Py_Read and _Py_Write, if errno is EINVAL and the last Windows error 
is ERROR_OPERATION_ABORTED, it could manually set errno to EINTR.

Winsock waits (e.g. select) will remain a problem in any case. Winsock uses 
alertable waits, so a queued user-mode APC will be executed while it's waiting. 
But then it just resumes its original wait instead of failing with WSAEINTR.

--

___
Python tracker 

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



[issue29968] Document that no characters are allowed to proceed \ in explicit line joining

2017-04-03 Thread R. David Murray

R. David Murray added the comment:

I think you meant "the language reference" rather than "the devguide".  The 
sentence about the comment is redundant with the preceding line that says that 
the thing that results in a join is a physical line that ends with a backslash 
("that is not part of..."), which is a definitive statement that no characters 
may follow it.

So, I don't see any doc bug here, unless we want to delete that redundant 
statement about the comment because it is confusing.  But I doubt we want to do 
that, as some people will think that a comment is "the same as there being 
nothing" (despite the statement about "physical line") which it is not.

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



[issue29968] Document that no characters are allowed to proceed \ in explicit line joining

2017-04-03 Thread R. David Murray

R. David Murray added the comment:

I also have no idea what your comment about stripping white space is in 
reference to ;)

--

___
Python tracker 

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



[issue29974] typing.TYPE_CHECKING doc example is incorrect

2017-04-03 Thread Berker Peksag

Changes by Berker Peksag :


--
stage:  -> patch review
type: enhancement -> behavior
versions:  -Python 3.4

___
Python tracker 

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



[issue29968] Document that no characters are allowed to proceed \ in explicit line joining

2017-04-03 Thread Martin Panter

Martin Panter added the comment:

I think he means make something like the following legal, where dots (.) 
indicate space characters:

a.=.\.
b

At the moment it is a SyntaxError:

>>> a = \ 
  File "", line 1
a = \ 
 ^
SyntaxError: unexpected character after line continuation character

I don’t think it is worthwhile changing that.

--
nosy: +martin.panter

___
Python tracker 

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



[issue29975] Issue in extending documentation

2017-04-03 Thread Namjun Kim

New submission from Namjun Kim:

https://docs.python.org/3.7/extending/extending.html

"Should it become a dangling pointer, C code which raises the exception could 
cause a core dump or other unintended side effects."

The typo error in this sentence.

"If it become a dangling pointer, C code which raises the exception could cause 
a core dump or other unintended side effects."

fix the typo error.

--
assignee: docs@python
components: Documentation
messages: 291098
nosy: Namjun Kim, docs@python
priority: normal
severity: normal
status: open
title: Issue in extending documentation
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



[issue29975] Issue in extending documentation

2017-04-03 Thread Martin Panter

Martin Panter added the comment:

FWIW I don’t see any error in the first quote. “Should X happen, Y happens” is 
valid English. Though I admit this kind of grammar is not used that often.

If it is too hard to understand, it should be okay to change it to “If it 
becomes a danging pointer, . . .”.

[become → becomes]

--
nosy: +martin.panter

___
Python tracker 

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



[issue29975] Issue in extending documentation

2017-04-03 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +1156

___
Python tracker 

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



[issue29976] urllib.parse clarify what ' ' in schemes mean

2017-04-03 Thread Senthil Kumaran

New submission from Senthil Kumaran:

urllib.parse has the following information in this module.

```
# A classification of schemes ('' means apply by default)
uses_relative = ['ftp', 'http', 'gopher', 'nntp', 'imap',
 'wais', 'file', 'https', 'shttp', 'mms',
 'prospero', 'rtsp', 'rtspu', '', 'sftp',
 'svn', 'svn+ssh', 'ws', 'wss']

```

Note the '' in the list.

1) First it needs to be first one for easy identification.
2) It needs to be clarified. '' means apply by default does not help the reader.

--
assignee: orsenthil
messages: 291100
nosy: orsenthil
priority: normal
severity: normal
stage: needs patch
status: open
title: urllib.parse clarify what ' ' in schemes mean
type: behavior
versions: 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



[issue29974] typing.TYPE_CHECKING doc example is incorrect

2017-04-03 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

The example is actually correct; I just confirmed by running it in my shell. 
Type annotations on local variables are not evaluated at runtime; see PEP 526.

--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue29976] urllib.parse clarify what ' ' in schemes mean

2017-04-03 Thread Senthil Kumaran

Senthil Kumaran added the comment:

https://github.com/python/cpython/pull/984 proposes a change. I'll need some 
reviews on this changed text.

Note: I am aware that there is an issue (long pending), which suggests deal 
away with these schemes at the top.  If we get to that immediately, I will be 
happy, if not, consider this PR as the improvement over the status quo.

--

___
Python tracker 

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



[issue29725] sqlite3.Cursor doesn't properly document "arraysize"

2017-04-03 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Thanks for working on this.

row_factory seems to be another parameter that can be set in the Cursor object. 
https://github.com/python/cpython/blob/master/Modules/_sqlite/cursor.c#L65 

This can addressed in a different issue/ pr.

--
nosy: +orsenthil

___
Python tracker 

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



[issue29725] sqlite3.Cursor doesn't properly document "arraysize"

2017-04-03 Thread Senthil Kumaran

Senthil Kumaran added the comment:


New changeset 02e12138000da834f23719521a011fa93763384d by Senthil Kumaran 
(csabella) in branch 'master':
bpo-29725: DOC: add text for arraysize in sqlite3.Cursor (#947)
https://github.com/python/cpython/commit/02e12138000da834f23719521a011fa93763384d


--

___
Python tracker 

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



[issue29725] sqlite3.Cursor doesn't properly document "arraysize"

2017-04-03 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
pull_requests: +1157

___
Python tracker 

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



[issue29725] sqlite3.Cursor doesn't properly document "arraysize"

2017-04-03 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
pull_requests: +1158

___
Python tracker 

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



[issue29725] sqlite3.Cursor doesn't properly document "arraysize"

2017-04-03 Thread Senthil Kumaran

Senthil Kumaran added the comment:


New changeset cb1e002c07622e027e80a3843d27a623d1617430 by Senthil Kumaran in 
branch '3.6':
bpo-29725: DOC: add text for arraysize in sqlite3.Cursor (#947) (#985)
https://github.com/python/cpython/commit/cb1e002c07622e027e80a3843d27a623d1617430


--

___
Python tracker 

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



[issue29725] sqlite3.Cursor doesn't properly document "arraysize"

2017-04-03 Thread Senthil Kumaran

Senthil Kumaran added the comment:


New changeset 0f9ceaf322cc9358373167115fd4c21ab2d9ad50 by Senthil Kumaran in 
branch '3.5':
bpo-29725: DOC: add text for arraysize in sqlite3.Cursor (#947) (#986)
https://github.com/python/cpython/commit/0f9ceaf322cc9358373167115fd4c21ab2d9ad50


--

___
Python tracker 

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



[issue29725] sqlite3.Cursor doesn't properly document "arraysize"

2017-04-03 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed
type: enhancement -> behavior

___
Python tracker 

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



[issue19180] some RFC references could be updated

2017-04-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +christian.heimes
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