[issue31335] str.format should support "{:r}" for any type.

2017-09-04 Thread Alastair Houghton

New submission from Alastair Houghton:

Currently if you do

  "{:r}".format(None)

you get the error message

  TypeError: non-empty format string passed to object.__format__

or on newer versions

  TypeError: non-empty format string passed to NoneType.__format__

(which is at least *some* improvement).

Similar behaviour occurs for other types that don't implement their own 
__format__ method.

This seems to me to be an error on two counts:

1. object.__format__ *should* support ":r", and probably ":s" too.

2. It's unclear what the error message actually means (I had to Google it to 
find out what was going wrong), *especially* in a situation where it isn't 
obvious that the argument evaluates to None.

Since the error itself would still happen if an unsupported specifier was used, 
we should improve the message.  A better choice might be

  TypeError: format "{:x}" not supported for type NoneType.

--
components: Interpreter Core, Library (Lib)
messages: 301211
nosy: al45tair
priority: normal
severity: normal
status: open
title: str.format should support "{:r}" for any type.
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



[issue31335] str.format should support "{:r}" for any type.

2017-09-04 Thread Alastair Houghton

Alastair Houghton added the comment:

Having looked carefully through the current code, I notice that the error 
message *has* been improved (though it'd be nice if it included a copy of the 
format string it's rejecting), and also that the alternative

  "{!r}".format(None)

does work as expected, and has the advantage that other formatting features are 
supported, e.g.

  "{!r:10.10}".format(None)

will work as expected.

I'm going to close this bug report.

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



[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-04 Thread Stefan Behnel

Changes by Stefan Behnel :


--
pull_requests: +3322

___
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

New submission from Stefan Behnel:

The method lookup fast path in _PyType_Lookup() does not apply during type 
creation, which is highly dominated by the performance of the dict lookups 
along the mro chain. Pre-calculating the name hash speeds up the creation of an 
empty class (i.e. "class Test: pass") by around 20%.

Will send a pull request shortly.

--
components: Interpreter Core
messages: 301213
nosy: scoder
priority: normal
severity: normal
status: open
title: Speed up _PyType_Lookup() for class creation
type: performance
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



[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you please provide benchmarks that you used?

--
nosy: +serhiy.storchaka
stage:  -> patch review

___
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 literally just ran timeit on "class Test: pass", but I'll see if I can 
provide proper numbers.

--

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

Comparing against CPython master as of 122e88a8354e3f75aeaf6211232dac88ac296d54

I rebuilt my CPython to get clean results, and that still gave me almost 15% 
overall speedup.

Original:
$ ./python -m timeit 'class Test: pass'
2 loops, best of 5: 9.55 usec per loop

Patched:
$ ./python -m timeit 'class Test: pass'
5 loops, best of 5: 8.27 usec per loop

I came across this when benchmarking the class creation in Cython, which seemed 
slow, and after a couple of tweaks, I ended up with 97% of the runtime inside 
of CPython, so I took a look over the fence.

According to callgrind, the original version spent over 125M instructions 
inside of _PyType_Lookup() for the timeit run, whereas the patched version only 
counts about 92M, that's about 25% less.

--

___
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 Louie Lu

Louie Lu added the comment:

minimum reproduce:

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

---

And the expect output should be something like:

>>> from threading import Timer
>>> Timer(0.1, lambda: print('hello'), ()).start()
>>> 'hello'# No  or other key-input
>>>

or:

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

Right?

--
nosy: +louielu

___
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 Louie Lu

Louie Lu added the comment:

Or the output should be:

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

--

___
Python tracker 

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



[issue31327] bug in dateutil\tz\tz.py

2017-09-04 Thread Louie Lu

Louie Lu added the comment:

Using macOS and Linux can't reproduce this problem, both platform
return this output:

>>> import time
>>> time.localtime(-3600)
time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=7, tm_min=0, 
tm_sec=0, tm_wday=3, tm_yday=1, tm_isdst=0)

--
nosy: +louielu

___
Python tracker 

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



[issue31329] Add idlelib module entry to doc

2017-09-04 Thread Louie Lu

Changes by Louie Lu :


--
nosy: +louielu

___
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 Serhiy Storchaka

Serhiy Storchaka added the comment:

What names are looked up when you create an empty class?

I'm surprised that this change has measurable performance effect. Aren't name 
an interned string with precalculated cache?

--
nosy: +haypo, inada.naoki, pitrou, rhettinger

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

It's the slot names in "slotdefs". See "update_one_slot()".

The time that is saved is mostly the overhead of calling PyDict_GetItem(). I 
actually tried PyDict_GetItemWithError() first, which is faster due to the 
lower error handling overhead, before I noticed that the real problem is the 
repeated lookups of the same name, which can be optimised further by 
pre-calculating the hash and calling the low-level lookup function.

--

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-09-04 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



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

2017-09-04 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
nosy: +gregory.p.smith

___
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

New submission from Barry A. Warsaw:

There is a very minor opportunity for NULL dereference in compile.c.  
compiler_subdict() does not check the return value of get_const_value(), which 
could be NULL.  This was found by Kirit Sankar Gupta.

This is not a security issue in practice, since compiler_subdict() calls 
are_all_items_const() before it gets to the call, so the condition which 
triggers get_const_value() to return NULL will never happen (i.e. the default: 
clause of get_const_value()).  Still, it can't hurt to be more correct in case 
the conditions which are implicitly assumed could change.  Plus the fix is 
super easy, so why not do it?

--
assignee: barry
components: Interpreter Core
messages: 301222
nosy: barry
priority: normal
severity: normal
status: open
title: Small opportunity for NULL dereference in compile.c
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



[issue31328] _sha3 is missing from Setup.dist

2017-09-04 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests: +3324

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

As it's barely worth fixing, it's not worth backporting.

--

___
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 Serhiy Storchaka

Serhiy Storchaka added the comment:

The default case is added just for silencing compiler warning. It is never 
executed. There are a number of places in the core that look like

assert(0);
return NULL; /* or whatever */

This is a dead code, but compilers complain without it.

How do you suggest to improve this code?

--
nosy: +serhiy.storchaka

___
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

Changes by Barry A. Warsaw :


--
pull_requests: +3325

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

I'll preface that it's not a major issue that I feel *has* to be fixed, but 
given that assert *can* be compiled away, does it make sense to use abort() 
instead?  E.g.

1 file changed, 2 insertions(+), 2 deletions(-)
Python/compile.c | 4 ++--

modified   Python/compile.c
@@ -1350,8 +1350,8 @@ get_const_value(expr_ty e)
 case NameConstant_kind:
 return e->v.NameConstant.value;
 default:
-assert(!is_const(e));
-return NULL;
+/* We should never get here. */
+abort();
 }
 }
 

