[issue32790] Keep trailing zeros in precision for string format option g

2018-02-08 Thread Mark Dickinson

Mark Dickinson  added the comment:

The behaviour here is intentional, though the reasons for doing it this way are 
at least partly historical: it's the way that %g formatting works in C's 
*printf functions (see C99 7.19.6.1p8 for details), and as a direct result of 
that it's also the way that old-style %-based formatting works in Python. That 
behaviour then got transferred to the new-style .format-based formatting for 
consistency.

I don't think we can or should change the current behaviour here: there's a 
significant risk of breaking existing code.

However, note that C does offer an *alternate* mode for .g-style formatting, 
using the '#' character, and this is also available in Python's formatting, 
both %-based and format-based:

>>> "%.2g" % 0.1950
'0.2'
>>> "%#.2g" % 0.1950
'0.20'

and

>>> format(0.1950, '.2g')
'0.2'
>>> format(0.1950, '#.2g')
'0.20'

Does this meet your needs?

--
nosy: +eric.smith, mark.dickinson

___
Python tracker 

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



[issue32792] ChainMap should preserve order of underlying mappings

2018-02-08 Thread Raymond Hettinger

New submission from Raymond Hettinger :

This also applies to 3.6 because ChainMap can be used with OrderedDict.

--
components: Library (Lib)
messages: 311817
nosy: rhettinger
priority: normal
severity: normal
status: open
title: ChainMap should preserve order of underlying mappings
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32792] ChainMap should preserve order of underlying mappings

2018-02-08 Thread Raymond Hettinger

Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue32793] smtplib: duplicated debug message

2018-02-08 Thread TaoQingyun

New submission from TaoQingyun <845767...@qq.com>:

```
if self.debuglevel > 0:
self._print_debug('connect:', (host, port))
```
The above both in _get_socket and connect method, and connect also invoke 
_get_socket.

--
components: Library (Lib)
files: smtp.patch
keywords: patch
messages: 311818
nosy: qingyunha
priority: normal
severity: normal
status: open
title: smtplib: duplicated debug message
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47428/smtp.patch

___
Python tracker 

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



[issue32794] PyNumber_Float counterpart that doesn't accept strings

2018-02-08 Thread Mark Dickinson

New submission from Mark Dickinson :

Our abstract objects layer in the C-API includes PyNumber_Float [1], which is 
equivalent to a Python-level `float` call, including the behaviour of accepting 
strings. I'm not convinced that it's a particularly useful function: I suspect 
that it's more common to need to either convert a string to a float, or to 
convert a float-y object (i.e., something whose type implements __float__) to a 
float, but not both at once. The second need is precisely the one that most of 
the math module has: accept anything that implements __float__, but don't 
accept strings.

Yesterday I found myself writing the following code for a 3rd-party extension 
module:


static PyObject *
_validate_float(PyObject *value) {
double value_as_double;

/* Fast path: avoid creating a new object if it's not necessary. */
if (PyFloat_CheckExact(value)) {
Py_INCREF(value);
return value;
}

value_as_double = PyFloat_AsDouble(value);
if (value_as_double == -1.0 && PyErr_Occurred()) {
return NULL;
}
return PyFloat_FromDouble(value_as_double);
}


Would it be worth adding a new C-API level function that does essentially the 
above? The semantics of such a function seem clear cut. The major problem would 
be figuring out what to call it, since to me PyNumber_Float is the one obvious 
name for such behaviour, but it's already taken. :-)

Please note that I'm not suggesting removing / deprecating / changing the 
existing PyNumber_Float. That would amount to gratuitous breakage.


[1] https://docs.python.org/3.6/c-api/number.html#c.PyNumber_Float

--
components: Interpreter Core
messages: 311819
nosy: mark.dickinson
priority: normal
severity: normal
status: open
title: PyNumber_Float counterpart that doesn't accept strings
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue32795] subprocess.check_output() with timeout does not exit if child process does not generate output after timeout

2018-02-08 Thread Mike Lewis

New submission from Mike Lewis :

When using a timeout with check_output(), the call does not terminate unless 
the child process generates output after the timeout. Looking at the code, it 
appears there is a second call to communicate() after the timeout has happened, 
presumably to retrieve any remaining output. This call appears to hang until 
the child process generates output.

I have two test cases (for Python 2.7 / subprocess32 and Python 3 / subprocess 
respectively). They show the same behaviour, the Python 2.7 version has been 
reproduced on Ubuntu 16.04.3 and Centos 7 and the Python 3 version on Ubuntu 
16.043.

