[issue28223] test_tools fails with timeout on AMD64 Snow Leop 3.x buildbot

2016-09-21 Thread STINNER Victor

New submission from STINNER Victor:

I recently changed the buildbot timeout from 900 seconds (15 min) to 1200 
seconds  (20 min) in Makefile.pre.in in the default branch, but it seems like 
some buildbots override the timeout.

For example, AMD64 Snow Leop 3.x uses TESTTIMEOUT=900 whereas test_tools fails 
with a timeout on this buildbot :-)

If the timeout is overriden, I suggest to use a timeout of at least 30 min on 
slow buildbots.

--
components: Tests
messages: 277100
nosy: haypo, zach.ware
priority: normal
severity: normal
status: open
title: test_tools fails with timeout on AMD64 Snow Leop 3.x buildbot
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



[issue28176] Fix callbacks race in asyncio.SelectorLoop.sock_connect

2016-09-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 06efc625578a by Victor Stinner in branch '3.5':
test_asynico: fix test_sock_connect_sock_write_race()
https://hg.python.org/cpython/rev/06efc625578a

--

___
Python tracker 

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



[issue28224] Compilation warnings on Windows: export 'PyInit_xx' specified multiple times

2016-09-21 Thread STINNER Victor

New submission from STINNER Victor:

I like when a compilation has no warning, because it helps to notice useful 
warnings and real bugs. The compilation of Python 3.5 on Windows emits the 
following warnings on buildbots:

xxmodule.obj : warning LNK4197: export 'PyInit_xx' specified multiple times; 
using first specification
xxmodule.obj : warning LNK4197: export 'PyInit_xx' specified multiple times; 
using first specification
xxmodule.obj : warning LNK4197: export 'PyInit_xx' specified multiple times; 
using first specification

http://buildbot.python.org/all/builders/AMD64%20Windows8%203.5/builds/1120/steps/test/logs/warnings%20%283%29

http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x/builds/2634/steps/test/logs/warnings%20%283%29

--
components: Build, Windows
messages: 277102
nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Compilation warnings on Windows: export 'PyInit_xx' specified multiple 
times
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue28224] Compilation warnings on Windows: export 'PyInit_xx' specified multiple times

2016-09-21 Thread STINNER Victor

STINNER Victor added the comment:

It seems like the warnings come from test_distutils:
-
0:05:09 [ 44/405] test_distutils failed (env changed) (38 sec)
xxmodule.c
xxmodule.obj : warning LNK4197: export 'PyInit_xx' specified multiple times; 
using first specification
   Creating library 
D:\Temp\tmp_crvgs9y\Debug\Temp\tmp_crvgs9y\xx_d.cp37-win_amd64.lib and object 
D:\Temp\tmp_crvgs9y\Debug\Temp\tmp_crvgs9y\xx_d.cp37-win_amd64.exp
LINK : /LTCG specified but no code generation required; remove /LTCG from the 
link command line to improve linker performance
foo.c
   Creating library 
D:\Temp\tmpnq__9cbm\tempt\Temp\tmpfv6uys06\foo_d.cp37-win_amd64.lib and object 
D:\Temp\tmpnq__9cbm\tempt\Temp\tmpfv6uys06\foo_d.cp37-win_amd64.exp
LINK : /LTCG specified but no code generation required; remove /LTCG from the 
link command line to improve linker performance
foo.c
   Creating library 
D:\Temp\tmpnq__9cbm\tempt\Temp\tmpfv6uys06\foo_d.cp37-win_amd64.lib and object 
D:\Temp\tmpnq__9cbm\tempt\Temp\tmpfv6uys06\foo_d.cp37-win_amd64.exp
LINK : /LTCG specified but no code generation required; remove /LTCG from the 
link command line to improve linker performance
xxmodule.c
xxmodule.obj : warning LNK4197: export 'PyInit_xx' specified multiple times; 
using first specification
   Creating library 
D:\Temp\tmp8n1b1bh8\Debug\Temp\tmp8n1b1bh8\xx_d.cp37-win_amd64.lib and object 
D:\Temp\tmp8n1b1bh8\Debug\Temp\tmp8n1b1bh8\xx_d.cp37-win_amd64.exp
LINK : /LTCG specified but no code generation required; remove /LTCG from the 
link command line to improve linker performance
foo.c
   Creating library 
D:\Temp\tmpk47tprte\tempt\Temp\tmpe3sksr_y\foo_d.cp37-win_amd64.lib and object 
D:\Temp\tmpk47tprte\tempt\Temp\tmpe3sksr_y\foo_d.cp37-win_amd64.exp
LINK : /LTCG specified but no code generation required; remove /LTCG from the 
link command line to improve linker performance
foo.c
   Creating library 
D:\Temp\tmpk47tprte\tempt\Temp\tmpe3sksr_y\foo_d.cp37-win_amd64.lib and object 
D:\Temp\tmpk47tprte\tempt\Temp\tmpe3sksr_y\foo_d.cp37-win_amd64.exp
LINK : /LTCG specified but no code generation required; remove /LTCG from the 
link command line to improve linker performance
xxmodule.c
xxmodule.obj : warning LNK4197: export 'PyInit_xx' specified multiple times; 
using first specification
   Creating library 
build\temp.win-amd64-3.7-pydebug\Debug\xx_d.cp37-win_amd64.lib and object 
build\temp.win-amd64-3.7-pydebug\Debug\xx_d.cp37-win_amd64.exp
LINK : /LTCG specified but no code generation required; remove /LTCG from the 
link command line to improve linker performance

D:\buildarea\3.x.bolen-windows8\build\build\test_python_3476>exit 1 

D:\buildarea\3.x.bolen-windows8\build\build\test_python_3476>exit 0
-