This at least makes gcc happy and makes the intent clearer.

--

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


--
versions: +Python 3.7 -Python 3.2

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

Sorry for the long delay.  It looks like Ian's original link is no longer 
valid.  Do you have an updated link to a possible doctest or example?

--

___
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 STINNER Victor

STINNER Victor added the comment:

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

--

___
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 Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you please also look at other asserts? 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?

--

___
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 Stefan Krah

Stefan Krah added the comment:

I'm very much in favor of using abort() /* NOT REACHED */ in such cases.

The only drawback is that in the case of libraries, sometimes
distribution package lint tools complain.

--
nosy: +skrah

___
Python tracker 

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



[issue30541] Add restricted mocks to the python unittest mocking framework

2017-09-04 Thread STINNER Victor

STINNER Victor added the comment:

I will merge the PR this week, the PR now LGTM.

--

___
Python tracker 

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



[issue31281] fileinput inplace does not work with pathlib.Path

2017-09-04 Thread Eric V. Smith

Eric V. Smith added the comment:


New changeset 06de1aeff94e524bed21d188065c4cd1590fb046 by ericvsmith (Zhiming 
Wang) in branch 'master':
bpo-31281: Fix pathlib.Path incompatibility in fileinput (gh-3208)
https://github.com/python/cpython/commit/06de1aeff94e524bed21d188065c4cd1590fb046


--
nosy: +eric.smith

___
Python tracker 

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



[issue16988] argparse: PARSER option for nargs not documented

2017-09-04 Thread R. David Murray