Each test case has a first example where bash executes a long sleep before 
generating output and where the timeout is not respected, and a second example 
that generates output at intervals and the timeout is respected.

Relevant code also attached below for reference:

then = time.time()
print("Subprocess with idle stdout at timeout: start at {}".format(then))
try:
output = subprocess.check_output(["bash", "-c",
"echo Subcall; sleep 5; echo Done;"],
   stderr=subprocess.STDOUT, timeout=1)
now = time.time()
print("Finish at: {}, {:.0f} seconds".format(now, now-then))
print(output)
except subprocess.TimeoutExpired as te:
now = time.time()
print("Timed out at: {}, {:.0f} seconds".format(now, now-then))

then = time.time()
print("Generating stdout from subprocess: start at ", then)
try:
output = subprocess.check_output(["bash", "-c",
"echo Subcall; for i in 1 2 3 4 5; do 
sleep 1; echo $i; done; echo Done;"],
   stderr=subprocess.STDOUT, timeout=1)
now = time.time()
print("Finish at: {}, {:.0f} seconds".format(now, now-then))
print(output)
except subprocess.TimeoutExpired as te:
now = time.time()
print("Timed out at: {}, {:.0f} seconds".format(now, now-then))

--
components: Library (Lib)
files: timeout_examples.tgz
messages: 311820
nosy: Mike Lewis
priority: normal
severity: normal
status: open
title: subprocess.check_output() with timeout does not exit if child process 
does not generate output after timeout
type: behavior
versions: Python 2.7, Python 3.5
Added file: https://bugs.python.org/file47429/timeout_examples.tgz

___
Python tracker 

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



[issue32795] subprocess.check_output() with timeout does not exit if child process does not generate output after timeout

2018-02-08 Thread Mike Lewis

Mike Lewis  added the comment:

Example of the output:

$ ./timeout.py
Subprocess with idle stdout at timeout: start at  1518081130.44
Timed out at: 1518081135.45, 5 seconds
Generating stdout from subprocess: start at  1518081135.45
Timed out at: 1518081136.47, 1 seconds

As you see, the 1 second timeout is respected in the second case where the 
child process is generating output.

--

___
Python tracker 

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



[issue32792] ChainMap should preserve order of underlying mappings

2018-02-08 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +ned.deily, serhiy.storchaka

___
Python tracker 

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



[issue32792] ChainMap should preserve order of underlying mappings

2018-02-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

An alternate implementation:

d = {}
for mapping in reversed(self.maps):
d.update(mapping)
return iter(d)

Unfortunately both implementations work only with hashable keys. In general 
case mappings may be not hashtables.

--

___
Python tracker 

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



[issue32794] PyNumber_Float counterpart that doesn't accept strings

2018-02-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Maybe use PyNumber_Check() to distinguish these two cases?

if (PyNumber_Check(obj))
return PyNumber_Float(obj);
PyErr_SetString(PyExc_TypeError, "not a number");
return NULL;

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32794] PyNumber_Float counterpart that doesn't accept strings

2018-02-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

For converting a string to a float there is PyFloat_FromString(). So that this 
part of functionality of PyNumber_Float() is redundant. In long perspective it 
would be worth to deprecate it.

--

___
Python tracker 

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



[issue32796] 3.8-dev definition not available

2018-02-08 Thread Jensen Taylor

New submission from Jensen Taylor :

I can't build with Python 3.8 yet on Travis-CI because of this

--
messages: 311825
nosy: Jensen Taylor
priority: normal
severity: normal
status: open
title: 3.8-dev definition not available
versions: Python 3.8

___
Python tracker 

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



[issue32796] 3.8-dev definition not available

2018-02-08 Thread Christian Heimes

Christian Heimes  added the comment:

3.8 is master branch.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue32796] 3.8-dev definition not available

2018-02-08 Thread Christian Heimes

Christian Heimes  added the comment:

I'm not sure I follow. Are you having trouble to locate the 3.8 branch or are 
you missing 3.8-dev on Travis CI? The 3.8 branch is the master branch. Python 
upstream development does not provide dev builds for Travis CI. Please report 
the issue with Travis CI. There is nothing we can do from our side.

By the way, you won't be able to compile TLS/SSL support on Travis CI. Python 
3.7 requires OpenSSL >= 1.0.2 but Ubuntu 14.04 has only 1.0.1.

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

___
Python tracker 

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



[issue32796] 3.8-dev definition not available

2018-02-08 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

