[issue31347] possible undefined behavior in _PyObject_FastCall_Prepend

2017-09-04 Thread Benjamin Peterson

Changes by Benjamin Peterson :


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



[issue31347] possible undefined behavior in _PyObject_FastCall_Prepend

2017-09-04 Thread Benjamin Peterson

Benjamin Peterson added the comment:


New changeset a3070d530c70477273cacbc61660b318582fff44 by Benjamin Peterson in 
branch 'master':
bpo-31347: _PyObject_FastCall_Prepend: do not call memcpy if args might not be 
null (#3329)
https://github.com/python/cpython/commit/a3070d530c70477273cacbc61660b318582fff44


--

___
Python tracker 

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2017-09-04 Thread Neil Schemenauer

Neil Schemenauer added the comment:


New changeset db564238db440d4a2d8eb9d60ffb94ef291f6d30 by Neil Schemenauer in 
branch 'master':
Revert "bpo-17852: Maintain a list of BufferedWriter objects.  Flush them on 
exit. (#1908)" (#3337)
https://github.com/python/cpython/commit/db564238db440d4a2d8eb9d60ffb94ef291f6d30


--

___
Python tracker 

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



[issue31342] test.bisect module causes tests to fail

2017-09-04 Thread Neil Schemenauer

Neil Schemenauer added the comment:

The key is how the test is run.  If you run:

$ ./python Lib/test/.py

Then the Lib/test gets added to the first part of sys.path.  Then "import 
bisect" imports the Lib/test/bisect.py module rather than Lib/bisect.py.  
Obvious options seem to be:

1. rename Lib/test/bisect.py to something else
 
2. don't allow running files in Lib/test as scripts

To me, #2 is not a good option.  I'm attaching the output of:

./python.exe Lib/test/regrtest.py -v test_datetime 2>&1

In case it is helpful.  I pruned some lines to keep the file smaller.

--
Added file: http://bugs.python.org/file47119/test_datetime_out.txt

___
Python tracker 

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2017-09-04 Thread Neil Schemenauer

Changes by Neil Schemenauer :


--
pull_requests: +3352

___
Python tracker 

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



[issue26692] cgroups support in multiprocessing

2017-09-04 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2017-09-04 Thread Neil Schemenauer

Neil Schemenauer added the comment:


New changeset e38d12ed34870c140016bef1e0ff10c8c3d3f213 by Neil Schemenauer in 
branch 'master':
bpo-17852: Maintain a list of BufferedWriter objects.  Flush them on exit. 
(#1908)
https://github.com/python/cpython/commit/e38d12ed34870c140016bef1e0ff10c8c3d3f213


--

___
Python tracker 

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



[issue31348] webbrowser BROWSER with MacOSXOSAScript type

2017-09-04 Thread Michael Lazar

New submission from Michael Lazar:

Hello,

I have found that [1] is an open issue, but I have discovered what appears to 
be a completely separate bug than the one described in that ticket. The issue 
is that there is no way to specify a MacOSXOSAScript browser using the BROWSER 
variable. The _synthesize() command fails at the "if not shutil.which(cmd)" 
line, because OSAScript browsers are not commands in the system path. As a 
result, the value specified by BROWSER will get re-mapped to a GenericBrowser 
type, which is useless for most people on macOS.

Here's an example:

$ BROWSER=firefox python3
Python 3.6.1 (default, Apr  4 2017, 09:36:47)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import webbrowser
>>> for name in webbrowser._tryorder:
... print('%s: %s' % (name, webbrowser._browsers[name.lower()]))
...
firefox: [None, ]
MacOSX: [None, ]
chrome: [None, ]
firefox: [None, ]
safari: [None, ]
links: [None, ]
elinks: [None, ]
lynx: [None, ]
w3m: [None, ]

Note that on macOS, firefox is defined in the webbrowser module as

register("firefox", None, MacOSXOSAScript('firefox'), -1)


[1] http://bugs.python.org/issue24955

--
components: Library (Lib)
messages: 301294
nosy: michael-lazar
priority: normal
severity: normal
status: open
title: webbrowser BROWSER with MacOSXOSAScript type
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



[issue31333] Implement ABCMeta in C

2017-09-04 Thread INADA Naoki

INADA Naoki added the comment:

> Hm, indeed, but I see that module 'abc' is in 'sys.modules', probably it is 
> then only used by 'collections.abc'/'_collections_abc'. This means that the 
> influence of 'ABCMeta' on interpreter start-up time will be smaller than I 
> thought. But still start-up times for projects that actively use ABCs will be 
> influenced by 'ABCMeta'.

Since os.environ uses _collections_abc.MutableMapping, importing 
_collections_abc is not avoidable while startup.

`io` module uses ABC and it's used for sys.std(io|err|in).  It's not avoidable 
too.

And as you know, typing module will be very common rapidly :)
Even if it doesn't affect "python_startup" microbench, it's important.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue14191] argparse doesn't allow optionals within positionals

2017-09-04 Thread Glenn Linderman

Glenn Linderman added the comment:

I would dearly love to discard my private copies of argparse subclasses to 
implement this that I have been using for the last 5 years. Please, some other 
committer, concur here!

--

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-04 Thread INADA Naoki

INADA Naoki added the comment:

FYI, my approach is not original, but copied from PyPy.

https://bitbucket.org/pypy/pypy/src/3e52029e9a5a677f7de62ef49f36090465cfbf4c/rpython/rtyper/lltypesystem/rordereddict.py?at=default=file-view-default#rordereddict.py-1437:1551

--

___
Python tracker 

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



[issue31333] Implement ABCMeta in C

2017-09-04 Thread Guido van Rossum

Guido van Rossum added the comment:

I've heard many anecdotal complaints about the lack of speed of ABCs. Even if 
it doesn't affect core Python startup, it does affect startup of apps, and if 
people are afraid to use them because of this, it's reasonable to try to do 
something about it.

--

___
Python tracker 

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



[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-09-04 Thread Nathaniel Smith

Nathaniel Smith added the comment:

In bpo-30703 Antoine fixed signal handling so it doesn't use Py_AddPendingCall 
anymore. At this point the only time the interpreter itself uses 
Py_AddPendingCall is when there's an error writing to the signal_fd, which 
should never happen in normal usage.

If there are third-party libraries making heavy use of Py_AddPendingCall then 
it could be an issue, but any such libraries should already be making sure they 
never have more than one Py_AddPendingCall pending at a time, because you 
already have to assume that the processing might be arbitrarily delayed.

--

___
Python tracker 

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



[issue31333] Implement ABCMeta in C

2017-09-04 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue31342] test.bisect module causes tests to fail

2017-09-04 Thread STINNER Victor

STINNER Victor added the comment:

Can you put the whole traceback? I'm unable to reproduce the issue. Which 
datetime test uses biesct?

--

___
Python tracker 

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



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

2017-09-04 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 759e30ec47048cb9835c62aaeac48748c8151390 by Victor Stinner in 
branch 'master':
bpo-31170: Update libexpat from 2.2.3 to 2.2.4 (#3315)
https://github.com/python/cpython/commit/759e30ec47048cb9835c62aaeac48748c8151390


--

___
Python tracker 

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



[issue28411] Eliminate PyInterpreterState.modules.

2017-09-04 Thread Eric Snow

Changes by Eric Snow :


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



[issue28411] Eliminate PyInterpreterState.modules.

2017-09-04 Thread Eric Snow

Eric Snow added the comment:


New changeset 86b7afdfeee77993fe896a2aa13b3f4f95973f16 by Eric Snow in branch 
'master':
bpo-28411: Remove "modules" field from Py_InterpreterState. (#1638)
https://github.com/python/cpython/commit/86b7afdfeee77993fe896a2aa13b3f4f95973f16


--

___
Python tracker 

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



[issue16565] Increase Py_AddPendingCall array size

2017-09-04 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
versions: +Python 3.7 -Python 2.7, Python 3.3, 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



[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-09-04 Thread Gregory P. Smith

Gregory P. Smith added the comment:

I do wonder if this is going to raise the urgency of 
https://bugs.python.org/issue16565 (Increase Py_AddPendingCall array size) or 
other refactoring of how pending calls are tracked.

--

___
Python tracker 

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



[issue31341] remove IRIX support code

2017-09-04 Thread Benjamin Peterson

Benjamin Peterson added the comment:


New changeset 069306312addf87252e2dbf250fc7632fc8b7da3 by Benjamin Peterson in 
branch 'master':
remove IRIX support (closes bpo-31341) (#3310)
https://github.com/python/cpython/commit/069306312addf87252e2dbf250fc7632fc8b7da3


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



[issue31347] possible undefined behavior in _PyObject_FastCall_Prepend

2017-09-04 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
pull_requests: +3351

___
Python tracker 

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



[issue31347] possible undefined behavior in _PyObject_FastCall_Prepend

2017-09-04 Thread Benjamin Peterson

New submission from Benjamin Peterson:

As seen by ubsan:
../cpython/Objects/call.c:858:9: runtime error: null pointer passed as argument 
2, which is declared to never be null

--
messages: 301283
nosy: benjamin.peterson
priority: normal
severity: normal
status: open
title: possible undefined behavior in _PyObject_FastCall_Prepend
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



[issue31346] Prefer PROTOCOL_TLS_CLIENT/SERVER

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3349

___
Python tracker 

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



[issue15427] Describe use of args parameter of argparse.ArgumentParser.parse_args

2017-09-04 Thread R. David Murray

Changes by R. David Murray :


--
pull_requests: +3350

___
Python tracker 

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



[issue15427] Describe use of args parameter of argparse.ArgumentParser.parse_args

2017-09-04 Thread R. David Murray

Changes by R. David Murray :


--
pull_requests: +3348

___
Python tracker 

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



[issue31346] Prefer PROTOCOL_TLS_CLIENT/SERVER

2017-09-04 Thread Christian Heimes

New submission from Christian Heimes:

Since Python 3.6 the ssl module has three new protocols:


* PROTOCOL_TLS is the new, preferred, and less confusing name of 
PROTOCOL_SSLv23. It performs auto-negotiation of the best TLS/SSL protocol 
supported by client and server.
* PROTOCOL_TLS_CLIENT is a client-only variant of PROTOCOL_TLS. The protocol 
also enables check_hostname and CERT_REQUIRED.
* PROTOCOL_TLS_SERVER is server side-only variant. It leaves check_hostname 
disabled and has CERT_NONE (no client cert validation).

Tests and code should prefer PROTOCOL_TLS_CLIENT and PROTOCOL_TLS_SERVER 
whenever possible.

--
assignee: christian.heimes
components: SSL
messages: 301282
nosy: christian.heimes
priority: normal
severity: normal
stage: patch review
status: open
title: Prefer PROTOCOL_TLS_CLIENT/SERVER
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



[issue30622] Fix NPN guard for OpenSSL 1.1

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:


New changeset 72ed233167b10d3a488d30a8ec3a17e412a7dd69 by Christian Heimes in 
branch '2.7':
[2.7] bpo-30622: Change NPN detection: (GH-2079) (#3316)
https://github.com/python/cpython/commit/72ed233167b10d3a488d30a8ec3a17e412a7dd69


--

___
Python tracker 

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



[issue31345] Backport docstring improvements to the C version of OrderedDict

2017-09-04 Thread Raymond Hettinger

New submission from Raymond Hettinger:

The help() for collections.OrderedDict.popitem is not showing the default value 
of last=True.

--- Prior versions are unhelpful --
~/npython $ python3.6
Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import OrderedDict
>>> help(OrderedDict.popitem)
Help on method_descriptor:

popitem(...)
od.popitem() -> (k, v), return and remove a (key, value) pair.
Pairs are returned in LIFO order if last is true or FIFO order if false.


--- Current version is helpful 
$ ./python.exe
Python 3.7.0a0 (heads/master-dirty:b2d096bd2a, Sep  4 2017, 14:50:05)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import OrderedDict
>>> help(OrderedDict.popitem)
Help on method_descriptor:

popitem(self, /, last=True)
Remove and return a (key, value) pair from the dictionary.

Pairs are returned in LIFO order if last is true or FIFO order if false.

--
messages: 301280
nosy: eric.snow, rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Backport docstring improvements to the C version of OrderedDict
type: enhancement
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



[issue30450] Pull Windows dependencies from GitHub rather than svn.python.org

2017-09-04 Thread Zachary Ware

Zachary Ware added the comment:


New changeset 986b7ffc650919b3022ccaa458a843bb8a95d2bd by Zachary Ware in 
branch '2.7':
[2.7] bpo-30450: Pull Windows dependencies from GitHub rather than SVN 
(GH-1783) (GH-3306)
https://github.com/python/cpython/commit/986b7ffc650919b3022ccaa458a843bb8a95d2bd


--

___
Python tracker 

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



[issue30502] Fix buffer handling of OBJ_obj2txt

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3347

___
Python tracker 

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



[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-09-04 Thread Nick Coghlan

Nick Coghlan added the comment:

Right, if you look at the comments in the draft test case, we realised there 
are three things we currently need to protect:

1. POP_BLOCK -> WITH_CLEANUP_START (synchronous CM)
2. POP_BLOCK -> GET_AWAITABLE (asynchronous CM)
3. GET_AWAITABLE -> YIELD_FROM (asynchronous CM)

Now that I have a test case, I'm going to start looking at defining a new 
DEFER_PENDING_UNTIL opcode that skips pending call processing (and hence 
signals) until that particular opcode offset is reached.

--

___
Python tracker 

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



[issue30502] Fix buffer handling of OBJ_obj2txt

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3346

___
Python tracker 

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



[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-09-04 Thread Nathaniel Smith

Nathaniel Smith added the comment:

This would still provide value even if you have to do a GET_AWAITABLE in the 
protected region: the most common case is that __aenter__ is a coroutine 
function, which means that its __await__ is implemented in C and already 
protected against interrupts.

Also, to make this fully useful we need some way to protect arbitrary callables 
against interrupts anyway (to handle the case where the signal arrives during 
the actual __enter__ or __exit__ body), so saying that we also need to be able 
to protect __await__ isn't a big deal.

--

___
Python tracker 

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



[issue30502] Fix buffer handling of OBJ_obj2txt

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:


New changeset e503ca52889bf66ac502702569e726caa7970299 by Christian Heimes 
(Serhiy Storchaka) in branch 'master':
bpo-30502: Fix handling of long oids in ssl. (#2909)
https://github.com/python/cpython/commit/e503ca52889bf66ac502702569e726caa7970299


--

___
Python tracker 

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



[issue14191] argparse doesn't allow optionals within positionals

2017-09-04 Thread R. David Murray

R. David Murray added the comment:

I've turned intermixed.patch into a PR.  I tweaked the documentation so that it 
does not refer to the details of the implementation.  I tweaked the 
implementation to have the 'try' start before the code that modifies the state, 
and did the line wrapping to <80 columns.

I have one concern about this patch: parse_intermixed_args doesn't support all 
of the argparse features.  It feels to me like it is worthwhile to add anyway, 
and maybe someone will figure out how to support more features later.  But I'd 
like at least one other committer to concur :)

Given concurrence I'll add news and what's new entries.

paul.j3: I'm trying to review argparse patches during this core sprint week, so 
if you have anything in particular you want me to focus on, please let me know.

--
stage:  -> patch review
type: behavior -> enhancement
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



[issue14191] argparse doesn't allow optionals within positionals

2017-09-04 Thread R. David Murray

Changes by R. David Murray :


--
pull_requests: +3345

___
Python tracker 

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



[issue31343] Include major(), minor(), makedev() from sysmacros

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3344

___
Python tracker 

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



[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-09-04 Thread Nick Coghlan

Changes by Nick Coghlan :


--
dependencies: +f_trace_opcodes frame attribute to switch to per-opcode tracing

___
Python tracker 

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



[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-09-04 Thread Nick Coghlan

Nick Coghlan added the comment:

https://github.com/ncoghlan/cpython/pull/2/files provides a test case that 
reliably reproduces the problem for both synchronous and asynchronous context 
managers.

It's inspired by Nathaniel's proposal above, but relies on a modified version 
of sys.settrace that runs the trace function after every opcode, not just every 
time the line number changes or we jump backwards in the bytecode.

Issue 31344 is a separate issue to add that underlying capability so we can 
write this test case.

--

___
Python tracker 

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



[issue31344] f_trace_opcodes frame attribute to switch to per-opcode tracing

2017-09-04 Thread Nick Coghlan

New submission from Nick Coghlan:

In order to test issue 29988 reliably, we want the ability to run trace hooks 
for every opcode in a frame, rather than for every line.

The simplest API we've been able to come up with for that is a 
"f_trace_opcodes" attribute on the frame which we set from the trace hook the 
first time that it runs.

--
messages: 301273
nosy: gregory.p.smith, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: f_trace_opcodes frame attribute to switch to per-opcode tracing
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



[issue31343] Include major(), minor(), makedev() from sysmacros

2017-09-04 Thread Christian Heimes

New submission from Christian Heimes:

On Fedora 26, GCC is emitting warnings because we are using minor(), major() 
and makedev() 
from sys/types.h. The macros should be included from sys/sysmacros.h instead:

./Modules/posixmodule.c: In function ‘os_major_impl’:
./Modules/posixmodule.c:8758:13: warning: In the GNU C Library, "major" is 
defined
 by . For historical compatibility, it is
 currently defined by  as well, but we plan to
 remove this soon. To use "major", include 
 directly. If you did not intend to use a system-defined macro
 "major", you should undefine it after including .
 return major(device);
 ^  



 
./Modules/posixmodule.c: In function ‘os_minor_impl’:
./Modules/posixmodule.c:8775:13: warning: In the GNU C Library, "minor" is 
defined
 by . For historical compatibility, it is
 currently defined by  as well, but we plan to
 remove this soon. To use "minor", include 
 directly. If you did not intend to use a system-defined macro
 "minor", you should undefine it after including .
 return minor(device);
 ^  



 
./Modules/posixmodule.c: In function ‘os_makedev_impl’:
./Modules/posixmodule.c:8793:13: warning: In the GNU C Library, "makedev" is 
defined
 by . For historical compatibility, it is
 currently defined by  as well, but we plan to
 remove this soon. To use "makedev", include 
 directly. If you did not intend to use a system-defined macro
 "makedev", you should undefine it after including .
 return makedev(major, minor);
 ^

--
components: Extension Modules
messages: 301272
nosy: christian.heimes
priority: normal
severity: normal
stage: needs patch
status: open
title: Include major(), minor(), makedev() from sysmacros
type: compile error
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



[issue31342] test.bisect module causes tests to fail

2017-09-04 Thread Neil Schemenauer

New submission from Neil Schemenauer:

After a lot of head scratching, I have discovered why tests are failing for me. 
 E.g. "./python Lib/test/test_datetime.py" results in

AttributeError: module 'bisect' has no attribute 'bisect_right'

Running tests this way causes test/bisect to be imported rather than the std 
library bisect module.  I'm not sure of the correct fix, perhaps rename 
test.bisect?

Patch that added it: bpo-29512: Add test.bisect, bisect failing tests

--
assignee: haypo
messages: 301271
nosy: haypo, nascheme
priority: normal
severity: normal
stage: needs patch
status: open
title: test.bisect module causes tests to fail
type: behavior

___
Python tracker 

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



[issue30622] Fix NPN guard for OpenSSL 1.1

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3343

___
Python tracker 

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



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

2017-09-04 Thread STINNER Victor

STINNER Victor added the comment:

I produced attached PR 3315 using attached cpython_rebuild_expat_dir.sh + 
revert Modules/expat/expat_external.h change to keep #include "pyexpatns.h".

--

___
Python tracker 

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



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

2017-09-04 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3342

___
Python tracker 

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



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

2017-09-04 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file47118/cpython_rebuild_expat_dir.sh

___
Python tracker 

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



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

2017-09-04 Thread STINNER Victor

Changes by STINNER Victor :


--
title: expat: utf8_toUtf8 cannot properly handle exhausting buffer -> Update to 
expat 2.2.4 (expat: utf8_toUtf8 cannot properly handle exhausting buffer)

___
Python tracker 

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



[issue30622] Fix NPN guard for OpenSSL 1.1

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3341

___
Python tracker 

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



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

2017-09-04 Thread STINNER Victor

STINNER Victor added the comment:

Expat 2.2.3 has a bug: see bpo-31170 :-(

--

___
Python tracker 

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



[issue30622] Fix NPN guard for OpenSSL 1.1

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:


New changeset b2d096bd2a5ff86e53c25d00ee5fa097b36bf1d8 by Christian Heimes 
(Melvyn Sopacua) in branch 'master':
bpo-30622: Change NPN detection: (#2079)
https://github.com/python/cpython/commit/b2d096bd2a5ff86e53c25d00ee5fa097b36bf1d8


--

___
Python tracker 

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



[issue24896] It is undocumented that re.UNICODE and re.LOCALE affect re.IGNORECASE

2017-09-04 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
pull_requests: +3340

___
Python tracker 

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



[issue1198569] string.Template not flexible enough to subclass (regexes)

2017-09-04 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:


New changeset 973b901212bd84d279904bab6654709f4ec32470 by Barry Warsaw in 
branch 'master':
What's New for bpo-1198569 (#3303)
https://github.com/python/cpython/commit/973b901212bd84d279904bab6654709f4ec32470


--

___
Python tracker 

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



[issue31340] Use VS 2017 compiler for build

2017-09-04 Thread Steve Dower

Changes by Steve Dower :


--
pull_requests: +3339

___
Python tracker 

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



[issue22536] subprocess should include filename in FileNotFoundError exception

2017-09-04 Thread Gregory P. Smith

Gregory P. Smith added the comment:


New changeset 1dba3789e335f06e3b01cdc84070f2e828c9b861 by Gregory P. Smith in 
branch '3.6':
bpo-22536 [3.6] Set filename in FileNotFoundError  (#3305)
https://github.com/python/cpython/commit/1dba3789e335f06e3b01cdc84070f2e828c9b861


--

___
Python tracker 

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



[issue31341] remove IRIX support code

2017-09-04 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
pull_requests: +3338

___
Python tracker 

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



[issue31326] concurrent.futures: ProcessPoolExecutor.shutdown(wait=True) should wait for the call queue thread

2017-09-04 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3337

___
Python tracker 

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



[issue31339] [2.7] time.asctime() crash with year > 9999 using musl C library

2017-09-04 Thread STINNER Victor

STINNER Victor added the comment:

Christian Heimes: "I'm ok to replace the asctime with our own implementation 
that can handle year >. Please include range checks for year, wday and 
month, though."

Done.

By the way, I discussed with Alex Gaynor on #python-dev to define the severity 
of the bug. It was said that it's a medium security issue, it's a denial of 
service which can be triggered through user data.

--

___
Python tracker 

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



[issue31339] [2.7] time.asctime() crash with year > 9999 using musl C library

2017-09-04 Thread STINNER Victor

STINNER Victor added the comment:

Ok, there are 3 choices:

* Do nothing: musl crash on year > , glibc supports year > , behaviour 
is likely undefined on other libc
* PR 3296: Reject year >  on all platforms: can be seen as a Python 2.7 
regression when running with glibc
* PR 3293: Reimplement time.asctime() and time.ctime() to not depend on the 
libc anymore, as done in Python 3

My favorite option is now "PR 3293: Reimplement time.asctime()". Yeah, there is 
a risk of getting a behaviour change on funky libc with funky values, but IMHO 
it's worth it.

--

___
Python tracker 

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



[issue22650] set up and use VM for net access in the test suite

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:

FYI, sha256.tbs-internet.com is no longer used in tests.

--
nosy: +christian.heimes

___
Python tracker 

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



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

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


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



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

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:


New changeset 57d963b0b559078ca419811d0d25fea27d42f30c by Christian Heimes in 
branch '2.7':
[2.7] bpo-25674: remove sha256.tbs-internet.com ssl test (GH-3297) (#3301)
https://github.com/python/cpython/commit/57d963b0b559078ca419811d0d25fea27d42f30c


--

___
Python tracker 

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



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

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:

I've removed the sha256.tbs-internet.com from 2.7, 3.6, and master. 3.5 and 
previous versions are in security fix-only mode.

--

___
Python tracker 

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



[issue31341] remove IRIX support code

2017-09-04 Thread Benjamin Peterson

New submission from Benjamin Peterson:

IRIX hasn't been officially supported, since 2013. Per PEP 11, we're going to 
remove the code in Python 3.7.

--
components: Build
messages: 301260
nosy: benjamin.peterson
priority: normal
severity: normal
status: open
title: remove IRIX support code
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



[issue31340] Use VS 2017 compiler for build

2017-09-04 Thread Jeremy Kloth

Changes by Jeremy Kloth :


--
nosy: +jkloth

___
Python tracker 

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



[issue30450] Pull Windows dependencies from GitHub rather than svn.python.org

2017-09-04 Thread Zachary Ware

Changes by Zachary Ware :


--
pull_requests: +3336

___
Python tracker 

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



[issue31339] [2.7] time.asctime() crash with year > 9999 using musl C library

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:

I'm ok to replace the asctime with our own implementation that can handle year 
>. Please include range checks for year, wday and month, though.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue22536] subprocess should include filename in FileNotFoundError exception

2017-09-04 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
pull_requests: +3335

___
Python tracker 

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



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

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:


New changeset 4bc8ef0eeed191f9398a90e748f732cfba67546d by Christian Heimes in 
branch '3.6':
[3.6] bpo-25674: remove sha256.tbs-internet.com ssl test (GH-3297) (#3300)
https://github.com/python/cpython/commit/4bc8ef0eeed191f9398a90e748f732cfba67546d


--

___
Python tracker 

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



[issue1198569] string.Template not flexible enough to subclass (regexes)

2017-09-04 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
pull_requests: +3334

___
Python tracker 

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



[issue31339] [2.7] time.asctime() crash with year > 9999 using musl C library

2017-09-04 Thread STINNER Victor

STINNER Victor added the comment:

Oh, I forgot to describe the bug.

asctime() (and ctime()?) do crash on year >  with musl. musl uses an 
hardcoded buffer of 26 bytes:
http://git.musl-libc.org/cgit/musl/tree/src/time/__asctime.c

musl developers consider that the caller must reject year larger than :


/* ISO C requires us to use the above format string,
 * even if it will not fit in the buffer. Thus asctime_r
 * is _supposed_ to crash if the fields in tm are too large.
 * We follow this behavior and crash "gracefully" to warn
 * application developers that they may not be so lucky
 * on other implementations (e.g. stack smashing..).
 */
a_crash();


I disagree. asctime() must either return a longer string, or return an error. 
But not crash.

--
title: [2.7] time.asctime() buffer overflow for year >  using mucl (C 
library) -> [2.7] time.asctime() crash with year >  using musl C library

___
Python tracker 

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



[issue1198569] string.Template not flexible enough to subclass (regexes)

2017-09-04 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


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



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

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +

___
Python tracker 

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



[issue1198569] string.Template not flexible enough to subclass (regexes)

2017-09-04 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:


New changeset ba4279683f8eb8f59be10d12547ea89480614388 by Barry Warsaw in 
branch 'master':
bpo-1198569: Allow string.Template braced pattern to be different (#3288)
https://github.com/python/cpython/commit/ba4279683f8eb8f59be10d12547ea89480614388


--

___
Python tracker 

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



[issue31339] [2.7] time.asctime() buffer overflow for year > 9999 using mucl (C library)

2017-09-04 Thread STINNER Victor

STINNER Victor added the comment:

To be honest, I'm not sure that the issue must be categorized as a security 
vulnerability, nor that it should be fixed. I opened an issue to discuss if 
it's worth it.

To be clear: Python 3 is safe (at least since Python 3.3, I didn't check older 
Python 3.x released).

--

___
Python tracker 

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



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

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3332

___
Python tracker 

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



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

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:


New changeset 002d64039b60c1a9289f981fe73a5cf91d082136 by Christian Heimes in 
branch 'master':
bpo-25674: remove sha256.tbs-internet.com ssl test (#3297)
https://github.com/python/cpython/commit/002d64039b60c1a9289f981fe73a5cf91d082136


--

___
Python tracker 

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



[issue31340] Use VS 2017 compiler for build

2017-09-04 Thread Steve Dower

New submission from Steve Dower:

The newer MSVC (v141) is available and reliable, and theoretically binary 
compatible with v140. This means we can update both Python 3.6 and 3.7 to build 
with it.

Testing for this should include:
* pythoncore with v141 and remainder with v140
* Python with v141 and wheels with v140

--
assignee: steve.dower
components: Build, Windows
messages: 301253
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Use VS 2017 compiler for build
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



[issue31338] Use abort() for code we never expect to hit

2017-09-04 Thread Stefan Krah

Stefan Krah added the comment:

Regarding lint warnings, I may have confused abort() with exit().

Lintian has the shlib-calls-exit tag, somehow I thought there was
a similar one for abort(), but I can't find it now.

--

___
Python tracker 

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



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

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3331

___
Python tracker 

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



[issue31339] [2.7] time.asctime() buffer overflow for year > 9999 using mucl (C library)

2017-09-04 Thread STINNER Victor

STINNER Victor added the comment:

Antoine: "What if this produces a different result and breaks some code on some 
platforms?"

No idea. It would call that a regression.

I wrote another much simpler change: 
https://github.com/python/cpython/pull/3296 raises a ValueError for year larger 
than . It doesn't touch time.ctime() (yet?).

--

___
Python tracker 

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



[issue31339] [2.7] time.asctime() buffer overflow for year > 9999 using mucl (C library)

2017-09-04 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3330

___
Python tracker 

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



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

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:

The sha256.tbs-internet.com has been down for a while and the DNS record is no 
longer available. Alex and I agreed that the test no longer makes sense, too. 
RSA certs with SHA-256 signatures are de-facto standard and supported by 
OpenSSL for a long time. We test SHA-256 certs with several other tests that 
talk to remote servers.

I'm going to remove the test and sha256 cert.

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



[issue30423] [asyncio] orphan future close loop and cause "RuntimeError: Event loop stopped before Future completed."

2017-09-04 Thread Jimmy Lai

Changes by Jimmy Lai :


--
pull_requests: +3329

___
Python tracker 

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



[issue1198569] string.Template not flexible enough to subclass (regexes)

2017-09-04 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Never mind; I crafted a decent test for the PR.

--

___
Python tracker 

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



[issue31172] Py_Main() is totally broken on Visual Studio 2017

2017-09-04 Thread Steve Dower

Changes by Steve Dower :


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



[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-09-04 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Yury's in the room here and pointed out how Nick and I are wrong. :)  [yay 
sprints!]

async def __aexit__(self, *e):
  spamity_spam
  return Awaitable

If we resolve the GET_AWAITABLE at BEFORE_ASYNC_WITH time, the spamity_spam 
within __aexit__ is executed before the with block instead of after as happens 
today.  :/

See also 
https://www.python.org/dev/peps/pep-0492/#asynchronous-context-managers-and-async-with

Nick is actively working on making a test.

--
assignee:  -> ncoghlan

___
Python tracker 

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



[issue31339] [2.7] time.asctime() buffer overflow for year > 9999 using mucl (C library)

2017-09-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

What if this produces a different result and breaks some code on some platforms?

--
nosy: +pitrou, serhiy.storchaka

___
Python tracker 

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



[issue31339] [2.7] time.asctime() buffer overflow for year > 9999 using mucl (C library)

2017-09-04 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3328

___
Python tracker 

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



[issue31339] [2.7] time.asctime() buffer overflow for year > 9999 using mucl (C library)

2017-09-04 Thread STINNER Victor

New submission from STINNER Victor:

Attached PR backports (and adapts) the _asctime() function from the master 
branch to Python 2.7, so time.asctime() and time.ctime() don't call asctime() 
and ctime() functions of the external C library, but use portable and safe C 
code.

--
components: Library (Lib)
messages: 301246
nosy: haypo
priority: normal
severity: normal
status: open
title: [2.7] time.asctime() buffer overflow for year >  using mucl (C 
library)
type: security
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



[issue31337] Small opportunity for NULL dereference in compile.c

2017-09-04 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

See bpo-31338 for adopting the abort() idiom.

--

___
Python tracker 

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



[issue31338] Use abort() for code we never expect to hit

2017-09-04 Thread Barry A. Warsaw

New submission from Barry A. Warsaw:

Over in bpo-31337 the observation was made that we often use the following 
pattern in situations we never expect to hit:

assert(0);
return NULL;

but this isn't strictly optimal.  First, the asserts can be compiled away.  
Second, it's possible that our assumptions about a particular condition are 
incorrect.  Third, the intent of non-reachability isn't as clear as it could be.

As suggested in http://bugs.python.org/issue31337#msg301229 it would be better 
to use

abort() /* NOT REACHED */

instead (although @skrah says "The only drawback is that in the case of 
libraries, sometimes distribution package lint tools complain." so it would be 
useful to understand that in more detail.

@serhiy.storchaka says "I have counted 48 occurrences of assert(0), 11 assert(0 
&& "message") and 2 assert(!"message"). If fix one occurrence, why not fix all 
others?"  We should!  This issue tracks that.

--
assignee: barry
components: Interpreter Core
messages: 301244
nosy: barry, serhiy.storchaka, skrah
priority: normal
severity: normal
status: open
title: Use abort() for code we never expect to hit
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



[issue15427] Describe use of args parameter of argparse.ArgumentParser.parse_args

2017-09-04 Thread R. David Murray

Changes by R. David Murray :


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

___
Python tracker 

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



[issue15427] Describe use of args parameter of argparse.ArgumentParser.parse_args

2017-09-04 Thread R. David Murray

R. David Murray added the comment:

I've turned this into a PR.  The example was already changed in a previous 
checkin.  I reworded the optparse porting addition to match the existing style 
of the list.

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



[issue15427] Describe use of args parameter of argparse.ArgumentParser.parse_args

2017-09-04 Thread R. David Murray

Changes by R. David Murray :


--
pull_requests: +3327

___
Python tracker 

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



[issue31331] IDLE: Move prompts with input.

2017-09-04 Thread Terry J. Reedy

Terry J. Reedy added the comment:

In my example the screen before the output had

>>> go()
>>> a = 
   12,|

where '|' is the blinking input cursor.  The '\n' terminated print output is 
inserted *after* '>>> ' but before the imcomplete statement.  When the 
statement  I want it *before* the prompt, with '\n' appended if necessary.  In 
the minimized example, the result would be

 >>> from threading import Timer
>>> Timer(0.1, lambda: print('hello'), ()).start()
'hello'
>>>

If delayed output 'junk' does not end with '\n', we can get

>>> junkg=4  # 'g' started where the 'j' ends up.
>>> g
4

This is buggy as a history listing.

IDLE's current behavior, which keeps user input and program output better 
separated, is much better than interactive Python in the console Steven used, 
where the output is placed at the end of the incomplete statement, which is a 
nuisance.

The first step is to find where text from the user program is inserted into the 
Shell text box.  Then, how is the insertion point moved back -- but just not 
quite far enough. The solution might then be obvious.

A 'deeper' idea that would solve this (and other issues) is a separate Shell 
input box (without '>>> ') under the Shell history box.  But that is a separate 
discussion.

--

___
Python tracker 

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



[issue31333] Implement ABCMeta in C

2017-09-04 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Eric,

> the only ABCs in importlib are in importlib.abc (and used by importlib.util).
> This does not impact interpreter startup.

Hm, indeed, but I see that module 'abc' is in 'sys.modules', probably it is 
then only used by 'collections.abc'/'_collections_abc'. This means that the 
influence of 'ABCMeta' on interpreter start-up time will be smaller than I 
thought. But still start-up times for projects that actively use ABCs will be 
influenced by 'ABCMeta'.

But what do you think about making private ABC caches read-only attributes? 
(They are not documented)

--

___
Python tracker 

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



[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-04 Thread Stefan Behnel

Stefan Behnel added the comment:

> I would prefer to use the _Py_IDENTIFIER API rather than using 
> _PyDict_GetItem_KnownHash().

Do you mean for the table of slot descriptions? I'm not sure that the effect 
would be comparable.

> Maybe there are other opportunities for optimization?

I would guess so. According to callgrind, for the timeit run, the original 
implementation has the following call fanout for the type creation:

- 1755 calls to type_call()
- 3850 calls to type_new()
- 224000 calls to update_one_slot()
- 317000 calls to_PyType_Lookup()
- 566000 calls to PyDict_GetItem()

That's 147 calls to PyDict_GetItem() per type creation, just inside of 
_PyType_Lookup().

About 20% of the time in PyDict_GetItem() is spent in PyErr_Clear(), and 23/26% 
respectively in lookdict_unicode_nodummy() (349000 calls) and 
lookdict_unicode() (278000 calls).

There is probably some space for algorithmic improvements here, in order to 
reduce the overall number of calls. For example, I wonder if bypassing the 
method cache while building the type might help. The cache maintenance seems to 
amount for something like 30% of the time spent in _PyType_Lookup(). Or 
reversing the inspection order, i.e. running over the type attributes and 
looking up the slots, instead of running over the slots and looking up the 
attributes. Or using a faster set intersection algorithm for that purpose. 
Something like that.

OTOH, quick gains might be worth it, but since applications that find their 
bottleneck in type creation are probably rare, I doubt that it's worth putting 
weeks into this. Even the application startup time is unlikely to be domination 
by *type* creations, rather than *object* instantiations.

--

___
Python tracker 

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



[issue31328] _sha3 is missing from Setup.dist

2017-09-04 Thread Benjamin Peterson

Changes by Benjamin Peterson :


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



[issue12633] sys.modules doc entry should reflect restrictions

2017-09-04 Thread Eric Snow

Eric Snow added the comment:

We're dropping PyInterpreterState.modules (#28411).

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Eliminate PyInterpreterState.modules.

___
Python tracker 

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



  1   2   >