[issue30200] tkinter ListboxSelect

2017-04-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: Bug examples should be the bare minimum of code needed to reproduce the problem, not a dump of (failing) application code. See, for instance, https://stackoverflow.com/help/mcve. http://www.tcl.tk/man/tcl8.6/TkCmd/listbox.htm says "Any time the set of

[issue30196] Add __matmul__ to collections.Counter

2017-04-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: The '|' should be '&' to avoid useless summing of 0 products. I think this should be rejected. Python's number and collections classes provide basic operations from which users can build application-specific functions. Or in the case of floats, we provide a

[issue30152] Reduce the number of imports for argparse

2017-04-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: I believe importing argparse in the __main__ clause (or a main or test function called therein) is common. I prefer it there as it is not germain to the code that is usually imported. I have a similar view on not immediately importing warnings when only

[issue29982] tempfile.TemporaryDirectory fails to delete itself

2017-04-28 Thread Guido van Rossum
Guido van Rossum added the comment: A simpler approach would be to simply ignore the error when it occurs in TemporaryDirectory._cleanup. There are no absolute guarantees about tempfile always cleaning up -- just a best effort. The complexity (and potential delays) of a retry loop seem more

[issue30158] Deprecation warnings emitted in test_importlib

2017-04-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue30158] Deprecation warnings emitted in test_importlib