I think you meant to file this on pyenv, which is the tool that travis needs to 
have updated to know about 3.8 before they can start providing builds. Their 
bug tracker is here: https://github.com/pyenv/pyenv/issues

--
nosy: +njs

___
Python tracker 

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



[issue32797] Tracebacks from Cython modules no longer work

2018-02-08 Thread Jeroen Demeyer

New submission from Jeroen Demeyer :

Displaying the source code in tracebacks for Cython-compiled extension modules 
in IPython no longer works due to PEP 302. Various fixes are possible, the two 
most obvious ones are:

1. linecache should continue searching for the source file even if 
loader.get_source() returns None.

2. the method ExtensionFileLoader.get_source() should be removed (instead of 
being implemented and returning None).

Now why was this broken and how do the above fix that?

When IPython needs to display a traceback, it uses linecache.getlines() to get 
the source code to display. For Cython extensions, the filename is a correct 
*relative* filename (it must be a relative filename since Cython does not know 
where the sources will be after installation).

Since the filename is relative, linecache does not immediately find it, so it 
looks for a PEP 302 loader. For extension modules (Cython or not), it finds an 
instance of ExtensionFileLoader. If the loader has a get_source() method, then 
it uses that to get the sources. Since ExtensionFileLoader.get_source() returns 
None, linecache stops looking further for sources.

Instead, what should happen is that linecache continues looking for the sources 
in sys.path where it has a chance of finding them (if they are installed 
somewhere in sys.path).

--
components: Library (Lib)
messages: 311829
nosy: erik.bray, jdemeyer
priority: normal
severity: normal
status: open
title: Tracebacks from Cython modules no longer work

___
Python tracker 

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



[issue32585] Add ttk::spinbox to tkinter.ttk

2018-02-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

All tests are passed.

Ned, is it possible to get this feature in 3.7? I didn't have possibility to 
merge it before 3.7b1. This is just an addition of a simple class. It should be 
added years ago, it was not added before just due to oversight. This doesn't 
affect any other code, but may be used in future enhancements of IDLE.

--
nosy: +ned.deily

___
Python tracker 

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



[issue32790] Keep trailing zeros in precision for string format option g

2018-02-08 Thread Severin Wünsch

Severin Wünsch  added the comment:

This meet my needs.

Maybe the documentation could also add this information in the chart for 'g' 
here: 
https://docs.python.org/3.7/library/string.html#format-specification-mini-language
 as only into the running text. As I did not notice it.

As the text in the table for 'g' is already long, if you do not want to add all 
the same information again, add at least that trailing zeros will get removed.

--

___
Python tracker 

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



[issue32798] mmap.flush() on Linux does not accept the "offset" and "size" args

2018-02-08 Thread Byron Hawkins

New submission from Byron Hawkins :

open_file = open("file.txt", "r+b")
file_map = mmap.mmap(open_file, 0)
file_map.seek(offset)
file_map.write("foobar") # success
file_map.flush() # success
file_map.flush(offset, len("foobar")) # Fails with "errno 22"

This example passes correct arguments to mmap.flush(), yet it fails with errno 
22. So the arguments are not valid on linux. If the bug cannot be fixed, then 
all reference to those two arguments should be removed from the code and 
documentation related to Linux.

--
components: Library (Lib)
messages: 311832
nosy: byronhawkins
priority: normal
severity: normal
status: open
title: mmap.flush() on Linux does not accept the "offset" and "size" args
type: crash
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



[issue32798] mmap.flush() on Linux does not accept the "offset" and "size" args

2018-02-08 Thread Christian Heimes

Christian Heimes  added the comment:

offset must be a multiple of pagesize. This is a known but undocumented 
restriction on some platforms, see 
http://man7.org/linux/man-pages/man2/msync.2.html

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +christian.heimes, docs@python
priority: normal -> low
type: crash -> behavior
versions: +Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32798] mmap.flush() on Linux does not accept the "offset" and "size" args

2018-02-08 Thread Christian Heimes

Christian Heimes  added the comment:

I'm marking this as a low priority and simple documentation bug. The mmap 
module exposes the page size of the architecture as mmap.PAGESIZE.

--
keywords: +easy

___
Python tracker 

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



[issue32798] mmap.flush() on Linux does not accept the "offset" and "size" args

2018-02-08 Thread Byron Hawkins

Byron Hawkins  added the comment:

Couldn't the implementation check the page size and throw a better error (for 
relevant platforms)? Or better yet, adjust the offset to the nearest inclusive 
page boundary.

--

___
Python tracker 

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



[issue32799] returned a result with an error set