By the way, test_distutils failed because of "env changed" but the changed 
environment is not logged :-( See my related issue #27829 for the missing 
warning.

--

___
Python tracker 

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



[issue28222] test_distutils fails

2016-09-21 Thread Xiang Zhang

Xiang Zhang added the comment:

The reason for this failure is lack of pygments. docutils seems to require 
pygments when parsing code block even in doc. But docutils doesn't treat 
pygments as a dependency and pip install it won't pull in pygments.

--

___
Python tracker 

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



[issue28225] bz2 does not support pathlib

2016-09-21 Thread Ethan Furman

Changes by Ethan Furman :


--
files: open-bz2.stoneleaf.patch
keywords: patch
nosy: brett.cannon, ethan.furman
priority: normal
severity: normal
stage: patch review
status: open
title: bz2 does not support pathlib
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file44767/open-bz2.stoneleaf.patch

___
Python tracker 

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



[issue28226] compileall does not support pathlib

2016-09-21 Thread Ethan Furman

Changes by Ethan Furman :


--
files: open-compileall.stoneleaf.patch
keywords: patch
nosy: brett.cannon, ethan.furman
priority: normal
severity: normal
stage: patch review
status: open
title: compileall does not support pathlib
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file44768/open-compileall.stoneleaf.patch

___
Python tracker 

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



[issue28227] gzip does not support pathlib

2016-09-21 Thread Ethan Furman

Changes by Ethan Furman :


--
files: open-gzip.stoneleaf.patch
keywords: patch
nosy: brett.cannon, ethan.furman
priority: normal
severity: normal
stage: patch review
status: open
title: gzip does not support pathlib
type: behavior
Added file: http://bugs.python.org/file44769/open-gzip.stoneleaf.patch

___
Python tracker 

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



[issue28228] imghdr does not support pathlib

2016-09-21 Thread Ethan Furman

Changes by Ethan Furman :


--
files: open-imghdr.stoneleaf.patch
keywords: patch
nosy: brett.cannon, ethan.furman
priority: normal
severity: normal
stage: patch review
status: open
title: imghdr does not support pathlib
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file44770/open-imghdr.stoneleaf.patch

___
Python tracker 

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



[issue28229] lzma does not support pathlib

2016-09-21 Thread Ethan Furman

Changes by Ethan Furman :


--
files: open-lzma.stoneleaf.patch
keywords: patch
nosy: brett.cannon, ethan.furman
priority: normal
severity: normal
stage: patch review
status: open
title: lzma does not support pathlib
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file44771/open-lzma.stoneleaf.patch

___
Python tracker 

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



[issue28201] dict: perturb shift should be done when first conflict

2016-09-21 Thread INADA Naoki

INADA Naoki added the comment:

josh.r:

>  I believe per PEP7, we're still sticking to ANSI C (aka C89), and 
> specifically, "all declarations must be at the top of a block (not 
> necessarily at the top of function".

Python 3.6 branch allows some C99 features.
https://www.python.org/dev/peps/pep-0007/#c-dialect

> Removing those unrelated changes looks like it would dramatically reduce the 
> churn too, making review easier.

While I think refactoring around changes is practical [1], I agree that I made 
too much change.  I'll reduce diff size.

[1] Changing without refactoring is hard sometimes. Whole file refactoring
without actual change may cause many conflicts against other patches.

--

___
Python tracker 

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



[issue28230] tarfile does not support pathlib

2016-09-21 Thread Ethan Furman

Changes by Ethan Furman :


--
files: open-tarfile.stoneleaf.patch
keywords: patch
nosy: brett.cannon, ethan.furman
priority: normal
severity: normal
stage: patch review
status: open
title: tarfile does not support pathlib
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file44772/open-tarfile.stoneleaf.patch

___
Python tracker 

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



[issue28231] zipfile does not support pathlib

2016-09-21 Thread Ethan Furman

Changes by Ethan Furman :


--
files: open-zipfile.stoneleaf.patch
keywords: patch
nosy: brett.cannon, ethan.furman
priority: normal
severity: normal
stage: patch review
status: open
title: zipfile does not support pathlib
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file44773/open-zipfile.stoneleaf.patch

___
Python tracker 

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



[issue28225] bz2 does not support pathlib

2016-09-21 Thread Xiang Zhang

New submission from Xiang Zhang:

I opened a similar issue before: issue27511. Feel free to close it.

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue28232] asyncio: wrap_future() doesn't handle cancellation correctly

2016-09-21 Thread STINNER Victor

New submission from STINNER Victor:

I noticed the following warning in test_asyncio (see above). It understand that 
when the asyncio Future ("destination" in _chain_future) is cancelled, 
_call_check_cancel() calls source_loop.call_soon_threadsafe(source.cancel) 
where source is a concurrent.futures.Future object.

Then futures.Future.cancel() calls self._invoke_callbacks() which calls 
_call_set_state() of _chain_future(). _call_set_state() calls 
dest_loop.call_soon_threadsafe(_set_state, destination, source) but at this 
point, the event loop is closed. Morever, destination (the asyncio future) is 
already cancelled, but it doesn't make sense to try to copy the state: source 
and destination are already cancelled.

I suggest to modify _call_set_state() to do nothing if destination is already 
cancelled:

def _call_set_state(source):
if destination.cancelled():
return
(...)

*But* I see that futures.Future has a set_running_or_notify_cancel() method 
which seems to be important to call. Maybe we should call it in this case?

def _call_set_state(source):
if destination.cancelled():
source.set_running_or_notify_cancel()
return
(...)

--

The warning:


http://buildbot.python.org/all/builders/AMD64%20Windows8%203.6/builds/43/steps/test/logs/stdio

test_sock_sendall 
(test.test_asyncio.test_selector_events.BaseSelectorEventLoopTests) ... 
exception calling callback for 
Traceback (most recent call last):
  File "D:\buildarea\3.6.bolen-windows8\build\lib\concurrent\futures\_base.py", 
line 297, in _invoke_callbacks
callback(self)
  File "D:\buildarea\3.6.bolen-windows8\build\lib\asyncio\futures.py", line 
462, in _call_set_state
dest_loop.call_soon_threadsafe(_set_state, destination, source)
  File "D:\buildarea\3.6.bolen-windows8\build\lib\asyncio\base_events.py", line 
603, in call_soon_threadsafe
handle = self._call_soon(callback, args)
  File "D:\buildarea\3.6.bolen-windows8\build\lib\asyncio\base_events.py", line 
577, in _call_soon
self._check_closed()
  File "D:\buildarea\3.6.bolen-windows8\build\lib\asyncio\base_events.py", line 
356, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
ok

--
components: asyncio
messages: 277107
nosy: gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: asyncio: wrap_future() doesn't handle cancellation correctly
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue28203] complex() gives wrong error when the second argument has an invalid type

2016-09-21 Thread Mark Dickinson

Mark Dickinson added the comment:

Thanks. I'll apply this shortly (but probably not before the weekend).

--
assignee:  -> mark.dickinson

___
Python tracker 

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



[issue28231] zipfile does not support pathlib

2016-09-21 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Shouldn't the ZipFile.filename attribute be converted to str?

If add support of pathlib, maybe add support of bytes?

The file name of ZipFile is only a part of the issue. There are other uses of 
file paths: paths for added files, path for extracted directory.

And there are internal paths in zip archive. Maybe it is worth to introduce new 
path-like type for them and provide pathlib-like interface to ZipFile. But this 
is separate not easy 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



[issue28230] tarfile does not support pathlib

2016-09-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28227] gzip does not support pathlib

2016-09-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28227] gzip does not support pathlib

2016-09-21 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Since patches for gzip, bz2 and lzma are too similar, I think it is worth to 
merge them in one patch.

--

___
Python tracker 

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



[issue28228] imghdr does not support pathlib

2016-09-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28228] imghdr does not support pathlib

2016-09-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue28214] Improve exception reporting for problematic __set_name__ attributes

2016-09-21 Thread Nick Coghlan

Nick Coghlan added the comment:

Good catch Serhiy - I'd completely missed that in the original review, and 
definitely agree we should make that fix independently of the exception 
chaining idea.

While that correction will fix the specific __getattr__ example given, we still 
have the problem of actual errors in looking up __set_name__ on the class (e.g. 
in a metaclass or in __getattribute__) and errors when calling it being hard to 
debug, as the traceback will point to the class header without giving the name 
of the offending attribute.

--

___
Python tracker 

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



[issue28221] Unused indata in test_ssl.ThreadedTests.test_asyncore_server

2016-09-21 Thread Christian Heimes

Christian Heimes added the comment:

Thanks for your investigation.

--
assignee: christian.heimes -> 

___
Python tracker 

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



[issue27990] Provide a way to enable getrandom on Linux even when build system runs an older kernel

2016-09-21 Thread Nick Coghlan

Nick Coghlan added the comment:

I'm happy to close this as not even being a bug - the Fedora Python maintainers 
found that it was only specifically 3.5.1 that wasn't finding the necessary 
header files in the Fedora build root (and hence not even trying the syscall), 
while 3.5.0 and 3.5.2 were both fine.

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

___
Python tracker 

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



[issue27010] email library could "recover" from bad mime boundary like (some?) email clients do

2016-09-21 Thread Andrea De Pasquale

