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

[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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[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

[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

[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

[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

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

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

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

[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

[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

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

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

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

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

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

[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

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

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

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

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

[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

[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

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

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

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

[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

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

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

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

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

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

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

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

[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() + _PyDi

[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

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

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

[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

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

[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

[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

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

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

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

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

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

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

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

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

[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

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

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

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

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

[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

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

[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

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

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

[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

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

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

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

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

[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. -- ___ Pytho

[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

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

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

[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

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

[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

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

[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

[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

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

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

[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

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

[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

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

  1   2   >