2018-02-08 Thread Eli Ribble

New submission from Eli Ribble :

We've had about 200 occurrences of this error in various parts of our code. I 
have captured stack traces using sentry so I may be able to provide more detail 
if requested. The ultimate problem is that a SystemError is raised from within 
contextlib. The message of the SystemError is:

" returned a result with an error 
set"

The code, according to sentry, that is emitting this error is:

python3.6/contextlib.py in helper at line 159

"""
@wraps(func)
def helper(*args, **kwds):
>return _GeneratorContextManager(func, args, kwds)
return helper

I'm reporting this bug primarily because of the documentation at 
https://docs.python.org/3/library/exceptions.html#SystemError and I'm using 
CPython

--
components: Library (Lib)
files: Screen Shot 2018-02-08 at 8.28.00 AM.png
messages: 311836
nosy: EliRibble
priority: normal
severity: normal
status: open
title:  returned a result with an 
error set
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47430/Screen Shot 2018-02-08 at 8.28.00 
AM.png

___
Python tracker 

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



[issue32800] Replace deprecated link to new page on w3c site

2018-02-08 Thread sblondon

New submission from sblondon :

The documentation about namespace of ElemenTree 
(https://docs.python.org/3/library/xml.etree.elementtree.html#parsing-xml-with-namespaces)
 has a link for 'default namespace' to 
'https://www.w3.org/TR/2006/REC-xml-names-20060816/#defaulting'.
This page displays a big red message because the page is outdated. It can be 
replaced by the new one: https://www.w3.org/TR/xml-names/#defaulting

The content of the paragraph in the new version is equivalent to the old one.


I can provide a PR if you are interested.

--
assignee: docs@python
components: Documentation
messages: 311837
nosy: docs@python, sblondon
priority: normal
severity: normal
status: open
title: Replace deprecated link to new page on w3c site
type: enhancement

___
Python tracker 

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



[issue32801] Lib/_strptime.py: utilize all()

2018-02-08 Thread Дилян Палаузов

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

diff --git a/Lib/_strptime.py b/Lib/_strptime.py
--- a/Lib/_strptime.py
+++ b/Lib/_strptime.py
@@ -238,10 +238,7 @@ class TimeRE(dict):
 
 """
 to_convert = sorted(to_convert, key=len, reverse=True)
-for value in to_convert:
-if value != '':
-break
-else:
+if all(value == '' for value in to_convert):
 return ''
 regex = '|'.join(re_escape(stuff) for stuff in to_convert)
 regex = '(?P<%s>%s' % (directive, regex)

--
components: Library (Lib)
messages: 311838
nosy: dilyan.palauzov
priority: normal
severity: normal
status: open
title: Lib/_strptime.py: utilize all()
versions: Python 3.8

___
Python tracker 

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



[issue30688] support named Unicode escapes (\N{name}) in re

2018-02-08 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +5405

___
Python tracker 

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



[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-08 Thread INADA Naoki

INADA Naoki  added the comment:

I'm sorry, my patch doesn't work on Xcode (Apple LLVM).
computed-gotos is still enabled by default.

Apple doesn't expose LLVM version.  It's really annoying.

$ cat x.c
#include 

int main()
{
printf("__clang__ : %d\n", __clang__);
printf("__llvm__ : %d\n", __llvm__);
printf("__VERSION__ : %s\n", __VERSION__);
printf("__clang_version__ : %s\n", __clang_version__);
printf("__clang_major__   : %d\n", __clang_major__);
printf("__clang_minor__   : %d\n", __clang_minor__);
printf("__clang_patchlevel__ : %d\n", __clang_patchlevel__);
}

$ cc x.c && ./a.out
__clang__ : 1
__llvm__ : 1
__VERSION__ : 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)
__clang_version__ : 9.0.0 (clang-900.0.39.2)
__clang_major__   : 9
__clang_minor__   : 0
__clang_patchlevel__ : 0

--
resolution: fixed -> 
stage: resolved -> 
status: closed -> pending

___
Python tracker 

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



[issue32799] returned a result with an error set

2018-02-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Since contextlib._GeneratorContextManager is implemented in Python, it is 
unlikely that it is a culprit of the error. Do you use any third-party 
extensions? Likely some extension provoked the error.

Can you provide a minimal script that reproduces the issue?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32802] Travis does not compile Python if there is one change in the Documentation

2018-02-08 Thread Stéphane Wirtel

New submission from Stéphane Wirtel :

If there is one .rst file in a commit, Travis does not compile Python, since 
this commit 
https://github.com/python/cpython/commit/b2ec3615c81ca4f3c938245842a45956da8d5acb
 