Andrea De Pasquale added the comment:

To provide additional context, Microsoft has patched his Outlook client to be 
RFC2046-compliant. More details below:

http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-3366
https://technet.microsoft.com/library/security/MS16-107
http://www.certego.net/en/news/badepilogue-the-perfect-evasion/

--

___
Python tracker 

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



[issue27292] Warn users that os.urandom() prior to 3.6 can return insecure values

2016-09-21 Thread Nick Coghlan

Nick Coghlan added the comment:

With the 3.6 os.urandom() implementation doing the right thing consistently 
cross-platform, our guidance for folks that care about the quality of the 
CSPRNG they use should be that they either upgrade to that version, or else 
ensure that the kernel CSPRNG is properly seeded before they run Python.

That is, I think the tone we're aiming for in the older docs now should be 
"You're using an older Python version, so if this problem description worries 
you, you need to either upgrade or else take the necessary steps to satisfy 
yourself that your host system's CSPRNG is properly configured", rather than 
the more passive "os.urandom() isn't necessarily secure" (with minimal guidance 
on what to do about it) that we've previously adopted.

--

___
Python tracker 

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



[issue28201] dict: perturb shift should be done when first conflict

2016-09-21 Thread INADA Naoki

Changes by INADA Naoki :


Added file: http://bugs.python.org/file44774/dict-perturb-shift.patch

___
Python tracker 

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



[issue28224] Compilation warnings on Windows: export 'PyInit_xx' specified multiple times

2016-09-21 Thread Jeremy Kloth

Jeremy Kloth added the comment:

This is a known bug when compiling 64-bit extension modules.

http://bugs.python.org/issue9709
http://bugs.python.org/issue16779
http://bugs.python.org/issue20166

--
nosy: +jkloth

___
Python tracker 

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



[issue26513] platform.win32_ver() broken in 2.7.11

2016-09-21 Thread Alex R. Hoyling

Alex R. Hoyling added the comment:

|| We now use 'product_type' on 3.5+ and 'product' on 2.7, so we should be good.

It actually looks like we use `product_type` on Python 2.7.12, not `product`.

On Python 2.7.12, on Windows Server 2008 R2:

  >>> import sys
  >>> sys.getwindowsversion().product
  Traceback (most recent call last):
File "", line 1, in 
  AttributeError: 'sys.getwindowsversion' object has no attribute 'product'
  >>> sys.getwindowsversion().product_type
  3

This would cause `platform.release()` to output '7' instead of '2008ServerR2'.

I don't think this issue is resolved.

--
nosy: +arhoyling

___
Python tracker 

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



[issue28233] PyUnicode_FromFormatV can leak PyUnicodeWriter

2016-09-21 Thread Christian Heimes

New submission from Christian Heimes:

PyUnicode_FromFormatV() does not call _PyUnicodeWriter_Finish() in p > 127 case 
and therefore leaks a PyUnicodeWriter instance.

--
components: Interpreter Core
messages: 277118
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: PyUnicode_FromFormatV can leak PyUnicodeWriter
type: resource usage
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue26513] platform.win32_ver() broken in 2.7.11

2016-09-21 Thread Alex R. Hoyling

Alex R. Hoyling added the comment:

In fact, at the tip of the 2.7 branch in `sysmodule.c` we have:

static PyStructSequence_Field windows_version_fields[] = {
{"major", "Major version number"},
{"minor", "Minor version number"},
{"build", "Build number"},
{"platform", "Operating system platform"},
{"service_pack", "Latest Service Pack installed on the system"},
{"service_pack_major", "Service Pack major version number"},
{"service_pack_minor", "Service Pack minor version number"},
{"suite_mask", "Bit mask identifying available product suites"},
{"product_type", "System product type"},
{0}
};

https://hg.python.org/cpython/file/2.7/Python/sysmodule.c

--

___
Python tracker 

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



[issue28233] PyUnicode_FromFormatV can leak PyUnicodeWriter

2016-09-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +haypo, serhiy.storchaka

___
Python tracker 

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



[issue27990] Provide a way to enable getrandom on Linux even when build system runs an older kernel

2016-09-21 Thread STINNER Victor

STINNER Victor added the comment:

Oh it's strange that only 3.5.1 has the issue. Happy to read that the
problem is already solved!

--

___
Python tracker 

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



[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-21 Thread py.user

New submission from py.user:

https://docs.python.org/3/library/xml.etree.elementtree.html#reference

1. Comment
2. iselement()
3. ProcessingInstruction
4. SubElement
5. Element.find()
6. ElementTree._setroot()
7. TreeBuilder

Applied a patch to the issue that adds Element class links.

--
assignee: docs@python
components: Documentation, Library (Lib), XML
files: element-link.diff
keywords: patch
messages: 277121
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In xml.etree.ElementTree docs there are many absent Element class links
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file44775/element-link.diff

___
Python tracker 

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



[issue27990] Provide a way to enable getrandom on Linux even when build system runs an older kernel

2016-09-21 Thread Petr Viktorin

Petr Viktorin added the comment:

Indeed, I'd close WONTFIX.

IMO, applications that:
- run at early boot, and
- get built with an older kernel than they run on
fall squarely into the enterprise distro turf, and CPython code shouldn't 
include hacks needed to make this work. That's not to say I'm opposed to 
collaboration if anyone else needs to solve this problem – quite the opposite. 
But I think a vendor-specific patch is the right layer here.

As currently documented, the getrandom call is not used on older kernels.

(Btw, no, it's not easy for *me* to help upgrading Fedora builders. But I can 
easily maintain a vendor patch for Python, if it comes to that.)

--

___
Python tracker 

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



[issue27990] Provide a way to enable getrandom on Linux even when build system runs an older kernel

2016-09-21 Thread Petr Viktorin

Petr Viktorin added the comment:

(Please ignore that comment – I was on vacation and, when clearing my backlog, 
got to this issue before the Fedora discussions.)

--

___
Python tracker 

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



[issue28235] In xml.etree.ElementTree docs there is no parser argument in fromstring()

2016-09-21 Thread py.user

New submission from py.user:

https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.fromstring

The function has argument parser that works like in XML() function, but in the 
description there is no info about it (copied from XML() description).

Applied a patch to the issue that adds argument to the signature and describes 
it.

--
assignee: docs@python
components: Documentation, Library (Lib), XML
files: fromstring-parser.diff
keywords: patch
messages: 277124
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In xml.etree.ElementTree docs there is no parser argument in fromstring()
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file44776/fromstring-parser.diff

___
Python tracker 

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



[issue28236] In xml.etree.ElementTree Element can be created with empty and None tag

2016-09-21 Thread py.user

New submission from py.user:

It is possible to create and serialize an Element instance with empty string 
tag value:

>>> import xml.etree.ElementTree as etree
>>>
>>> root = etree.Element('')
>>> elem = etree.SubElement(root, '')
>>>
>>> root

>>> elem

>>>
>>> etree.tostring(root)
b'<>< />'
>>> etree.dump(root)
<>< />
>>>


It is possible to create and serialize an Element instance with None tag value:

>>> import xml.etree.ElementTree as etree
>>>
>>> root = etree.Element(None)
>>> elem = etree.SubElement(root, None)
>>>
>>> root

>>> root[0]

>>> len(root)
1
>>> etree.tostring(root)
b''
>>> etree.dump(root)

>>>


And same try with site package lxml raises an exception both for empty string 
and for None:

>>> import lxml.etree
>>>
>>> lxml.etree.Element('')
Traceback (most recent call last):
  File "", line 1, in 
  File "lxml.etree.pyx", line 2809, in lxml.etree.Element 
(src/lxml/lxml.etree.c:61393)
  File "apihelpers.pxi", line 87, in lxml.etree._makeElement 
(src/lxml/lxml.etree.c:13390)
  File "apihelpers.pxi", line 1446, in lxml.etree._getNsTag 
(src/lxml/lxml.etree.c:25978)
  File "apihelpers.pxi", line 1481, in lxml.etree.__getNsTag 
(src/lxml/lxml.etree.c:26304)
ValueError: Empty tag name
>>>
>>> lxml.etree.Element(None)
Traceback (most recent call last):
  File "", line 1, in 
  File "lxml.etree.pyx", line 2809, in lxml.etree.Element 
(src/lxml/lxml.etree.c:61393)
  File "apihelpers.pxi", line 87, in lxml.etree._makeElement 
(src/lxml/lxml.etree.c:13390)
  File "apihelpers.pxi", line 1446, in lxml.etree._getNsTag 
(src/lxml/lxml.etree.c:25978)
  File "apihelpers.pxi", line 1464, in lxml.etree.__getNsTag 
(src/lxml/lxml.etree.c:26114)
  File "apihelpers.pxi", line 1342, in lxml.etree._utf8 
(src/lxml/lxml.etree.c:24770)
TypeError: Argument must be bytes or unicode, got 'NoneType'
>>>

--
components: Library (Lib), XML
messages: 277125
nosy: py.user
priority: normal
severity: normal
status: open
title: In xml.etree.ElementTree Element can be created with empty and None tag
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue28042] Coverity Scan defects in new dict code

