[issue20430] Make argparse.SUPPRESS work as an argument "dest"

2016-04-24 Thread paul j3
paul j3 added the comment: I just found a case where `dest` is `SUPPRESS` - the default subparsers setup. _SubParsersAction(option_strings=[], dest='==SUPPRESS==', nargs='A...', ... If I make this Action 'required' (in the current distribution 'subparsers' are not required - there's a

[issue24114] ctypes.utils uninitialized variable 'paths'

2016-04-24 Thread Berker Peksag
Changes by Berker Peksag : -- keywords: +easy versions: +Python 3.5, Python 3.6 ___ Python tracker ___

[issue24331] *** Error in `/usr/bin/python': double free or corruption (!prev): 0x0000000000f5c760 *** when cloning hg repository into directory on cifs

2016-04-24 Thread Berker Peksag
Berker Peksag added the comment: Agreed, this is unlikely an issue with Python. Please report it to Mercurial developers. -- nosy: +berker.peksag resolution: -> third party stage: -> resolved status: open -> closed ___ Python tracker

[issue23961] IDLE autocomplete window does not automatically close when selection is made

2016-04-24 Thread Berker Peksag
Changes by Berker Peksag : -- stage: -> resolved status: open -> closed superseder: -> IDLE code completion window can hang or misbehave with mouse ___ Python tracker

[issue11063] uuid.py module import has heavy side effects

2016-04-24 Thread Martin Panter
Martin Panter added the comment: One thing I am wondering about is why we have to use find_library() at all. Wouldn’t it be more robust, and more efficient, to call CDLL() directly? We just have to know the exactly library version we are expecting. On Linux, the full soname is libuuid.so.1.

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-04-24 Thread Martin Panter
Martin Panter added the comment: Maybe Issue 21826 is relevant (slowdown on AIX caused by missing ldconfig) -- nosy: +martin.panter ___ Python tracker

[issue21826] Performance issue (+fix) AIX ctypes.util with no /sbin/ldconfig present

2016-04-24 Thread Martin Panter
Martin Panter added the comment: See also Issue 26439 about find_library() AIX support -- nosy: +martin.panter ___ Python tracker ___

[issue21622] ctypes.util incorrectly fails for libraries without DT_SONAME

2016-04-24 Thread Martin Panter
Martin Panter added the comment: On Linux, the find_library() function is documented to return “the filename of the library file”, but in reality it seems it return the soname, and therefore breaks if there is no soname. I do not know why we extract the soname, but it has been that way at

[issue19317] ctypes.util.find_library should examine binary's RPATH on Solaris

2016-04-24 Thread Martin Panter
Martin Panter added the comment: find_library() is documented as emulating the build-time linker, and I suspect the RPATH of the Python executable is not relevant at build time. See also Issue 9998 and Issue 18502. -- nosy: +martin.panter ___

[issue9998] ctypes find_library should search LD_LIBRARY_PATH on linux

2016-04-24 Thread Martin Panter
Martin Panter added the comment: I also found Issue 18502 essentially about the same incompatibility between CDLL() and find_library(). The problem I see with using find_library() to blindly load a library is that you could be loading an incompatible version (wrong soname). That is why I

[issue26843] tokenize does not include Other_ID_Start or Other_ID_Continue in identifier

2016-04-24 Thread Joshua Landau
New submission from Joshua Landau: This is effectively a continuation of https://bugs.python.org/issue9712. The line in Lib/tokenize.py Name = r'\w+' must be changed to a regular expression that accepts Other_ID_Start at the start and Other_ID_Continue elsewhere. Hence tokenize does not

[issue26793] uuid causing thread issues when forking using os.fork py3.4+

2016-04-24 Thread Steven Adams
Steven Adams added the comment: anyone got any other thoughts on this?? -- ___ Python tracker ___ ___

[issue18502] CDLL does not use same paths as util.find_library

2016-04-24 Thread Martin Panter
Martin Panter added the comment: Documenting this quirk seems reasonable to me if you want to suggest a patch (and we don’t agree to fix it). See Issue 21042 for returning full paths on Linux. We tried to make this change, but it wasn’t easy to do it consistently for arbitrary ABIs, so I

[issue6338] Error message displayed on stderr when no C compiler is present with ctypes

2016-04-24 Thread Martin Panter
Martin Panter added the comment: It would be good to close the file when it’s no longer needed. Also, if this bug is relevant to Python 3, I would use open() rather than file(). -- nosy: +martin.panter stage: -> patch review ___ Python tracker

[issue24114] ctypes.utils uninitialized variable 'paths'

2016-04-24 Thread Martin Panter
Changes by Martin Panter : -- stage: patch review -> needs patch title: ctypes.utils uninitialized variable 'path' -> ctypes.utils uninitialized variable 'paths' type: -> behavior ___ Python tracker

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-04-24 Thread Eric Hanchrow
Changes by Eric Hanchrow : -- nosy: +Eric.Hanchrow ___ Python tracker ___ ___

[issue21622] ctypes.util incorrectly fails for libraries without DT_SONAME

2016-04-24 Thread Kylie McClain
Kylie McClain added the comment: This is still a problem on musl distributions as of 2.7.11. Are there any plans to fix this? Patch used by Alpine Linux: http://git.alpinelinux.org/cgit/aports/tree/main/python/musl-find_library.patch -- nosy: +Kylie McClain

[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-24 Thread Martin Panter
Martin Panter added the comment: Yes that was my rambling way of saying that I had checked to see if they were in the right place, and reporting that it was all okay :) New patch seems okay to me. -- ___ Python tracker

[issue26800] Don't accept bytearray as filenames part 2

2016-04-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3fb0f9a0b195 by Guido van Rossum in branch 'default': Rip out the promotion from bytearray/memoryview to bytes. See http://bugs.python.org/issue26800. https://hg.python.org/peps/rev/3fb0f9a0b195 -- nosy: +python-dev

[issue26800] Don't accept bytearray as filenames part 2

2016-04-24 Thread Guido van Rossum
Guido van Rossum added the comment: Sigh, I was wrong, not only does mypy promote bytearray to bytes, it actually depends on this in its own code. Not for filenames, but for a regex match. It reads the source into a bytearray, and then passes that to something that uses regex matches (which *do*

[issue26837] assertSequenceEqual() raises BytesWarning when format message

2016-04-24 Thread Martin Panter
Martin Panter added the comment: I think the change is good in spirit, especially using repr() and limiting the size. See the review for a couple problems. -- nosy: +martin.panter stage: -> patch review ___ Python tracker

[issue26800] Don't accept bytearray as filenames part 2

2016-04-24 Thread Guido van Rossum
Guido van Rossum added the comment: OK, it isn't worth fighting for. I will update PEP 484. It seems mypy doesn't support the special treatment bytearray anyway. For posterity, the reason I thought that bytearray should be accepted is not that bytearray is better in any way, just that sometimes

[issue26842] Python Tutorial 4.7.1: Need to explain default parameter lifetime

2016-04-24 Thread Edward Segall
New submission from Edward Segall: I am using the tutorial to learn Python. I know many other languages, and I've taught programming language theory, but even so I found the warning in Section 4.7.1 about Default Argument Values to be confusing. After I spent some effort investigating what

[issue12305] Building PEPs doesn't work on Python 3

2016-04-24 Thread Berker Peksag
Berker Peksag added the comment: peps repo is now Python 3 compatible. Related commits: * https://github.com/python/peps/commit/88f9f6da5d51a36d0f6a1bb833a6e8c85763c7d2 * https://github.com/python/peps/commit/3e5cad857053e0c15b2621dae728f32b4099c1a5 -- nosy: +berker.peksag resolution:

[issue26822] itemgetter/attrgetter/methodcaller objects ignore keyword arguments

2016-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch that adds fast checks before calling _PyArg_NoKeywords(). Other option is redefine _PyArg_NoKeywords as a macro: #define _PyArg_NoKeywords(name, kw) ((kw) != NULL && _PyArg_NoKeywords((name), (kw))) This will affect all usages of

[issue26249] Change PyMem_Malloc to use pymalloc allocator

2016-04-24 Thread STINNER Victor
STINNER Victor added the comment: I documented the change, buildbots are happy, I close the issue. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue26840] Hidden test in test_heapq

2016-04-24 Thread Berker Peksag
Berker Peksag added the comment: This is a duplicate of issue 19119. -- nosy: +berker.peksag resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> duplicate test name in Lib/test/test_heapq.py ___ Python

[issue26841] Hidden test in ctypes tests

2016-04-24 Thread Berker Peksag
Berker Peksag added the comment: This is a duplicate of issue 19113. -- nosy: +berker.peksag resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> duplicate test names in Lib/ctypes/test/test_functions.py ___ Python

[issue26249] Change PyMem_Malloc to use pymalloc allocator

2016-04-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7acad5d8f80e by Victor Stinner in branch 'default': Issue #26249: Mention PyMem_Malloc() change in What's New in Python 3.6 in the https://hg.python.org/cpython/rev/7acad5d8f80e -- ___ Python tracker

[issue26698] Tk DPI awareness

2016-04-24 Thread Westley Martínez
Westley Martínez added the comment: IDLE 3.5.1 on Windows 10 -- ___ Python tracker ___ ___ Python-bugs-list

[issue26841] Hidden test in ctypes tests

2016-04-24 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: There are two methods named "test_errors" in FunctionTestCase in Lib/ctypes/test/test_functions.py. The latter hides the former. -- components: Tests messages: 264127 nosy: amaury.forgeotdarc, belopolsky, meador.inge, serhiy.storchaka priority:

[issue26839] python always calls getrandom() at start, causing long hang after boot

2016-04-24 Thread STINNER Victor
STINNER Victor added the comment: Python 3 uses os.urandom() at startup to randomize the hash function. os.urandom() now uses the new Linux getrandom() function which blocks until the Linux kernel is feeded with enough entropy. It's a deliberate choice. The workaround is simple: set the

[issue26822] itemgetter/attrgetter/methodcaller objects ignore keyword arguments

2016-04-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: In general there should be an early out test for keywords==NULL before calling the comparatively high overhead function _PyArg_NoKeywords. That function adds overhead everywhere it is used and provides zero benefit to correct programs in order to provide

[issue26800] Don't accept bytearray as filenames part 2

2016-04-24 Thread STINNER Victor
STINNER Victor added the comment: I'm really sceptical that anyone really use bytearray for filenames in Python. I'm quite sure that most functions fail with bytearray. Do you have an example of application using bytearray? What's the point of using bytearray? To limit memory copy and

[issue26840] Hidden test in test_heapq

2016-04-24 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: There are two methods test_get_only in TestErrorHandling in test_heapq. The latter hides the former. There is only one test_get_only in 2.7. -- assignee: rhettinger components: Tests messages: 264123 nosy: rhettinger, serhiy.storchaka priority:

[issue26839] python always calls getrandom() at start, causing long hang after boot

2016-04-24 Thread Matthias Klose
Matthias Klose added the comment: other issues fixed between these dates: - Issue #26659: Make the builtin slice type support cycle collection. - Issue #26718: super.__init__ no longer leaks memory if called multiple times. NOTE: A direct call of super.__init__ is not endorsed!

[issue26839] python always calls getrandom() at start, causing long hang after boot

2016-04-24 Thread Matthias Klose
New submission from Matthias Klose: [forwarded from https://bugs.debian.org/822431] This regression / change of behaviour was seen between 20160330 and 20160417 on the 3.5 branch. The only check-in which could affect this is the fix for issue #26735. 3.5.1-11 = 20160330 3.5.1-12 = 20160417

[issue23277] Cleanup unused and duplicate imports in tests

2016-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Berker. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement ___ Python tracker

[issue23277] Cleanup unused and duplicate imports in tests

2016-04-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset fa44d1bc9b68 by Serhiy Storchaka in branch 'default': Issue #23277: Remove unused imports in tests. https://hg.python.org/cpython/rev/fa44d1bc9b68 -- ___ Python tracker

[issue26800] Don't accept bytearray as filenames part 2

2016-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The os.path module and os.fsdecode() don't support bytearray paths. Should we add bytearray support? This will complicate and slowdown os.path functions which often are used multiple times in tight loops. Correspondingly, many Python implemented functions

[issue26739] idle: Errno 10035 a non-blocking socket operation could not be completed immediately

2016-04-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: Kristján, thank you for the response. The socket communication part of IDLE is pretty much a black box to me. Just to clarify, you are saying that select polling is only needed for non-blocking sockets; sockets are blocking by default; and you see no

[issue23277] Cleanup unused and duplicate imports in tests

2016-04-24 Thread Berker Peksag
Berker Peksag added the comment: LGTM -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-24 Thread Hans-Peter Jansen
Hans-Peter Jansen added the comment: > In Python 2, it looks like the proxy_bypass_etc() functions are defined > in urllib and imported into urllib2, so it makes sense to include the > tests in test_urllib rather than test_urllib2. The tests are in test_urllib. test_urllib2 is testing proxy

[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-24 Thread Hans-Peter Jansen
Hans-Peter Jansen added the comment: * blatant error fixed * one test case added -- Added file: http://bugs.python.org/file42582/python-urllib-prefer-lowercase-proxies-v6.diff ___ Python tracker

[issue26800] Don't accept bytearray as filenames part 2

2016-04-24 Thread Guido van Rossum
Guido van Rossum added the comment: OK, I actually agree with you on memoryview and and other types that support the buffer view. I will update PEP 484 to exclude memoryview. But I think bytearray has a special role and purose, and as much as possible it needs to be accepted in places that

[issue26838] sax.xmlreader.InputSource.setCharacterStream() does not work?

2016-04-24 Thread Alan Jenkins
Alan Jenkins added the comment: Looks like this is documented elsewhere and fixed in 3.5. https://fossies.org/diffs/Python/3.4.3_vs_3.5.0/Doc/library/xml.sax.reader.rst-diff.html -- status: open -> closed ___ Python tracker

[issue26838] sax.xmlreader.InputSource.setCharacterStream() does not work?

2016-04-24 Thread Alan Jenkins
New submission from Alan Jenkins: python3-3.4.3-5.fc23-x86_64 So far I spelunked here. Starting from . I experimented with using setCharacterStream() instead of setByteStream() setCharacterStream() is shown in documentation but exercising

[issue26837] assertSequenceEqual() raises BytesWarning when format message

2016-04-24 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: assertSequenceEqual() raises BytesWarning when format failure report. See for example http://buildbot.python.org/all/builders/AMD64%20OpenIndiana%203.x/builds/10575/steps/test/logs/stdio :

[issue26836] Add memfd_create to os module

2016-04-24 Thread Christian Heimes
New submission from Christian Heimes: Add memfd_create() and constants MFD_ALLOW_SEALING, MFD_CLOEXEC to the os module. A glibc wrapper for memfd_create() is not available yet but the interface has been standardized. http://man7.org/linux/man-pages/man2/memfd_create.2.html

[issue26835] Add file-sealing ops to fcntl

2016-04-24 Thread Christian Heimes
New submission from Christian Heimes: The file-sealing ops are useful for memfd_create(). The new syscall and ops are only available on Linux with a recent kernel. http://man7.org/linux/man-pages/man2/fcntl.2.html http://man7.org/linux/man-pages/man2/memfd_create.2.html Code: #include

[issue23277] Cleanup unused and duplicate imports in tests

2016-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is the patch that contains the rest of changes, after resolving conflicts and fixing some errors. I have reviewed and tested these changes and they LGTM. I think it is worth to push them. -- resolution: fixed -> status: closed -> open Added

[issue23277] Cleanup unused and duplicate imports in tests

2016-04-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9d7f2615f7b3 by Serhiy Storchaka in branch 'default': Issue #23277: Remove more unused sys and os imports. https://hg.python.org/cpython/rev/9d7f2615f7b3 New changeset abf3f0dcf2fd by Serhiy Storchaka in branch 'default': Issue #23277: Remove

[issue26739] idle: Errno 10035 a non-blocking socket operation could not be completed immediately

2016-04-24 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Caveat emptor: I know nothing of IDLE, and I even suspect it to be dead or dying code. Non the less, it could be patched. I found this in the code: def putmessage(self, message): self.debug("putmessage:%d:" % message[0]) try:

[issue20572] subprocess.Popen.wait() undocumented "endtime" parameter

2016-04-24 Thread Daryl Luna
Changes by Daryl Luna : -- nosy: +Daryl Luna status: pending -> open Added file: http://bugs.python.org/file42579/downloadfile.htm ___ Python tracker

[issue26739] idle: Errno 10035 a non-blocking socket operation could not be completed immediately

2016-04-24 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Hi there. I don't think this is in relation to issue #9090. That one had to do with the internal mechanisms of doing blocking IO with timeout. this is done internally by using non-blocking sockets and select(), and the backport dealt with some edge

[issue23277] Cleanup unused and duplicate imports in tests

2016-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Note that setUpModule is correctly imported in Lib/tkinter/test/test_tkinter/test_widgets.py. -- nosy: +serhiy.storchaka ___ Python tracker

[issue26814] [WIP] Add a new _PyObject_FastCall() function which avoids the creation of a tuple or dict for arguments

2016-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think you can simplify the patch by dropping keyword arguments support from fastcall. Then you can decrease _PyStack_SIZE to 4 (larger size will serve only 1.7% of calls), and may be refactor a code since an array of 4 pointers consumes less C stack than

[issue26814] [WIP] Add a new _PyObject_FastCall() function which avoids the creation of a tuple or dict for arguments

2016-04-24 Thread STINNER Victor
STINNER Victor added the comment: > Thus I think we need to optimize only cases of calling with small number > (0-3) of positional arguments. My code is optimized to up to 10 positional arguments: with 0..10 arguments, the C stack is used to hold the array of PyObject*. For more arguments, an

[issue26801] Fix shutil.get_terminal_size() to catch AttributeError

2016-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Martin, your comment is helpful. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue26801] Fix shutil.get_terminal_size() to catch AttributeError

2016-04-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset df8652452d25 by Serhiy Storchaka in branch '3.5': Issue #26801: shutil.get_terminal_size() now handles the case of stdout is https://hg.python.org/cpython/rev/df8652452d25 New changeset d6e6dcef674f by Serhiy Storchaka in branch 'default': Issue

[issue26814] [WIP] Add a new _PyObject_FastCall() function which avoids the creation of a tuple or dict for arguments

2016-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have collected statistics about using CALL_FUNCTION* opcodes in compliled code during running CPython testsuite. According to it, 99.4% emitted opcodes is the CALL_FUNCTION opcode, and 89% of emitted CALL_FUNCTION opcodes have only positional arguments,

[issue26801] Fix shutil.get_terminal_size() to catch AttributeError

2016-04-24 Thread STINNER Victor
STINNER Victor added the comment: Martin's comment is helpful and LGTM. -- ___ Python tracker ___ ___

[issue24911] Context manager of socket.socket is not documented

2016-04-24 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

[issue26801] Fix shutil.get_terminal_size() to catch AttributeError

2016-04-24 Thread Martin Panter
Martin Panter added the comment: How about: try: size = os.get_terminal_size(sys.__stdout__.fileno()) except (AttributeError, ValueError, OSError): # stdout is None, closed, detached, or not a terminal, or # os.get_terminal_size() is unsupported size = os.terminal_size(fallback)