Here is a fix.

--
messages: 311841
nosy: matrixise
priority: normal
severity: normal
status: open
title: Travis does not compile Python if there is one change in the 
Documentation
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32802] Travis does not compile Python if there is one change in the Documentation

2018-02-08 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


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

___
Python tracker 

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



[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-08 Thread Zhiming Wang

Zhiming Wang  added the comment:

Yeah, Apple LLVM versions are a major headache. I resorted to feature 
detection, using C++ coroutines support as the clang 5 distinguisher[1]:

$ cat /tmp/test/stub.cc
#include 

int main() {
return 0;
}

$ 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 -v
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0
Thread model: posix
InstalledDir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

$ 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 -o stub stub.cc -fcoroutines-ts -stdlib=libc++
stub.cc:1:10: fatal error: 'experimental/coroutine' file not found
#include 
 ^~~~
1 error generated.

$ 
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 -v
Apple LLVM version 9.1.0 (clang-902.0.31)
Target: x86_64-apple-darwin17.4.0
Thread model: posix
InstalledDir: 
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

$ 
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 -o stub stub.cc -fcoroutines-ts -stdlib=libc++

Here Xcode.app is Xcode 9.2 and Xcode-beta.app is Xcode 9.3 beta 2.

The conclusion here seems to be that Apple LLVM 9.0.0 is based on LLVM 4, while 
Apple LLVM 9.1.0 is based on LLVM 5.

[1] 
http://releases.llvm.org/5.0.0/tools/clang/docs/ReleaseNotes.html#major-new-features

--
status: pending -> open

___
Python tracker 

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



[issue32802] Travis does not compile Python if there is one change in the Documentation

2018-02-08 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset 32921f90821ab54ffb757b7e996e5b7a71fac25e by Mariatta (Stéphane 
Wirtel) in branch 'master':
bpo-32802: Fix Travis build (GH-5589)
https://github.com/python/cpython/commit/32921f90821ab54ffb757b7e996e5b7a71fac25e


--
nosy: +Mariatta

___
Python tracker 

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



[issue32802] Travis does not compile Python if there is one change in the Documentation

2018-02-08 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5407

___
Python tracker 

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



[issue32802] Travis does not compile Python if there is one change in the Documentation

2018-02-08 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5408

___
Python tracker 

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



[issue32802] Travis does not compile Python if there is one change in the Documentation

2018-02-08 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Good catch! Thanks Stéphane.
I'm thinking it will be best for other PRs to rebase against this new travis 
configuration. But that seems like a lot of work...

--
assignee:  -> Mariatta
stage: patch review -> backport needed

___
Python tracker 

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



[issue8525] Display exception's subclasses in help()

2018-02-08 Thread Sanyam Khurana

Change by Sanyam Khurana :


--
assignee:  -> CuriousLearner
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue32794] PyNumber_Float counterpart that doesn't accept strings

2018-02-08 Thread Mark Dickinson

Mark Dickinson  added the comment:

> Maybe use PyNumber_Check() [...]

Ah, that works. It reads better than the `PyFloat_AsDouble` solution, too, 
since it's far from obvious that `PyFloat_AsDouble` goes to the trouble to 
coerce a float-y thing to a float.

I did some searching around to see if I could find evidence that anyone besides 
me thinks this is a good idea, but I didn't come up with much. In the NumPy 
source, for example, it's more common to want a C `double` than another Python 
object, and I guess that's going to be true for other 3rd party libraries, too.

And I'm also realising that part of what I need here is a *Python*-level 
solution to the problem, something like this:

def _validate_float(value):
"""
Coerce an arbitrary Python object to a float, or raise TypeError.
"""
if type(value) is float:  # fast path for common case
return value
try:
nb_float = type(value).__float__
except AttributeError:
raise TypeError(
"Object of type {!r} not coerceable to float".format(type(value)))
return nb_float(value)

(and the _validate_float I posted earlier was really just there because the C 
extension module needed to be able to do the same thing as the equivalent 
Python code above).

All in all, I don't think I can make a good case for this. I'll close the issue.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue32791] Add\Remove Programs entry is not created.

2018-02-08 Thread Steve Dower

Steve Dower  added the comment:

This is the same as issue25166

It can't be fixed easily (Wix doesn't actually support this), but I have some 
ideas that have been looking okayish. Still hoping to get it to work fully for 
3.7, but as it affects the installer we may not have enough time for testing to 
get it into this release.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Windows AllUsers installation places uninstaller in user profile