2016-09-21 Thread Christian Heimes

Christian Heimes added the comment:

The warnings are false positives. Coverity does not understand the relationship 
between dict size and union members. I have closed all issues related to 
DK_ENTRIES().

There is still one issue left that seems worth looking into:

15. negative_return_fn: Function lookdict_index(mp->ma_keys, ep->me_hash, i) 
returns a negative number. [show details]
16. var_assign: Assigning: signed variable j = lookdict_index.
2862j = lookdict_index(mp->ma_keys, ep->me_hash, i);
2863assert(j >= 0);
2864assert(dk_get_index(mp->ma_keys, j) == i);
CID 1372706 (#1 of 1): Improper use of negative value (NEGATIVE_RETURNS)17. 
negative_returns: Passing variable j to a parameter that cannot be negative. 
[show details]
2865dk_set_index(mp->ma_keys, j, DKIX_DUMMY);

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



[issue28237] In xml.etree.ElementTree bytes tag or attributes raises on serialization

2016-09-21 Thread py.user

New submission from py.user:

https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element
"The element name, attribute names, and attribute values can be either 
bytestrings or Unicode strings."


The element name, attribute names, and attribute values can have bytes type, 
but they can't be serialized:

>>> import xml.etree.ElementTree as etree
>>>
>>> root = etree.Element(b'x')
>>> root

>>>
>>> elem = etree.SubElement(root, b'y', {b'a': b'b'})
>>> elem

>>> elem.attrib
{b'a': b'b'}
>>>
>>> etree.dump(root)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.3/xml/etree/ElementTree.py", line 1224, in dump
elem.write(sys.stdout, encoding="unicode")
  File "/usr/lib/python3.3/xml/etree/ElementTree.py", line 826, in write
qnames, namespaces = _namespaces(self._root, default_namespace)
  File "/usr/lib/python3.3/xml/etree/ElementTree.py", line 937, in _namespaces
_raise_serialization_error(tag)
  File "/usr/lib/python3.3/xml/etree/ElementTree.py", line 1105, in 
_raise_serialization_error
"cannot serialize %r (type %s)" % (text, type(text).__name__)
TypeError: cannot serialize b'x' (type bytes)
>>>
>>> etree.tostring(root)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.3/xml/etree/ElementTree.py", line 1171, in tostring
ElementTree(element).write(stream, encoding, method=method)
  File "/usr/lib/python3.3/xml/etree/ElementTree.py", line 826, in write
qnames, namespaces = _namespaces(self._root, default_namespace)
  File "/usr/lib/python3.3/xml/etree/ElementTree.py", line 937, in _namespaces
_raise_serialization_error(tag)
  File "/usr/lib/python3.3/xml/etree/ElementTree.py", line 1105, in 
_raise_serialization_error
"cannot serialize %r (type %s)" % (text, type(text).__name__)
TypeError: cannot serialize b'x' (type bytes)
>>>


Also attribute name can be serialized, but it holds the letter "b" and single 
quotes:

>>> import xml.etree.ElementTree as etree
>>> 
>>> e = etree.Element('a', {b'x': '1'})
>>> etree.tostring(e)
b''
>>>


And same try with site package lxml works fine for all cases because it 
converts bytes to unicode strings right away:

>>> import lxml.etree
>>>
>>> root = lxml.etree.Element(b'x')
>>> root

>>>
>>> elem = lxml.etree.SubElement(root, b'y', {b'a': b'b'})
>>> elem

>>>
>>> elem.attrib
{'a': 'b'}
>>>

--
components: Library (Lib), XML
messages: 277128
nosy: py.user
priority: normal
severity: normal
status: open
title: In xml.etree.ElementTree bytes tag or attributes raises on serialization
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue28233] PyUnicode_FromFormatV can leak PyUnicodeWriter

2016-09-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 00f090563f1b by Victor Stinner in branch '3.5':
Fix PyUnicode_FromFormatV() error handling
https://hg.python.org/cpython/rev/00f090563f1b

--
nosy: +python-dev

___
Python tracker 

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



[issue28238] In xml.etree.ElementTree findall() can't search all elements in a namespace

2016-09-21 Thread py.user

New submission from py.user:

In the example there are two namespaces in one document, but it is impossible 
to search all elements only in one namespace:

>>> import xml.etree.ElementTree as etree
>>>
>>> s = 'http://def"; xmlns:x="http://x";>'
>>>
>>> root = etree.fromstring(s)
>>>
>>> root.findall('*')
[http://def}a' at 0xb73961bc>, http://x}b' at 0xb7396c34>]
>>>
>>> root.findall('{http://def}*')
[]
>>>


And same try with site package lxml works fine:

>>> import lxml.etree as etree
>>>
>>> s = 'http://def"; xmlns:x="http://x";>'
>>>
>>> root = etree.fromstring(s)
>>>
>>> root.findall('*')
[http://def}a at 0xb70ab11c>, http://x}b at 0xb70ab144>]
>>>
>>> root.findall('{http://def}*')
[http://def}a at 0xb70ab11c>]
>>>

--
components: Library (Lib), XML
messages: 277130
nosy: py.user
priority: normal
severity: normal
status: open
title: In xml.etree.ElementTree findall() can't search all elements in a 
namespace
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue27990] Provide a way to enable getrandom on Linux even when build system runs an older kernel

2016-09-21 Thread STINNER Victor

STINNER Victor added the comment:

Ok, I changed the status to WONTFIX.

--
resolution: not a bug -> wont fix

___
Python tracker 

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



[issue28233] PyUnicode_FromFormatV can leak PyUnicodeWriter

2016-09-21 Thread STINNER Victor

STINNER Victor added the comment:

Thanks for the report, it should be fixed now.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue28214] Improve exception reporting for problematic __set_name__ attributes

2016-09-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1a2b8398f045 by Serhiy Storchaka in branch '3.6':
Issue #28214: Now __set_name__ is looked up on the class instead of the
https://hg.python.org/cpython/rev/1a2b8398f045

New changeset 2a5280db601c by Serhiy Storchaka in branch 'default':
Issue #28214: Now __set_name__ is looked up on the class instead of the
https://hg.python.org/cpython/rev/2a5280db601c

--
nosy: +python-dev

___
Python tracker 

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



[issue28042] Coverity Scan defects in new dict code

2016-09-21 Thread INADA Naoki

INADA Naoki added the comment:

Thanks.  It seems coverity doesn't understand assert(j >= 0);
Can I tell it to coverity from source code?

--

___
Python tracker 

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



[issue28042] Coverity Scan defects in new dict code

2016-09-21 Thread Christian Heimes

Christian Heimes added the comment:

Coverity ignores asserts() because they are not in the final code. If you are 
sure that 'j' can never be < 0, then I can simply ignore the issue.

--

___
Python tracker 

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



[issue27010] email library could "recover" from bad mime boundary like (some?) email clients do

2016-09-21 Thread R. David Murray

R. David Murray added the comment:

Hmm.  Thanks for the links.  That[*] implies that "fixing" this would be 
*introducing* a security vulnerability...unless one was trying to implement a 
virus/spam scanner in Python.  So perhaps this should be controlled by a policy 
switch.

[*] The third of those links is the most useful one to read.

--
stage: patch review -> needs patch
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue28042] Coverity Scan defects in new dict code