2017-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 3cc8259b71ef784a9f7593f04da96043afe2228a by Serhiy Storchaka in branch 'master': bpo-30158: Fix deprecation warnings in test_importlib introduced by bpo-29576. (#1285)

[issue29576] Improve some deprecations in the importlib

2017-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 3cc8259b71ef784a9f7593f04da96043afe2228a by Serhiy Storchaka in branch 'master': bpo-30158: Fix deprecation warnings in test_importlib introduced by bpo-29576. (#1285)

[issue30103] uu package uses old encoding

2017-04-28 Thread Martin Panter
Martin Panter added the comment: I think I would prefer b2a_uu(data, grave=True), but am also happy with Xiang’s backtick=True if others prefer that. :) In my mind “grave accent” is the pure ASCII character; it just got abused for other things. Other options: b2a_uu(data, space=False)

[issue21071] struct.Struct.format is bytes, but should be str

2017-04-28 Thread Martin Panter
Martin Panter added the comment: I don’t think the API should be expanded to accept arbitrary bytes-like objects as format strings. Struct formats are strings of ASCII-compatible characters, but not arbitrary chunks of memory. I think the main question is whether it is okay to break

[issue30119] (ftplib) A remote attacker could possibly attack by containing the newline characters

2017-04-28 Thread Dong-hee Na
Dong-hee Na added the comment: '\ r' -> '\r' '\ n' -> '\n' -- ___ Python tracker ___ ___ Python-bugs-list

[issue30119] (ftplib) A remote attacker could possibly attack by containing the newline characters

2017-04-28 Thread Dong-hee Na
Dong-hee Na added the comment: One of the purposes of the JDK patch is to prevent '\ r' and '\ n' from being inserted into the ftp command. In particular, it seems to assume that if another malice command is inserted after '\ n', the possibility of such an attack will be opened at a later

[issue29606] urllib FTP protocol stream injection

2017-04-28 Thread Dong-hee Na
Dong-hee Na added the comment: Thanks, Martin I agree with you. So, in this case, we should update FTPHandler right? If this approach right, Can I proceed this issue? -- ___ Python tracker

[issue16349] Document whether it's safe to use bytes for struct format string

2017-04-28 Thread Martin Panter
Changes by Martin Panter : -- dependencies: +struct.Struct.format is bytes, but should be str -Document whether it's safe to use bytes for struct format string ___ Python tracker

[issue16349] Document whether it's safe to use bytes for struct format string

2017-04-28 Thread Martin Panter
Martin Panter added the comment: I think the direction to take for this depends on the outcome of Issue 21071. First we have to decide if the “format” attribute is blessed as a byte string (and not deprecated), or whether it is deprecated or changed to a text string. Serhiy pointed out that

[issue30133] Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions.

2017-04-28 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- versions: +Python 3.6, Python 3.7 -Python 3.4 ___ Python tracker ___

[issue29606] urllib FTP protocol stream injection

2017-04-28 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___

[issue30119] (ftplib) A remote attacker could possibly attack by containing the newline characters

2017-04-28 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___

[issue29606] urllib FTP protocol stream injection

2017-04-28 Thread Martin Panter
Martin Panter added the comment: I understand this bug (as reported by ECBFTW) is about Python injecting unexpected FTP commands when the “urllib” and “urllib2” modules are used. The “httplib” module (“http.client” in Python 3) is unaffected. I only mentioned HTTP as an example of a similar

[issue30183] [HPUX] compilation error in pytime.c with cc compiler

2017-04-28 Thread David Haney
Changes by David Haney : -- pull_requests: +1463 ___ Python tracker ___ ___

[issue30202] Update test.test_importlib.test_abc to test find_spec()

2017-04-28 Thread Brett Cannon
New submission from Brett Cannon: It looks like test_abc isn't really testing find_spec() very much compared to find_module(). There might also be some tests still using find_module() that should be updated to use find_spec() instead. -- components: Tests messages: 292552 nosy:

[issue27869] test failures under Bash on Windows / WSL

2017-04-28 Thread Brett Cannon
Changes by Brett Cannon : -- versions: +Python 3.7 -Python 3.6 ___ Python tracker ___ ___

[issue27869] test failures under Bash on Windows / WSL

2017-04-28 Thread Brett Cannon
Brett Cannon added the comment: When failures are bit more isolated they should probably be reported to https://github.com/microsoft/bashonwindows . -- ___ Python tracker

[issue30145] Create a How to or Tutorial documentation for asyncio

2017-04-28 Thread Yury Selivanov
Yury Selivanov added the comment: Yes, this is a very longstanding open issue. I've already discussed this with Guido many times, and even found someone to help us. Will try to kickstart the project this weekend. -- ___ Python tracker

[issue30145] Create a How to or Tutorial documentation for asyncio

2017-04-28 Thread Ivan Levkivskyi
Changes by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker ___ ___

[issue30196] Add __matmul__ to collections.Counter

2017-04-28 Thread Ivan Levkivskyi
Changes by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker ___ ___

[issue27377] Add socket.fdtype()

2017-04-28 Thread Neil Schemenauer
Neil Schemenauer added the comment: Changing title, I think #28134 (socket.socket(fileno=fd) does not work as documented) is a cleaner solution. However, exposing the ability to query a socket file descriptor seems useful so I'm still proposing to add socket.fdtype(). The github PR 1348 has

[issue19417] Bdb: add docstrings and a unittest file (test.test_bdb)

2017-04-28 Thread Cheryl Sabella
Changes by Cheryl Sabella : -- pull_requests: +1462 ___ Python tracker ___ ___

[issue30190] unittest's assertAlmostEqual improved error message

2017-04-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: The patch looks good to me. -- nosy: +rhettinger ___ Python tracker ___

[issue30196] Add __matmul__ to collections.Counter

2017-04-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: Periodically, I've looked at possibly adding these kind of extensions. The argument in favor in that it is easy to do and is an obvious extension with plausible utility. The main arguments against is that it represents feature creep far removed from

[issue26143] Ensure that IDLE's stdlib imports are from the stdlib

2017-04-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: I and others constantly tell people to start IDLE from the command line when they have a problem. Today, someone actually followed the advice and the traceback revealed that the problem was a personal tkinter.py masking the stdlib file! Renaming it to

[issue28134] socket.socket(fileno=fd) does not work as documented

2017-04-28 Thread Christian Heimes
Changes by Christian Heimes : -- pull_requests: +1461 ___ Python tracker ___ ___

[issue27869] test failures under Bash on Windows / WSL

2017-04-28 Thread Brett Cannon
Brett Cannon added the comment: Running the tests with -uall didn't change the results. -- ___ Python tracker ___

[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-04-28 Thread Stefan Krah
Stefan Krah added the comment: I'm with Nathaniel here: The fixed-bug is probably too obscure to warrant ABI breakage. -- nosy: +skrah ___ Python tracker

[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-04-28 Thread Nathaniel Smith
Nathaniel Smith added the comment: Pillow also had broken wheels up on pypi for a while; they've now put out a bug fix release that #undef's PySlice_GetIndicesEx, basically monkeypatching out the bugfix to get back to the 3.6.0 behavior: https://github.com/python-pillow/Pillow/issues/2479

[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 941ea53b5776aaeb9dc1026e482a4ce5c5768830 by Serhiy Storchaka in branch '2.7': [2.7] bpo-30197: Enhance swap_attr() and backport swap_item() in test.test_support. (#1341) (#1347)

[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 910ba937e90ffe3aa154a5b27dc7e2c3d3c88d1f by Serhiy Storchaka in branch '3.5': [3.5] bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. (#1341) (#1346)

[issue30190] unittest's assertAlmostEqual improved error message

2017-04-28 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Done. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 712114b3f9f5f98f03c66a80607b6f7101c5cc90 by Serhiy Storchaka in branch '3.6': [3.6] bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. (GH-1341) (#1345)

[issue27377] Add smarter socket.fromfd()

2017-04-28 Thread Neil Schemenauer
Changes by Neil Schemenauer : -- pull_requests: +1460 ___ Python tracker ___ ___

[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +1459 ___ Python tracker ___ ___

[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +1458 ___ Python tracker ___ ___

[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +1457 ___ Python tracker ___ ___

[issue30201] [3.5] RecvmsgIntoSCMRightsStreamTest fails with "OSError: [Errno 12] Cannot allocate memory" on macOS El Capitan

2017-04-28 Thread STINNER Victor
New submission from STINNER Victor: The test fails on Python 3.5 but pass on Python 3.6, I don't know why. http://buildbot.python.org/all/builders/x86-64%20El%20Capitan%203.5/builds/31/steps/test/logs/stdio == ERROR:

[issue30190] unittest's assertAlmostEqual improved error message

2017-04-28 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Thanks for chiming in. > Is it worth to output a difference when the delta argument is not passed? Yes, probably. I will change that. > Is it worth to output a signed difference rather than an absolute value? Mmmm probably not IMHO. Personally I never

[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread STINNER Victor
STINNER Victor added the comment: New changeset d1a1def7bf221b04dcf3fc3a67aa19aa2f622f83 by Victor Stinner (Serhiy Storchaka) in branch 'master': bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. (#1341)

[issue30200] tkinter ListboxSelect

2017-04-28 Thread Frank Pae
New submission from Frank Pae: prerequisite: you have more than one tkinter listbox behavior in py 2.7.13 and py 3.5.3: if you leave a listbox and goes to another, then the abandoned listbox create not a ListboxSelect Event behavior in py 3.6.0 and 3.6.1: if you leave a listbox and goes to

[issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot

2017-04-28 Thread STINNER Victor
STINNER Victor added the comment: New changeset 98c7a9e662b49029ff051b6699ddc0f542663c96 by Victor Stinner in branch '3.5': [3.5] bpo-30107: don't dump core on expected test_io crash (#1235) (#1344) https://github.com/python/cpython/commit/98c7a9e662b49029ff051b6699ddc0f542663c96 --

[issue2506] Add mechanism to disable optimizations

2017-04-28 Thread Sergey B Kirpichev
Changes by Sergey B Kirpichev : -- nosy: +Sergey.Kirpichev ___ Python tracker ___ ___

[issue30125] test_SEH() of test_ctypes logs "Windows fatal exception: access violation"

2017-04-28 Thread STINNER Victor
STINNER Victor added the comment: New changeset e005dd9a6da7dfa34f47a6989a7e0a6b1ad04949 by Victor Stinner in branch '3.6': bpo-30125: disable faulthandler in ctypes test_SEH (#1237) (#1343) https://github.com/python/cpython/commit/e005dd9a6da7dfa34f47a6989a7e0a6b1ad04949 --

[issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot

2017-04-28 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +1456 ___ Python tracker ___ ___

[issue30125] test_SEH() of test_ctypes logs "Windows fatal exception: access violation"

2017-04-28 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +1455 ___ Python tracker ___ ___

[issue30199] Warning -- asyncore.socket_map was modified by test_ssl

2017-04-28 Thread STINNER Victor
New submission from STINNER Victor: It seems like test_asyncore_server() of test_ssl doesn't cleanup properly asyncore on FreeBSD, and so following unit tests can be impacted (and fail).

[issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing

2017-04-28 Thread STINNER Victor
STINNER Victor added the comment: New changeset 826f83f1d562a7b878499bc3af2267cfdfe5f2f9 by Victor Stinner in branch 'master': bpo-30104: Only use -fno-strict-aliasing on dtoa.c (#1340) https://github.com/python/cpython/commit/826f83f1d562a7b878499bc3af2267cfdfe5f2f9 --

[issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0

2017-04-28 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +1454 ___ Python tracker ___ ___

[issue30198] distutils build_ext: don't run newer_group() in parallel in multiple threads when using parallel

2017-04-28 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +brett.cannon, pitrou ___ Python tracker ___

[issue30198] distutils build_ext: don't run newer_group() in parallel in multiple threads when using parallel

2017-04-28 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +1453 ___ Python tracker ___ ___

[issue30198] distutils build_ext: don't run newer_group() in parallel in multiple threads when using parallel

2017-04-28 Thread STINNER Victor
New submission from STINNER Victor: Since Python 3.5, distutils is able to build extensions in parallel, nice enhancement! But setup.py of CPython is 2x slower in parallel mode when all modules are already built: (1 sec vs 500 ms). Building extensions calls newer_group() which calls os.stat()

[issue24960] Can't use lib2to3 with embeddable zip file.

2017-04-28 Thread Philippe Pinard
Philippe Pinard added the comment: As Sébastien Taylor, I ran into the same problem. The workaround I found was to unzip the content of python35.zip and put it in the Lib/ folder. -- nosy: +ppinard ___ Python tracker

[issue30152] Reduce the number of imports for argparse

2017-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Measuring Python startup performance is painful, there is a huge deviation. That is why I run Python 100 times and repeat that several times for testing that the result is stable. With perf I got roughly the same result -- the absolute difference is 18-19

[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +1452 ___ Python tracker ___ ___

[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch adds two features to functions swap_attr() and swap_item() in the test.support module. 1. They now work (rather than failing in __exit__) when delete the attribute or item inside the with block. There were several cases when I refused to

[issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing

2017-04-28 Thread STINNER Victor
STINNER Victor added the comment: I would like to fix FreeBSD CURRENT buildbots of Python 2.7, 3.5 and 3.6, so here my attempt to restrict the -fno-strict-aliasing option to the dtoa.c file: https://github.com/python/cpython/pull/1340 I chose to add the flag for any C compiler. If you think

[issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0

2017-04-28 Thread STINNER Victor
STINNER Victor added the comment: I would like to fix FreeBSD CURRENT buildbots of Python 2.7, 3.5 and 3.6, so here my attempt to restrict the -fno-strict-aliasing option to the dtoa.c file: https://github.com/python/cpython/pull/1340 I chose to add the flag for any C compiler. If you think

[issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing

2017-04-28 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +1451 ___ Python tracker ___ ___

[issue30196] Add __matmul__ to collections.Counter

2017-04-28 Thread Jim Fasarakis-Hilliard
Changes by Jim Fasarakis-Hilliard : -- versions: -Python 3.3, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker ___

[issue30196] Add __matmul__ to collections.Counter

2017-04-28 Thread Jim Fasarakis-Hilliard
Changes by Jim Fasarakis-Hilliard : -- nosy: +Jim Fasarakis-Hilliard ___ Python tracker ___

[issue30152] Reduce the number of imports for argparse

2017-04-28 Thread STINNER Victor
STINNER Victor added the comment: > $ time for i in `seq 100`; do ./python -S -c 'import argparse; > argparse.ArgumentParser()'; done Measuring Python startup performance is painful, there is a huge deviation. You may try the new "command" command that I added to perf 1.1:

[issue30195] writing non-ascii characters in xml file using python code embedded in C

2017-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: lxml is not the part of the Python standard library. Use lxml bug tracker if your issue is specific for lxml. If you can reproduce the issue with xml.etree.ElementTree from the stdlib, please provide a simple example code that does this. -- nosy:

[issue30196] Add __matmul__ to collections.Counter

2017-04-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___

[issue30196] Add __matmul__ to collections.Counter

2017-04-28 Thread Jáchym Barvínek
New submission from Jáchym Barvínek: The class collections.Counter should semantically contain only numbers, so it makes sense to define dot product od Counters, something like this: def __matmul__(self, other): return sum(self[x] * other[x] for x in self.keys() | other.keys()) I find this

[issue30195] writing non-ascii characters in xml file using python code embedded in C

2017-04-28 Thread mahboubi
New submission from mahboubi: my python code embedded in C program, uses etree from lxml to write a plain string as element attribute in xml file. the problem is when my string contains non english characters(non ascii), the program fails to write even with unicode conversion such as

[issue30052] URL Quoting page links to function Bytes instead of defintion

2017-04-28 Thread Nick Coghlan
Nick Coghlan added the comment: New PR disabling the output caching and adding a corresponding NEWS entry: https://github.com/python/cpython/pull/1339 On my local machine, it takes a "nothing changed" build from less than 2 seconds to just under 2 minutes, but I think that's fine for a daily

[issue30052] URL Quoting page links to function Bytes instead of defintion

2017-04-28 Thread Nick Coghlan
Changes by Nick Coghlan : -- pull_requests: +1450 ___ Python tracker ___ ___

[issue4773] HTTPMessage not documented and has inconsistent API across Py2/Py3

2017-04-28 Thread Socob
Changes by Socob <206a8...@opayq.com>: -- nosy: +Socob ___ Python tracker ___ ___ Python-bugs-list mailing

[issue24263] unittest cannot load module whose name starts with Unicode

2017-04-28 Thread Louie Lu
Louie Lu added the comment: Add PR: https://github.com/python/cpython/pull/1338/ rbcollins: Need for help to review the patch, I think that both `$thing` and `$thing.py` can't be used in python (and for UNIX dir), and `\u2603` (☃) though can do something like `☃.py`, but it is not a valid

[issue24263] unittest cannot load module whose name starts with Unicode

2017-04-28 Thread Louie Lu
Changes by Louie Lu : -- pull_requests: +1449 ___ Python tracker ___ ___ Python-bugs-list

[issue30103] uu package uses old encoding

2017-04-28 Thread Xiang Zhang
Xiang Zhang added the comment: token defines it as backquote. But in doc there are also several places calling it backticks[1][2]. Do you have any preference Serhiy and Martin? [1] https://docs.python.org/release/3.0.1/whatsnew/3.0.html#removed-syntax [2]

[issue30103] uu package uses old encoding

2017-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Python 2 used the term "backquote" when ` is a language part. -- ___ Python tracker ___

[issue30103] uu package uses old encoding

2017-04-28 Thread Xiang Zhang
Xiang Zhang added the comment: I think "grave accent" is not suitable. Although it's the standard unicode name but it's not commonly used in programming so not direct enough. "backquote" and "backtick" seems could be used interchangeably I don't have any preference. Perl seems to use backtick

[issue30103] uu package uses old encoding

2017-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Martin and Xiang. Wikipedia is not a reliable source, but it usually is based on reliable sources. In this case seems it is wrong. The next question is about parameter name. The Wikipedia uses the name "grave accent", the manpage of FreeBSD uuencode

[issue30152] Reduce the number of imports for argparse

2017-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: After reverting some changes (import heapq on Raymond's request and import gettext since it is needed for the ArgumentParser constructor) the effect of the patch is reducing the number of imports by 6 and the time by 0.017 sec (> 10%) on my computer. $