___
Python tracker 

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



[issue32790] Keep trailing zeros in precision for string format option g

2018-02-08 Thread Mark Dickinson

Mark Dickinson  added the comment:

> Maybe the documentation could also add this information in the chart for 'g' 
> here:

Agreed that that would make sense. All the information is *there* in the docs 
(the alternate format is described a bit above that table), but it's not very 
easy to extract the information.

And that table entry is misleading as it currently is, since it suggests that 
trailing zeros are removed unconditionally: "In both cases insignificant 
trailing zeros are removed from the significand, and the decimal point is also 
removed if there are no remaining digits following it."

Perhaps we could adopt something like the wording in the C standard, where it 
says:

> Finally, unless the # flag is used, any trailing zeros are removed
> from the fractional portion of the result and the decimal-point
> character is removed if there is no fractional portion remaining.

Re-classifying as a documentation issue.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python

___
Python tracker 

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



[issue32802] Travis does not compile Python if there is one change in the Documentation

2018-02-08 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset ad3997c592ee9b75fdcd44a0eaa51d748a2e2394 by Mariatta (Miss 
Islington (bot)) in branch '3.7':
bpo-32802: Fix Travis build (GH-5589) (GH-5590)
https://github.com/python/cpython/commit/ad3997c592ee9b75fdcd44a0eaa51d748a2e2394


--

___
Python tracker 

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



[issue32802] Travis does not compile Python if there is one change in the Documentation

2018-02-08 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset fe92c441519d0c4fc93bb98fc1bb4e225dea44c4 by Mariatta (Miss 
Islington (bot)) in branch '3.6':
bpo-32802: Fix Travis build (GH-5589) (GH-5591)
https://github.com/python/cpython/commit/fe92c441519d0c4fc93bb98fc1bb4e225dea44c4


--

___
Python tracker 

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



[issue32802] Travis does not compile Python if there is one change in the Documentation

2018-02-08 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Thanks!

--
resolution:  -> fixed
stage: backport needed -> 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



[issue8525] Display exceptions' subclasses in help()

2018-02-08 Thread ppperry

Change by ppperry :


--
title: Display exception's subclasses in help() -> Display exceptions' 
subclasses in help()

___
Python tracker 

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



[issue32799] returned a result with an error set

2018-02-08 Thread Eli Ribble

Eli Ribble  added the comment:

To my knowledge, no, we don't use any python extensions. Unless extensions can 
be installed via pip, in which case I would need to audit our many dependencies 
to determine if any of them ultimately pull in any extensions as part of a pip 
install.

I can't provide a minimal script, no, we don't reproduce it deterministically. 
Like I said, our application runs all the time and we appear to have about ~200 
instances where the problem has been caught by our uncaught exception handling 
system. The repro of the bug does not appear to have a set correlation with 
exercise of a particular feature or a particular application state. Given the 
exception is a thin wrapper around linux syscalls, my guess is something like 
select(), it's likely the issue has to do with transient network communication 
problems.

--

___
Python tracker 

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



[issue32690] Return function locals() in order of creation?

2018-02-08 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
pull_requests: +5409

___
Python tracker 

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



[issue32792] ChainMap should preserve order of underlying mappings

2018-02-08 Thread Ned Deily

Ned Deily  added the comment:

See discussion on PR 5586 regarding backporting to 3.6.x.

--
versions:  -Python 3.6

___
Python tracker 

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



[issue32585] Add ttk::spinbox to tkinter.ttk

2018-02-08 Thread Ned Deily

Ned Deily  added the comment:

It is past the feature code cutoff for 3.7.0 but the risks seem low and the 
benefit reasonably high.  Please make sure it is merged ASAP to allow time for 
buildbot exposure, etc, prior to 370b2.

--
stage: test needed -> commit review
versions: +Python 3.8

___
Python tracker 

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



[issue32803] smtplib: LMTP broken in the case of multiple RCPT

2018-02-08 Thread jasen betts

New submission from jasen betts :

smtplib's LMTP support is broken, 

 LMTP returns multiple responses at and of data if there have been multiple 
successful RCPT TO  commands, but smtplib::data() only looks for a single 
response.

see the example conversation on page 3 of RFC2033

This makes LMTP unusable if there is more than one RCPT

--
components: Library (Lib)
messages: 311854
nosy: jasen betts
priority: normal
severity: normal
status: open
title: smtplib: LMTP broken in the case of multiple RCPT
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32803] smtplib: LMTP broken in the case of multiple RCPT