2016-09-21 Thread INADA Naoki

INADA Naoki added the comment:

OK, I ignored it on Coverity site.

--

___
Python tracker 

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



[issue28042] Coverity Scan defects in new dict code

2016-09-21 Thread Christian Heimes

Christian Heimes added the comment:

Perfect :)

--
resolution:  -> not a bug
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



[issue28214] Improve exception reporting for problematic __set_name__ attributes

2016-09-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Now we need other reproducer for an exception.

--

___
Python tracker 

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



[issue27010] email library could "recover" from bad mime boundary like (some?) email clients do

2016-09-21 Thread Fedele Mantuano

Fedele Mantuano added the comment:

I developed a library that can get that malformed email part, but to get it I 
used the not correct type of defect "StartBoundaryNotFoundDefect" 
(https://github.com/SpamScope/mail-parser/blob/develop/mailparser/__init__.py#L44).
With this patch, I could get malformed email part with the correct defect.

--

___
Python tracker 

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



[issue28239] Implement functools.lru_cache() using ordered dict

2016-09-21 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Since dict became ordered, this feature can be used in functools.lru_cache() 
implementation instead of linked list. This significantly simplifies the code.

The first implementation just uses _PyDict_GetItem_KnownHash() + 
_PyDict_DelItem_KnownHash() + _PyDict_SetItem_KnownHash() for moving existent 
key-value pair to the end of the dict.

The second implementation adds replaces the first two calls with one call of 
newly added _PyDict_PopItem_KnownHash() (this is just simplified copy of 
_PyDict_PopItem()).

The third implementation merges all three operations in one function 
_PyDict_MoveToEnd_KnownHash() that returns moved value if it exists, NULL 
without an exception set if there is no such key in a dict, and NULL with an 
exception set in case of error. Maybe this implementation is can be more 
optimized.

Benchmarking hits:

$ ./python -m perf timeit -s "from functools import lru_cache; f = 
lru_cache(512)(lambda x: x); a = list(range(500))*100" -- "list(map(f, a))"

Unpatched:Median +- std dev: 13.5 ms +- 0.8 ms
get-del-set:  Median +- std dev: 21.7 ms +- 0.8 ms
pop-set:  Median +- std dev: 17.0 ms +- 0.6 ms
move_to_end:  Median +- std dev: 13.7 ms +- 0.5 ms

Benchmarking misses:

$ ./python -m perf timeit -s "from functools import lru_cache; f = 
lru_cache(512)(lambda x: x); a = list(range(5))" -- "list(map(f, a))

Unpatched:Median +- std dev: 31.5 ms +- 1.8 ms
get-del-set:  Median +- std dev: 58.6 ms +- 1.0 ms
pop-set:  Median +- std dev: 59.7 ms +- 1.1 ms
move_to_end:  Median +- std dev: 99.0 ms +- 0.5 ms

The get-del-set implementation is simple and don't need adding new functions to 
PyDict API, but it is 60-90% slower the baseline linked-list-based 
implementation. The pop-set implementation is slightly faster for hits. The 
move_to_end implementation is as fast as the baseline implementation for hits, 
but is much slower in case of misses (I think it can be tuned).

--
components: Extension Modules
files: lru_cache-get-del-set.patch
keywords: patch
messages: 277141
nosy: eric.snow, haypo, methane, rhettinger, serhiy.storchaka
priority: low
severity: normal
status: open
title: Implement functools.lru_cache() using ordered dict
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file44777/lru_cache-get-del-set.patch

___
Python tracker 

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



[issue28239] Implement functools.lru_cache() using ordered dict

2016-09-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file44778/lru_cache-pop-set.patch

___
Python tracker 

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



[issue28239] Implement functools.lru_cache() using ordered dict

2016-09-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file44779/lru_cache-move_to_end.patch

___
Python tracker 

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



[issue28239] Implement functools.lru_cache() using ordered dict

2016-09-21 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue28240] Enhance the timeit module

2016-09-21 Thread STINNER Victor

New submission from STINNER Victor:

Attached patch makes different changes to the timeit module:

* Display the average, rather than the minimum, of the timings *and* display 
the standard deviation. It should help a little bit to get more reproductible 
results.
* Change the default repeat from 3 to 5 to have a better distribution of 
timings. It makes the timeit CLI 66% slower (ex: 1 second instead of 600 ms). 
That's the price of stable benchmarks :-)
* Don't disable the garbage collector anymore! Disabling the GC is not fair: 
real applications use it.
* autorange: start with 1 loop instead of 10 for slow benchmarks like 
time.sleep(1)
* Display large number of loops as power of 10 for readability, ex: "10^6" 
instead of "100". Also accept "10^6" syntax for the --num parameter.
* Add support for "ns" unit: nanoseconds (10^-9 second)

I consider that these changes are well contained enough to still be ok for 3.6 
beta 2. But I add Ned Deily as CC to double check ;-)


This patch is related to my work on Python benchmarks, see:

* http://perf.readthedocs.io/en/latest/
* https://github.com/python/performance

The perf module runs benchmarks in multiple child processes to test different 
memory layouts (Linux uses ASRL by default) and different hash functions. It 
helps to get more stable benchmark results, but it's probably overkill for the 
tiny timeit module. By the way, the "pyperf timeit" command reuses the timeit 
module of the stdlib.


Note: The timeit module still uses the old getopt module which is very strict. 
For example "python3 -m timeit pass -v" is not recognized ("-v" is read as a 
statement part of the benchmark, not as --verbose). But I was too lazy to also 
modify this part, I may do it later ;-)

--
components: Benchmarks
files: timeit.patch
keywords: patch
messages: 277142
nosy: brett.cannon, fijall, haypo, ned.deily, pitrou, serhiy.storchaka, 
yselivanov
priority: normal
severity: normal
status: open
title: Enhance the timeit module
type: performance
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file44780/timeit.patch

___
Python tracker 

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



[issue28240] Enhance the timeit module: diplay average +- std dev instead of minimum