R. David Murray added the comment:

I don't think this use case is enough to justify documenting it, since this is 
not an intuitive meaning of the word PARSER.  I think if we wanted to expose 
this for this kind of use case, we'd want to rename the constant (with an alias 
for backward compatibility), which would be an enhancement.  I'm going to close 
this, but someone who wants this could open an enhancement request.

--
nosy: +r.david.murray
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: enhancement -> 

___
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 Serhiy Storchaka

Serhiy Storchaka added the comment:

After adding PyErr_Clear() the benefit of this optimization is smaller. Only 8% 
on my 64-bit computer. And no any effect on 32-bit. I wounder if it is worth to 
complicate the code for such small benefit. For non-empty classes the relative 
benefit is even smaller. Maybe there are other opportunities for optimization?

--

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

On Sep 4, 2017, at 10:18, Serhiy Storchaka  wrote:
> Serhiy Storchaka added the comment:
> 
> Could you please also look at other asserts? 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?

I think it makes sense to change them all, probably using the pattern that 
Stefan gave, but let’s do that in a separate issue.

--

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

Greg Smith & I are looking at this at the core dev sprint, and we think some 
variant of the "atomic until" idea should work, but there's a prerequisite 
change to the way "async with" works: the "GET_AWAITABLE" opcodes need to be 
avoided in this case, as they call __await__, and hence may run arbitrary 
Python code.

We can't see any immediate barriers to moving those calls up into 
BEFORE_ASYNC_WITH, such that what ends up on the eval loop's stack is the 
already resolved iterable for use by YIELD FROM, rather than combining 
GET_AWAITABLE+YIELD_FROM the way a normal await expression does.

That would then give the preamble:

BEFORE_ASYNC_WITH (resolves __aenter__ and __aexit__ to iterables)
LOAD_CONST 0
YIELD_FROM (need to skip signal processing here)
SETUP_ASYNC_WITH

And the postamble:

POP_BLOCK (need to skip signal processing until YIELD_FROM)
LOAD_CONST 0
WITH_CLEANUP_START
LOAD_CONST 0
YIELD_FROM
WITH_CLEANUP_FINISH

We also agree that adding some kind of test injection hook (potentially limited 
to pydebug builds, depending on exactly how it works) is likely to be a 
necessary to be able to test this.

--
stage:  -> test needed
type:  -> behavior

___
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 Eric Snow

Eric Snow added the comment:

> This mostly influences the Python interpreter start-up time
> (because of extensive use of ABCs in importlib)

Just to be clear, the only ABCs in importlib are in importlib.abc (and used by 
importlib.util).  This does not impact interpreter startup.

--
nosy: +eric.snow

___
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: +3326

___
Python tracker 

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



[issue31281] fileinput inplace does not work with pathlib.Path

2017-09-04 Thread Eric V. Smith

Eric V. Smith added the comment:

I did not backport this to 3.6, because it depends on other changes that 
themselves have not been backported.

--
assignee:  -> eric.smith
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions:  -Python 3.4, Python 3.5

___
Python tracker 

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



[issue31140] Insufficient error message with incorrect formated string literal

2017-09-04 Thread Eric V. Smith

Changes by Eric V. Smith :


--
stage:  -> needs patch

___
Python tracker 

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



[issue31140] Insufficient error message with incorrect formated string literal

2017-09-04 Thread Eric V. Smith

Changes by Eric V. Smith :


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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-04 Thread Eric Snow

Eric Snow added the comment:

> For now, this proposal is on hold because
> 1) it isn't clear that it should be done,
> 2) it needs a lot of serious discussion before proceeding,
> 3) it may be premature while the status of the regular dict
> is still in flux.

+1

When writing the C implementation my biggest constraint was compatibility with 
the Python implementation, including algorithmic complexity.  I'm in favor of 
making use of dict's new ordering, but it's not urgent and Raymond's concerns 
should be addressed first (particularly since the collections module is his).

--

___
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



[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



[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



[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



[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



[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



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


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



[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



[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



[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



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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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: +

___
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



[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



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


--
pull_requests: +3334

___
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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



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


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

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



[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



[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



[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



[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



[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



[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



  1   2   >