2018-02-08 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

3.5 and 3.4 are in security fix only mode, so narrowing the relevant versions.

--
nosy: +barry
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



[issue32585] Add ttk::spinbox to tkinter.ttk

2018-02-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thank you Ned.

--

___
Python tracker 

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



[issue32585] Add ttk::spinbox to tkinter.ttk

2018-02-08 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5410
stage: commit review -> patch review

___
Python tracker 

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



[issue32585] Add ttk::spinbox to tkinter.ttk

2018-02-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset a48e78a0b7761dd74f1d03fc69e0f6caa6f02fe6 by Serhiy Storchaka 
(Alan D Moore) in branch 'master':
bpo-32585: Add tkinter.ttk.Spinbox. (#5221)
https://github.com/python/cpython/commit/a48e78a0b7761dd74f1d03fc69e0f6caa6f02fe6


--

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2018-02-08 Thread Ma Lin

Ma Lin  added the comment:

> What's about other OS/flags?
> Should we commit that every exposed socket flag is supported in runtime?
> It looks like very heavy burden.

Let alone run-time check. Flags only depend on .C code and the building SDK, 
therefore, for a certain official release (e.g. CPython 3.6.5), the flags are 
fixed.
Then it is possible to get a flag-snapshot of a certain official release.

I wrote a script to dump/compare these flags in some Windows related modules 
(written in C language), see attached file winsdk_watchdog.py.

Let me demonstrate how to use it:

> Comparing from A to B:
> A: 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)]
> B: 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)]
> 
> socket added 2 constants: {'TCP_KEEPCNT', 'TCP_FASTOPEN'}
> 
> Finished, 1 modules changed constants.

Comparing official 3.6.3 (1607 SDK) with official 3.6.4 (1703 SDK).
It caught the 2 flags lead to this issue.