2016-09-21 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Enhance the timeit module -> Enhance the timeit module: diplay average 
+- std dev instead of minimum

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-09-21 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Enhance the timeit module: diplay average +- std dev instead of minimum 
-> Enhance the timeit module: display average +- std dev instead of minimum

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-09-21 Thread STINNER Victor

STINNER Victor added the comment:

The perf module displays the median rather than the mean (arithmeric average). 
The difference between median and mean is probably too subtle for most users 
:-/ The term "median" is also probably unknown by most users...

I chose to use average: well known, easy to understand (we learn the formula at 
school: sum/count).

--

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-09-21 Thread STINNER Victor

STINNER Victor added the comment:

> * Display the average, rather than the minimum, of the timings *and* display 
> the standard deviation. It should help a little bit to get more reproductible 
> results.

Rationale:

* http://blog.kevmod.com/2016/06/benchmarking-minimum-vs-average/
* https://haypo.github.io/journey-to-stable-benchmark-average.html

--

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-09-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Display the average, rather than the minimum, of the timings *and* display 
> the standard deviation. It should help a little bit to get more reproductible 
> results

That entirely depends on which benchmark you are running.

> Disabling the GC is not fair: real applications use it

timeit was never meant to benchmark real applications, it is a 
micro-benchmarking tool.

--

___
Python tracker 

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



[issue28205] Add optional suffix to str.join

2016-09-21 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger
components: +Documentation
priority: normal -> low

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-09-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Another point: timeit is often used to compare performance between Python 
versions. By changing the behaviour of timeit in a given Python version, you'll 
make it more difficult to compare results.

--

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-09-21 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +tim.peters

___
Python tracker 

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



[issue28240] Enhance the timeit module: display average +- std dev instead of minimum

2016-09-21 Thread STINNER Victor

STINNER Victor added the comment:

Maciej Fijalkowski also sent me the following article a few months ago, it also 
explains indirectly why using the minimum for benchmarks is not reliable:

"Virtual Machine Warmup Blows Hot and Cold"
http://arxiv.org/pdf/1602.00602.pdf

Even if the article is more focused on JIT compilers, it shows that benchmarks 
are not straightforward but always full of bad surprises.

A benchmark doesn't have a single value but a *distribution*. The best question 
is how to summarize the full distribution without loosing too much information.

In the perf module I decided to not take a decision: a JSON file stores *all* 
data :-D But by default, perf displays mean +- std dev.

--

___
Python tracker 

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



[issue28240] Enhance the timeit module

2016-09-21 Thread Steven D'Aprano

Steven D'Aprano added the comment:

> * Display the average, rather than the minimum, of the timings *and* 
> display the standard deviation. It should help a little bit to get 
> more reproductible results.

I'm still not convinced that the average is the right statistic to use 
here. I cannot comment about Victor's perf project, but for timeit, it 
seems to me that Tim's original warning that the mean is not useful is 
correct.

Fundamentally, the problem with taking an average is that the timing 
errors are all one sided. If the unknown "true" or "real" time taken by 
a piece of code is T, then the random error epsilon is always positive: 
we're measuring T + ε, not T ± ε.

If the errors are evenly divided into positive and negative, then on 
average the mean() or median() of the measurements will tend to cancel 
the errors, and you get a good estimate of T. But if the errors are all 
one-sided, then they don't cancel and you are actually estimating T plus 
some unknown, average error. In that case, min() is the estimate which 
is closest to T.

Unless you know that average error is tiny compared to T, I don't think 
the average is very useful. Since these are typically micro-benchmarks, 
the error is often quite large relative to the unknown T.

> * Change the default repeat from 3 to 5 to have a better distribution 
> of timings. It makes the timeit CLI 66% slower (ex: 1 second instead 
> of 600 ms). That's the price of stable benchmarks :-)

I nearly always run with repeat=5, so I agree with this.

> * Don't disable the garbage collector anymore! Disabling the GC is not 
> fair: real applications use it.

But that's just adding noise: you're not timing code snippet, you're 
timing code snippet plus garbage collector.

I disagree with this change, although I would accept it if there was an 
optional flag to control the gc.

> * autorange: start with 1 loop instead of 10 for slow benchmarks like 
> time.sleep(1)

That seems reasonable.

> * Display large number of loops as power of 10 for readability, ex: 
> "10^6" instead of "100". Also accept "10^6" syntax for the --num 
> parameter.

Shouldn't we use 10**6 or 1e6 rather than bitwise XOR? :-)

This is aimed at Python programmers. We expect ** to mean 
exponentiation, not ^.

> * Add support for "ns" unit: nanoseconds (10^-9 second)

Seems reasonable.

--
nosy: +steven.daprano
title: Enhance the timeit module: display average +- std dev instead of minimum 
-> Enhance the timeit module

___
Python tracker 

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



[issue28239] Implement functools.lru_cache() using ordered dict

2016-09-21 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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



[issue28240] Enhance the timeit module

2016-09-21 Thread STINNER Victor

STINNER Victor added the comment:

> Another point: timeit is often used to compare performance between Python 
> versions. By changing the behaviour of timeit in a given Python version, 
> you'll make it more difficult to compare results.

Hum, that's a good argument against my change :-)

So to be able to compare Python 3.5 vs 3.6 or Python 2.7 vs Python 3.6, we need 
to backport somehow the average feature to the timeit module of older Python 
versions. One option would be to put the timeit module on the Python Cheeseshop 
(PyPI). Hum, but there is already such module: my perf module.

A solution would be to redirect users to the perf module in the timeit 
documentation, and maybe also document that timeit results are not reliable?