> Comparing from A to B:
> A: 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)]
> B: 3.7.0b1 (v3.7.0b1:9561d7f, Jan 31 2018, 07:26:34) [MSC v.1900 64 bit 
> (AMD64)]
> 
> _winapi added 15 constants: {'NORMAL_PRIORITY_CLASS', 'FILE_TYPE_DISK', 
> 'IDLE_PRIORITY_C
> LASS', 'CREATE_DEFAULT_ERROR_MODE', 'CREATE_BREAKAWAY_FROM_JOB', 
> 'FILE_TYPE_PIPE', 'FILE
> _TYPE_REMOTE', 'BELOW_NORMAL_PRIORITY_CLASS', 'DETACHED_PROCESS', 
> 'FILE_TYPE_CHAR', 'REA
> LTIME_PRIORITY_CLASS', 'FILE_TYPE_UNKNOWN', 'ABOVE_NORMAL_PRIORITY_CLASS', 
> 'CREATE_NO_WI
> NDOW', 'HIGH_PRIORITY_CLASS'}
> 
> socket added 3 constants: {'TCP_KEEPIDLE', 'TCP_KEEPINTVL', 'MSG_ERRQUEUE'}
> 
> mmap added 1 constants: {'ACCESS_DEFAULT'}
> 
> Finished, 3 modules changed constants.

Comparing official 3.6.4 (1703 SDK) with official 3.7.0b1 (1709 SDK).

_winapi added 15 constants, after searching on GitHub repository, we know they 
were added in 2 commits:
https://github.com/python/cpython/commit/b5d9e0811463f3b28ba355a9e0bee7f1682854e3#diff-c5f7cb301f3746a4c77e8bcd91d9f897
https://github.com/python/cpython/commit/b2a6083eb0384f38839d3f1ed32262a3852026fa#diff-c5f7cb301f3746a4c77e8bcd91d9f897
So they can be ignored.

socket added 3 constants.
After exploring, we know the 2 flags (TCP_KEEPIDLE, TCP_KEEPINTVL) were added 
by 1709 SDK, so we need to handle them during run-time as well.
Another new flag MSG_ERRQUEUE was also added by 1709 SDK, we need a socket 
expert decide what to do.

mmap added 1 constants.
It was added in:
https://github.com/python/cpython/commit/5a8a84b34fbc385bf112819fe3b65503e33a33fa#diff-a8a9c2d912381058181c8ffe496aa39b
Also ignore it.

This check is only needed after switching to a newer Windows SDK. As the file 
name, it's a watchdog of Windows SDK.

Some people build third-party-build by themselves, it's also possible to create 
a unittest, and teach it how to recognize flexible-flags (may be removed during 
run-time).

For example, a man builds CPython 3.7.0b1 with 1607 SDK (official 3.7.0b1 build 
with 1709 SDK), then he got a prompt like this:

> These flags are missing in socket module:
> 'TCP_KEEPCNT', 'TCP_FASTOPEN', 'TCP_KEEPIDLE', 'TCP_KEEPINTVL', 'MSG_ERRQUEUE'
> Maybe you are using a older SDK than official release's, or these flags are 
> removed in this machine during run-time.

If he build CPython 3.7.0b1 with 1903 SDK in two years later, he may got prompt 
like this:

> Unknown flags appear in socket module:
> 'TCP_XX', 'TCP_YY', 'TCP_ZZ'
> They were added by newer Windows SDK, please make sure

--
Added file: https://bugs.python.org/file47431/winsdk_watchdog.py

___
Python tracker 

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



[issue32784] Wrong argument name for csv.DictReader in documentation

2018-02-08 Thread cowlinator

cowlinator  added the comment:

Hi, thanks for the quick action on this!

The documentation is still wrong for 3.5 .  I had selected 3.5 for the affected 
versions, but I guess it got removed?

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



[issue32784] Wrong argument name for csv.DictReader in documentation

2018-02-08 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

3.5 is for security fixes only now. We don't do documentation or regular bug 
fixes there anymore.

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



[issue32804] urllib.retrieve documentation doesn't mention context parameter

2018-02-08 Thread Julian O

New submission from Julian O :

In 2014, urlretrieve was changed to accept a context parameter to configure, 
for example, SSL settings.

Ref: 
https://github.com/python/cpython/commit/b206473ef8a7abe9abf5ab8776ea3bcb90adc747

However, 2.7.14 documentation does not mention this parameter.

> urllib.urlretrieve(url[, filename[, reporthook[, data]]])

Ref: https://docs.python.org/2/library/urllib.html

--
assignee: docs@python
components: Documentation
messages: 311861
nosy: docs@python, julian_o
priority: normal
severity: normal
status: open
title: urllib.retrieve documentation doesn't mention context parameter
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



[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-08 Thread INADA Naoki

INADA Naoki  added the comment:

How can we distinguish Apple LLVM with LLVM easily?
Or should we disable computed-gotos by default on LLVM?

It's only for Python 2.
5x slowdown is too large comparing to 10% speedup.

--

___
Python tracker 

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



[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-08 Thread Ned Deily

Ned Deily  added the comment:

Can anyone explain what the difference is between 2.7 and 3.6, i.e. why there 
is the performance regression for 2.7 but not for 3.6 using the same compiler 
instance?  It would be better to understand and solve that problem rather than 
trying to special case compiler versions.

--

___
Python tracker 

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



[issue32642] add support for path-like objects in sys.path

2018-02-08 Thread Jay Yin

Jay Yin  added the comment:

what file(s) is/are the sys.path code located in?

--

___
Python tracker 

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



[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-08 Thread INADA Naoki

INADA Naoki  added the comment:

I don't know exactly.  But as far as I saw, Python 3's eval loop has less 
function-wide local variables.

For example, ROT_THREE uses only block local variable.
https://github.com/python/cpython/blob/a48e78a0b7761dd74f1d03fc69e0f6caa6f02fe6/Python/ceval.c#L1109-L

On the other hand, there are more function-wide local variables in Python 2.  
And some of them are used over `case`s actually.
https://github.com/python/cpython/blob/672fd7d8162f76aff8423fa5c7bfd2b1e91faf57/Python/ceval.c#L802-L807


I suspect that's why LLVM4 failed to optimize Python 2 but success to optimize 
Python 3.

--

___
Python tracker 

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



[issue32761] Create IDLE Modern Mac keyset

2018-02-08 Thread Ned Deily

Ned Deily  added the comment:

Terry, it would be better to get opinions from others who really use IDLE on 
macOS.  But, FWIW:

- I agree with Raymond that Ctrl-A makes much more sense as the default for 
beginning of line for the reasons he cites.

- Command-A is appropriate for select-all.

- Should the Classic Mac keyset be removed?  Probably

- Designing a more modern macOS keyset is probably still a good idea (but I'm 
not volunteering to do it!)

--

___
Python tracker 

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



[issue32804] urllib.retrieve documentation doesn't mention context parameter

2018-02-08 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

effectively, there is no documentation about this new parameter.

--
nosy: +matrixise

___
Python tracker 

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



[issue32804] urllib.retrieve documentation doesn't mention context parameter

2018-02-08 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
keywords: +easy

___
Python tracker 

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