A different solution would be to add a --python parameter to timeit to run the 
benchmark on a specific Python version (ex: "python3 -m timeit --python=python2 
..."). But this solution is more complex to be developed since we have to make 
the timeit.py compatible with Python 2.7 and find a reliable way to load it in 
the other tested Python program.

Note: I plan to add a --python parameter in my perf module, but I didn't 
implemented yet. Since my perf module spawn child processes and the perf module 
is a third party module, it is simpler to implement this option.

--

A more general remark: the timeit is commonly used to compare performances of 
two Python versions. They run timeit twice and then compare manually results. 
But only two numbers are compared. It would be more reliable to compare all 
timings and make sure that the comparison is significant. Again, the perf 
module implements such function:
http://perf.readthedocs.io/en/latest/api.html#perf.is_significant

I didn't implement a full CLI for perf timeit to directly compares two Python 
versions. You have to run timeit twice and store all timings in JSON files and 
then use the "perf compare" command to reload timings and compare them.

--

___
Python tracker 

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



[issue28240] Enhance the timeit module

2016-09-21 Thread Yury Selivanov

Changes by Yury Selivanov :


--
nosy:  -yselivanov

___
Python tracker 

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



[issue28100] Refactor error messages in symtable.c

2016-09-21 Thread Christian Heimes

Christian Heimes added the comment:

Please rewrite the patch to use if / else if / else, e.g.

 if (cur & (DEF_LOCAL | USE | DEF_ANNOT)) {
...
if (cur & USE) {
msg = GLOBAL_AFTER_USE;
} else if (cur & DEF_LOCAL) {
msg = GLOBAL_AFTER_ASSIGN;
} else {  /* DEF_ANNOT */
msg = GLOBAL_ANNOT;
}
...
}

--

___
Python tracker 

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



[issue28202] Python 3.5.1 C API, the global variable is not destroyed when delete the module

2016-09-21 Thread Nick Coghlan

Nick Coghlan added the comment:

The most likely relevant difference here is that Python 3.4+ no longer forcibly 
break cycles through the module globals when the module is deallocated: 
https://docs.python.org/dev/whatsnew/3.4.html#whatsnew-pep-442

Due to the implicit cycles created between function definitions and their 
global namespace via the __globals__ attribute on the function, this means that 
embedding applications will need to explicitly run a GC collection cycle after 
deleting a module in order to fully finalise it.

--

___
Python tracker 

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



[issue28239] Implement functools.lru_cache() using ordered dict

2016-09-21 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The problem is that cache hits now create "holes" in the compact dict and 
trigger periodic compaction.  In contrast, the existing code leaves dicts 
unchanged when there is a cache hit.  

I prefer the current code. Though it took a little more effort to implement, 
that work is already done and done well.  The linked lists are cheap and have 
consistent, predictable performance.   I also like that the current 
implementation is only loosely coupled with dictionaries and not tightly tied 
to the compact dict with its evolving implementation details.

--

___
Python tracker 

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



[issue28202] Python 3.5.1 C API, the global variable is not destroyed when delete the module

2016-09-21 Thread Nick Coghlan

Nick Coghlan added the comment:

To be entirely clear about what's going on, the reference cycle seen in the 
example arises for *any* module level function, even if it's completely empty:

>>> def f():
... pass
... 
>>> f.__globals__["f"] is f
True

The existence of that cycle will then keep other module globals alive until the 
next garbage collection run.

--

___
Python tracker 

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



[issue28210] argparse with subcommands difference in python 2.7 / 3.5

2016-09-21 Thread Tim Graham

Tim Graham added the comment:

Based on the usage output, it looks like the subcommand is required, but I'm 
not sure if there are cases where a subcommand could be optional. David, can 
you advise?

usage: test_argparse.py [-h] command ...

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



[issue28197] range.index mismatch with documentation

2016-09-21 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> I'd argue that range can implement the 3-arg .index much better 
> than generic Sequence.

Yes, the range index() method should implement all three arguments.  That 
shouldn't be difficult.

--
assignee: docs@python -> 
type: behavior -> enhancement
versions:  -Python 3.5, Python 3.6

___
Python tracker 

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



[issue28241] Nested fuctions Unexpected behaviour when stored in a list and called after.

2016-09-21 Thread artxyz

New submission from artxyz:

Python 2.7.11
GCC 4.8.4

Getting weird results when define a nested function in a loop and store them in 
a list

x = list()
for i in xrange(5):
def FUN():
print i
x.append(FUN)

Calling functions from list using index works fine:

for i in xrange(5):
print x[i]
x[i]()
# prints 0 1 2 3 4

Calling function using iteration through the sequence yields  wrong results, 
despite current function (f) changes:

for f in x:
print f
f()
# prints 4 4 4 4 4

--
components: Interpreter Core
files: nested_fun_bug.py
messages: 277155
nosy: artxyz
priority: normal
severity: normal
status: open
title: Nested fuctions Unexpected behaviour when stored in a list and called 
after.
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file44781/nested_fun_bug.py

___
Python tracker 

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



[issue28240] Enhance the timeit module

2016-09-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> * Display the average, rather than the minimum, of the timings *and* display 
> the standard deviation. It should help a little bit to get more reproductible 
> results.

This makes hard to compare results with older Python versions.

> * Change the default repeat from 3 to 5 to have a better distribution of 
> timings. It makes the timeit CLI 66% slower (ex: 1 second instead of 600 ms). 
> That's the price of stable benchmarks :-)

For now default timeit run takes from 0.8 to 8 sec. Adding yet 5 sec makes a 
user more angry.

> * Don't disable the garbage collector anymore! Disabling the GC is not fair: 
> real applications use it.

But this makes short microbenchmarks less stable.

> * autorange: start with 1 loop instead of 10 for slow benchmarks like 
> time.sleep(1)

This is good if you run relatively slow benchmark, but it makes the result less 
reliable. You always can specify -n1, but on your own risk.

> * Display large number of loops as power of 10 for readability, ex: "10^6" 
> instead of "100". Also accept "10^6" syntax for the --num parameter.

10^6 syntax doesn't look Pythonic. And this change breaks third-party scripts 
that run timeit.

> * Add support for "ns" unit: nanoseconds (10^-9 second)

Even "pass" takes at least 0.02 usec on my computer. What you want to measure 
that takes < 1 ns? I think timeit is just wrong tool for this.

The patch also makes a warning about unreliable results output to stdout and 
always visible. This is yet one compatibility break. Current code allows the 
user to control the visibility of the warning by the -W Python option, and 
don't mix the warning with result output.

--

___
Python tracker 

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



[issue28214] Improve exception reporting for problematic __set_name__ attributes

2016-09-21 Thread Nick Coghlan

Nick Coghlan added the comment:

@property can be used to define a broken __set_name__ attribute:

>>> class BadIdea:
... @property
... def __set_name__(self):
... pass
... 
>>> class NotGoingToWork:
... attr = BadIdea()
... 
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'NoneType' object is not callable

And there's also a failing __set_name__ call:

>>> class FaultyImplementation:
... def __set_name__(self, *args):
... 1/0
... 
>>> class TheoreticallyCouldWork:
... attr = FaultyImplementation()
... 
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 3, in __set_name__
ZeroDivisionError: division by zero

--

___
Python tracker 

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



[issue28242] os.environ.get documentation missing

2016-09-21 Thread Dennis Jensen

New submission from Dennis Jensen:

I was encountering what seemed to be odd behavior from os.environ.get() from 
what I could find out about it and so I tried to locate the actual 
documentation on how it is supposed to be used now.  However, all I can find is 
a minor reference to os.environ.  There appears to be no documentation on 
os.environ.get() and/or any other methods of this sort associated with 
os.environ.  The alternate functionality os.getenv() is documented but this is 
not supposed to work the same as os.environ.get()   Still the behavior that I 
encountered is that it seems that either os.environ.get()) has been changed 
and/or it is now just simply a proxy for os.getenv() -- as these two seem to 
function the same way now.  Note: From what I was able to discern about how 
os.environ.get() worked is that it accepts only 1 parameter and if the item 
does not exist it throws an error -- while os.getenv() takes 2 parameters and 
does not throw an error if the item does not exist.

--
assignee: docs@python
components: Documentation
messages: 277159
nosy: DennisJensen, docs@python
priority: normal
severity: normal
status: open
title: os.environ.get documentation missing
type: resource usage
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



[issue28241] Nested fuctions Unexpected behaviour when stored in a list and called after.

2016-09-21 Thread Zachary Ware

Zachary Ware added the comment:

See 
https://docs.python.org/3/faq/programming.html#why-do-lambdas-defined-in-a-loop-with-different-values-all-return-the-same-result

Note that `lambda: x**2` is equivalent to `def FUN(): return x**2`.

--
nosy: +zach.ware
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



[issue28240] Enhance the timeit module

2016-09-21 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka added the comment:
>> * Change the default repeat from 3 to 5 to have a better distribution of 
>> timings. It makes the timeit CLI 66% slower (ex: 1 second instead of 600 
>> ms). That's the price of stable benchmarks :-)
>
> For now default timeit run takes from 0.8 to 8 sec. Adding yet 5 sec makes a 
> user more angry.

Ah yes, I forgot that timeit uses power of 10 to have a nice looking
"xxx loops". I chose to use power of 2 in the perf module to have
shorter benchmarks, but powers of 2 are displayed as 2^n to remain
readable.

>> * Display large number of loops as power of 10 for readability, ex: "10^6" 
>> instead of "100". Also accept "10^6" syntax for the --num parameter.
>
> 10^6 syntax doesn't look Pythonic. And this change breaks third-party scripts 
> that run timeit.

Do you mean scripts parsing the timeit output (stdout)?

>> * Add support for "ns" unit: nanoseconds (10^-9 second)
>
> Even "pass" takes at least 0.02 usec on my computer. What you want to measure 
> that takes < 1 ns?

IMO 20 ns is more readable than 0.02 usec.

> I think timeit is just wrong tool for this.

Even if timeit is not reliable, it *is* used to benchmark operations
taking less than 1 us.

> The patch also makes a warning about unreliable results output to stdout and 
> always visible. This is yet one compatibility break. Current code allows the 
> user to control the visibility of the warning by the -W Python option, and 
> don't mix the warning with result output.

Oh, I forgot to documen this change. I made it because the old code
displays a surprising ":0: " prefix. I chose to use print instead. I
don't think that it's a common usage to hide the warning using
-Wignore.

--

___
Python tracker 

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



[issue28197] range.index mismatch with documentation

2016-09-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Sorry for poor words. I was not going to blame anybody. But changing interface 
always is dangerous. It makes third-party classes that implemented the 
interface no longer valid substitutions.

I think two things are worth to be done:

1) Explicitly document (including the docstring) that the support of stop and 
start arguments is optional. Not all sequences implements it. 3.5+.

2) Add the support of stop and start arguments to range() in 3.7.

And would be nice to provide a way for testing if the sequence supports 
extended index(). If this is possible.

--

___
Python tracker 

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



[issue28197] range.index mismatch with documentation

2016-09-21 Thread Raymond Hettinger

Raymond Hettinger added the comment:

>  2) Add the support of stop and start arguments to range() in 3.7.

Yes, the whole point of adding these bogus methods in the first place was to 
harmonize the range object with other sequence types.

--

___
Python tracker 

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



[issue28100] Refactor error messages in symtable.c

2016-09-21 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Here is the patch for 3.6 with requested changes.

While playing with this a bit more, I discovered that the error message in this 
case (if no value is actually assigned):

def f():
x: int
global x

could be misleading. Therefore I changed the order of DEF_LOCAL and DEF_ANNOT 
to get a more clear error message for such cases (this does not spoil error 
messages in other cases).

--
Added file: http://bugs.python.org/file44782/refactor-error-msg-v2.diff

___
Python tracker 

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



[issue28242] os.environ.get documentation missing

2016-09-21 Thread Ned Deily

Ned Deily added the comment:

os.environ is documented as being a "mapping" object.  The "get" method is a 
standard method for all mapping objects; it's not unique to os.environ.  Thus, 
there is no need to specially call out "get" or any of the other "mapping" 
methods and operations available with os.environ or any other example of a 
mapping object.  The "Built-in Types" chapter of the Python Standard Library 
reference describes the standard types and their methods and operations.


https://docs.python.org/3/library/os.html#os.environ
https://docs.python.org/3/library/stdtypes.html#mapping-types-dict
https://docs.python.org/3/library/stdtypes.html

--
nosy: +ned.deily
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



[issue27932] platform.win32_ver() leaks in 2.7.12

2016-09-21 Thread Steve Dower

Changes by Steve Dower :


--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed

___
Python tracker 

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



[issue26513] platform.win32_ver() broken in 2.7.11

2016-09-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 03f2c8fc24ea by Steve Dower in branch '2.7':
Issue #26513: Use winver.product_type instead of .product
https://hg.python.org/cpython/rev/03f2c8fc24ea

--

___
Python tracker 

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



[issue28241] Nested fuctions Unexpected behaviour when stored in a list and called after.

2016-09-21 Thread R. David Murray

R. David Murray added the comment:

Note also that your first example worked only because your loop variable was 
named i.  If you used, say, 'j', you'd get the same result as in your second 
example.  This is because the closure is over the named variable, and both in 
your definition loop and your print loop, that variable is the 'i' in the 
global namespace.

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



[issue28242] os.environ.get documentation missing

2016-09-21 Thread Dennis Jensen

Dennis Jensen added the comment:

Okay well thanks for that information but after investigating this then I have 
to ask what is the difference between:

os.environ.get()

and

os.getenv()

As these 2 functions now appear to do exactly the same thing?  If this is the 
case then should there not be something added to either os.environ or to 
os.getenv() that states something to this effect.

Something along the lines of:  Since version: "whatever version that changed 
how .get() works" made the os.environ.get() work exactly the same as the 
os.getenv() -- this way since there are still references floating around that 
state that these 2 do not function the same and nothing outlined clearly within 
documentation stating that this is no longer the case.  Creates a bit of 
confusion on what should and should not be.

--
resolution: not a bug -> 
status: closed -> pending

___
Python tracker 

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



[issue28235] In xml.etree.ElementTree docs there is no parser argument in fromstring()

2016-09-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +eli.bendersky, scoder

___
Python tracker 

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



[issue25651] Confusing output for TestCase.subTest(0)

2016-09-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ba743894e793 by Berker Peksag in branch '3.5':
Issue #25651: Allow falsy values to be used for msg parameter of subTest()
https://hg.python.org/cpython/rev/ba743894e793

New changeset ddbf92168a44 by Berker Peksag in branch '3.6':
Issue #25651: Merge from 3.5
https://hg.python.org/cpython/rev/ddbf92168a44

New changeset e5888f5b9cf8 by Berker Peksag in branch 'default':
Issue #25651: Merge from 3.6
https://hg.python.org/cpython/rev/e5888f5b9cf8

--
nosy: +python-dev

___
Python tracker 

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



[issue28239] Implement functools.lru_cache() using ordered dict

2016-09-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I consider this issue as lying on the way to using the orderable of dict in 
OrderedDict implementation (the latter is very desirable because current 
OrderedDict implementation can be easily broken by using plain dict API). The 
main difficulty of implementing OrderedDict is the move_to_end() method 
(especially move_to_end(False)).

In additional, the problem of holes is occurred for any often modified 
dictionary. Using ordered dict in lru_cache() give as good stress test for 
optimizing dict updating and resizing code.

I don't suggest to change lru_cach() implementation just now. But after long 
testing ordered dicts during the developing stage of 3.7 (or even 3.8) we can 
make a decision.

--

___
Python tracker 

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



[issue28235] In xml.etree.ElementTree docs there is no parser argument in fromstring()

2016-09-21 Thread Serhiy Storchaka

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



[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +eli.bendersky, scoder
stage:  -> patch review

___
Python tracker 

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



[issue25651] Confusing output for TestCase.subTest(0)

2016-09-21 Thread Berker Peksag

Berker Peksag added the comment:

Fixed. I lost some time because of this today :)

--
nosy: +berker.peksag
resolution:  -> fixed
stage: test needed -> resolved
status: open -> closed
versions: +Python 3.7 -Python 3.4

___
Python tracker 

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



[issue28242] os.environ.get documentation missing

2016-09-21 Thread Dennis Jensen

Changes by Dennis Jensen :


--
status: pending -> open

___
Python tracker 

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



[issue28241] Nested fuctions Unexpected behaviour when stored in a list and called after.

2016-09-21 Thread artxyz

artxyz added the comment:

I got it now. Thanks!

--

___
Python tracker 

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



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

2016-09-21 Thread Jan-Philip Gehrcke

Jan-Philip Gehrcke added the comment:

Thanks Christian, much appreciated. Just responded to your review.

--

___
Python tracker 

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



  1   2   >