[issue27810] Add METH_FASTCALL: new calling convention for C functions

2016-08-21 Thread Stefan Behnel
Stefan Behnel added the comment: I agree that this would be cool. There is a tiny bit of a backwards compatibility concern as the new function signature would be incompatible with anything we had before, but I would guess that any code that chooses to bypass PyObject_Call() & friends would at

[issue27826] Null-pointer dereference in tuplehash() function

2016-08-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The simplest example: import marshal t = [], t[0].append(t) b = marshal.dumps(t) b = bytearray(b) b[2] = b'<'[0] marshal.loads(b) Create a recursive tuple containing a list containing a reference to original tuple. Marshal it and replace TYPE_LIST ('[') by

[issue27792] bool % int has inconsistent return type.

2016-08-21 Thread Xiang Zhang
Xiang Zhang added the comment: issue27792.patch tries to fix this. BTW, Mark, do you think the fast path in long_mod is really needed? Actually the same fast path has already existed in l_divmod. -- keywords: +patch Added file: http://bugs.python.org/file44185/issue27792.patch

[issue25532] infinite loop when running inspect.unwrap over unittest.mock.call

2016-08-21 Thread Hugo Geoffroy
Hugo Geoffroy added the comment: Another argument for having the fix in `unwrap` rather than `signature` is that this bug does not actually seem to be called by `signature`, as the doctest module calls `unwrap` for "inspect.isroutine(inspect.unwrap(val))". Also, this call does not even check

[issue27826] Null-pointer dereference in tuplehash() function

2016-08-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: It may be better to focus on Python/marshal.c to see if there are ways to make it more robust (at least checking to see if all of the n entries allocated in a container were actually filled). -- ___ Python

[issue16113] Add SHA-3 and SHAKE (Keccak) support

2016-08-21 Thread Aaron Gallagher
Aaron Gallagher added the comment: I'm not sure why one would pick and choose here—SHAKE is part of the NIST SHA-3 standard. -- ___ Python tracker ___

[issue16113] Add SHA-3 and SHAKE (Keccak) support

2016-08-21 Thread Donald Stufft
Donald Stufft added the comment: > I asked a room full of network engineers about SHAKE and not a single one of > them had heard of it Why would a network engineer know about a new variable length hashing algorithm? It's not really within their problem domain. --

[issue26488] hashlib command line interface

2016-08-21 Thread Guido van Rossum
Guido van Rossum added the comment: I prefer not to go down this road. The modules that do this where I use it are typically Python specific, e.g. pdb or timeit. In the past we sometimes had little main() functions in modules for testing but I think we have better ways to test modules these

[issue16113] Add SHA-3 and SHAKE (Keccak) support

2016-08-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: > The SHAKEs were low hanging fruits to implement, so I included them. I don't think this is sufficient motivation. Each new API is a permanent maintenance and documentation burden. It is also a burden to every new user seeing the module and trying to

[issue26488] hashlib command line interface

2016-08-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Guido, would you can to opine on this? Every now and then we get a request to make command-line utilities out of tools in the standard library. Whether we should or not depends on whether the standard library intends to be primarily a library for Python

[issue27435] ctypes library loading and AIX - also for 2.7.X (and later)

2016-08-21 Thread Martin Panter
Martin Panter added the comment: The ctypes tests all seem to be protected with code that checks for None, and explicitly skip the test in that case. The skip message should be visible when you run the test in verbose mode. We could avoid skipping these tests in 2.7 by adding a special case

[issue26488] hashlib command line interface

2016-08-21 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: rhettinger -> ___ Python tracker ___

[issue27826] Null-pointer dereference in tuplehash() function

2016-08-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: > but it might be better to avoid a crash here. I'm reluctant to introduce changes like this, especially in the middle of a loop. This code and code like it has been nonproblematic for Python's 26 year history. The code throughout tupleobject.c assumes

[issue27826] Null-pointer dereference in tuplehash() function

2016-08-21 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___

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

2016-08-21 Thread Martin Panter
Martin Panter added the comment: It looks like Bert’s patch adjusted two ldconfig calls; the first one was in a BSD-specific branch. Was this intended? Only the second call (default “else:” branch) seems applicable to AIX. Perhaps the performance is improved now that the popen() shell calls

[issue27823] Change bare AttributeError messages to be more informative

2016-08-21 Thread Emanuel Barry
Emanuel Barry added the comment: Thanks for your comments Xiang. Yes, it's not equal to #27794, but it's one of the multiple ways to fix it, so I made a new issue about it. The rationale between a bare `raise AttributeError` being changed is the idea that it carries no information, other than

[issue27826] Null-pointer dereference in tuplehash() function

2016-08-21 Thread Artem Smotrakov
Changes by Artem Smotrakov : -- keywords: +patch Added file: http://bugs.python.org/file44184/tuplehash.patch ___ Python tracker

[issue27826] Null-pointer dereference in tuplehash() function

2016-08-21 Thread Artem Smotrakov
New submission from Artem Smotrakov: A null-pointer dereference may happen while deserialization incorrect data with marshal.loads() function. Here is a test which reproduces this (see also attached marshal_tuplehash_null_dereference.py): import marshal value = ( # tuple1

[issue27746] ResourceWarnings in test_asyncio

2016-08-21 Thread STINNER Victor
STINNER Victor added the comment: STINNER Victor added the comment: > @Paul: close() is asynchronous in Python :-) Sorry. Async in asyncio... -- ___ Python tracker

[issue27821] IDLE custom keymaps don't work anymore (Windows, Python 3.6.0a3)

2016-08-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: (Don't install .0a2, .0a1 is good enough as comparison.) Are you saying that you see, in one line, (*) Use a Custom Key Set [IDLE Classic Windows --] (where -- is the select mini-button) This would be wrong and would suggest that 'IDLE Classis Windows' was

[issue12713] argparse: allow abbreviation of sub commands by users

2016-08-21 Thread paul j3
paul j3 added the comment: Another failure case: parser.add_argument('--int', type=int, choices=[10,15,25]) '--int 15` puts 'int=15' in the Namespace. '--int 2' puts 'int=2' in the Namespace, because it matches the 'str(25)'. '--int 1' raises an error in the ambiguity error formatting code:

[issue27825] Make the documentation for statistics' data argument clearer.

2016-08-21 Thread Ned Batchelder
New submission from Ned Batchelder: The docs for statistics.mean say, "Return the sample arithmetic mean of data, a sequence or iterator of real-valued numbers." Most of the functions in statistics have a `data` argument, but this function is the only one that says, "a sequence or iterator."

[issue24444] In argparse empty choices cannot be printed in the help

2016-08-21 Thread paul j3
paul j3 added the comment: This error is also produced by help = ' ' that is, a help line with all blanks. As long as there is a nonblank character in the help line it format fine. This issue doesn't need to be resolved by itself, but should be considered if and when the formatting of

[issue27822] Fail to create _SelectorTransport with unbound socket

2016-08-21 Thread Paul McGuire
Paul McGuire added the comment: Patch file attached. -- keywords: +patch Added file: http://bugs.python.org/file44182/ptm_27822.patch ___ Python tracker

[issue27819] Always distribute sdist packages as gztar.

2016-08-21 Thread Jason R. Coombs
Changes by Jason R. Coombs : -- status: open -> closed ___ Python tracker ___ ___

[issue27819] Always distribute sdist packages as gztar.

2016-08-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset ed9cabce9c38 by Jason R. Coombs in branch 'default': Issue #27819: Add more detail in What's New in 3.6. https://hg.python.org/cpython/rev/ed9cabce9c38 -- ___ Python tracker

[issue27819] Always distribute sdist packages as gztar.

2016-08-21 Thread Jason R. Coombs
Jason R. Coombs added the comment: Good suggestions. -- status: closed -> open ___ Python tracker ___ ___

[issue27746] ResourceWarnings in test_asyncio

2016-08-21 Thread STINNER Victor
STINNER Victor added the comment: @Paul: close() is asynchronous in Python :-) -- ___ Python tracker ___ ___

[issue23229] add inf, nan, infj, nanj to cmath module

2016-08-21 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a patch that adds inf, infj, nan and nanj. -- keywords: +patch Added file: http://bugs.python.org/file44181/cmath_inf_nan.patch ___ Python tracker

[issue27822] Fail to create _SelectorTransport with unbound socket

2016-08-21 Thread Guido van Rossum
Guido van Rossum added the comment: Can you supply a patch yourself? --Guido (mobile) -- ___ Python tracker ___

[issue27823] Change bare AttributeError messages to be more informative

2016-08-21 Thread Xiang Zhang
Xiang Zhang added the comment: -1. I don't think this is equal to issue27794. I don't hope when I use `raise AttributeError`, Python hides some magic and sets a message I totally don't want. If you do want a good message, why not passing the message when raising? --

[issue26984] int() can return not exact int instance

2016-08-21 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue27643] test_ctypes fails on AIX with xlc

2016-08-21 Thread Michael Felt
Michael Felt added the comment: I'll get to this asap. Have to install a new "clean" environment aka a new virtual machine. On 18-Aug-16 02:43, Martin Panter wrote: > Martin Panter added the comment: > > Michael, byref() is just a helper for passing an object’s address to a C > function.

[issue27817] tkinter string variable misinterpreted as boolean

2016-08-21 Thread Andreas Bolsch
Andreas Bolsch added the comment: I'm afraid I don't know Tcl nor python good enough to be able to strip this down to a reasonably simple test case. However, I wonder what's going on there: When the Tcl variable holding the radiobutton's value contains "x", "z", ..., value->typePtr always

[issue27435] ctypes library loading and AIX - also for 2.7.X (and later)

2016-08-21 Thread Michael Felt
Michael Felt added the comment: The more common TESTED "behavior" issue is simply: find_library("c") always returns None while it should be returning either libc.a(shr.o) in 32-bit mode and libc.a(shr_64.o) in 64-bit mode. If that gets corrected, then adding RTLD_MEMBER it's numerical

[issue27824] update ConfigParser docs regarding in-line comments

2016-08-21 Thread Joshua Haas
New submission from Joshua Haas: Originally reported at http://bugs.python.org/issue27762 as a behavior bug but was determined to be won't fix. Thus I think this needs to be mentioned in the documentation at https://docs.python.org/2/library/configparser.html I propose that directly after the

[issue26984] int() can return not exact int instance

2016-08-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 81f229262921 by Serhiy Storchaka in branch 'default': Issue #26984: int() now always returns an instance of exact int. https://hg.python.org/cpython/rev/81f229262921 -- nosy: +python-dev ___ Python

[issue27823] Change bare AttributeError messages to be more informative

2016-08-21 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list

[issue26488] hashlib command line interface

2016-08-21 Thread Antonio Valentino
Antonio Valentino added the comment: Hi all, please note that to stay compatible with the GNU md5sum utility you should print the file name prefixed by a "*" if you read the file in binary mode. Also when digests is checked, files to check should be opened in binary or text mode according the

[issue21718] sqlite3 cursor.description seems to rely on incomplete statement parsing for detection

2016-08-21 Thread Tom Tanner
Tom Tanner added the comment: will the fix be backported to 2.7? -- ___ Python tracker ___ ___

[issue21718] sqlite3 cursor.description seems to rely on incomplete statement parsing for detection

2016-08-21 Thread Berker Peksag
Changes by Berker Peksag : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2016-08-21 Thread Emanuel Barry
Emanuel Barry added the comment: Opened #27823 as a followup to this, and carried nosy list over. -- ___ Python tracker ___

[issue21718] sqlite3 cursor.description seems to rely on incomplete statement parsing for detection

2016-08-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 45ef062734d6 by Berker Peksag in branch '3.5': Issue #21718: cursor.description is now available for queries using CTEs https://hg.python.org/cpython/rev/45ef062734d6 New changeset cf18375732ae by Berker Peksag in branch 'default': Issue #21718:

[issue27823] Change bare AttributeError messages to be more informative

2016-08-21 Thread Emanuel Barry
New submission from Emanuel Barry: Attached patch changes bare attribute errors to add a useful error message. As such, `raise AttributeError` and `raise AttributeError(None)` (but not `raise AttributeError('')` for example) inside any of the attribute lookup or descriptor methods

[issue27746] ResourceWarnings in test_asyncio

2016-08-21 Thread Paul McGuire
Paul McGuire added the comment: Ok, I will submit as a separate issue. -- ___ Python tracker ___ ___

[issue27746] ResourceWarnings in test_asyncio

2016-08-21 Thread Xiang Zhang
Xiang Zhang added the comment: The patch I submitted is about to solve the resource leak in the test suite. Paul, your problem seems to need other triage. -- ___ Python tracker

[issue27821] IDLE custom keymaps don't work anymore (Windows, Python 3.6.0a3)

2016-08-21 Thread Vedran Čačić
Vedran Čačić added the comment: Windows 10. No, I jumped from .0a1 to .0a3. Now I installed .0a4 and have the same problem. I'm afraid of going back to .0a2, was taught long ago to never downgrade anything. :-) But I have 3.5.1 installed separately, and its IDLE keeps working without problem.

[issue27539] negative Fraction ** negative int not normalized

2016-08-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. -- nosy: +serhiy.storchaka stage: -> commit review ___ Python tracker ___

[issue27821] IDLE custom keymaps don't work anymore (Windows, Python 3.6.0a3)

2016-08-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: I use a custom key set also and have no problem before or after the Modern Unux patch (else I would not have applied it ;-). Did you have .0a2 installed? Which Windows? What I have in config-main.cfg is [Keys] default = False name = Terry [Theme]

[issue27746] ResourceWarnings in test_asyncio

2016-08-21 Thread Martin Panter
Changes by Martin Panter : -- stage: needs patch -> patch review ___ Python tracker ___

[issue27810] Add METH_FASTCALL: new calling convention for C functions

2016-08-21 Thread Stefan Behnel
Changes by Stefan Behnel : -- nosy: +scoder ___ Python tracker ___ ___

[issue27128] Add _PyObject_FastCall()

2016-08-21 Thread Stefan Behnel
Changes by Stefan Behnel : -- nosy: +scoder ___ Python tracker ___ ___

[issue27822] Fail to create _SelectorTransport with unbound socket

2016-08-21 Thread Paul McGuire
Paul McGuire added the comment: (issue applies to both 3.5.2 and 3.6) -- versions: +Python 3.5 ___ Python tracker ___

[issue27746] ResourceWarnings in test_asyncio

2016-08-21 Thread Paul McGuire
Paul McGuire added the comment: I was about to report this same issue - I get the error message even though I explicitly call transport.close(): C:\Python35\lib\asyncio\selector_events.py:582: ResourceWarning: unclosed transport <_SelectorDatagramTransport closing fd=232> It looks like the

[issue27822] Fail to create _SelectorTransport with unbound socket

2016-08-21 Thread Paul McGuire
Paul McGuire added the comment: To clarify how I'm using a socket without a bound address, I am specifying the destination address in the call to transport.sendto(), so there is no address on the socket itself, hence getsockname() fails. -- ___

[issue26984] int() can return not exact int instance

2016-08-21 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: mark.dickinson -> serhiy.storchaka stage: patch review -> commit review ___ Python tracker

[issue27822] Fail to create _SelectorTransport with unbound socket

2016-08-21 Thread Paul McGuire
New submission from Paul McGuire: In writing a simple UDP client using asyncio, I tripped over a call to getsockname() in the _SelectorTransport class in asyncio/selector_events.py. def __init__(self, loop, sock, protocol, extra=None, server=None): super().__init__(extra, loop)

[issue26984] int() can return not exact int instance

2016-08-21 Thread Mark Dickinson
Mark Dickinson added the comment: The patch LGTM. I'm still in two minds about whether `__trunc__` should be required to return a strict `int`, but for now it's probably better to go with the status quo. -- ___ Python tracker

[issue27821] IDLE custom keymaps don't work anymore (Windows, Python 3.6.0a3)

2016-08-21 Thread Vedran Čačić
New submission from Vedran Čačić: I had a custom keymap in IDLE. Since I installed 3.6.0a3, it doesn't work anymore. Worse, I cannot switch to anything except "IDLE Classic Windows" - Apply does nothing, but when I click OK, it doesn't switch. I suppose

[issue25604] [Minor] bug in integer true division algorithm

2016-08-21 Thread Mark Dickinson
Mark Dickinson added the comment: Fixed for 2.7 and 3.6. I don't think it's worth backporting the fix to 3.5 without evidence of actual incorrect results arising from this bug. -- resolution: -> fixed stage: -> resolved status: open -> closed ___

[issue25604] [Minor] bug in integer true division algorithm

2016-08-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 370bbeba21b3 by Mark Dickinson in branch '2.7': Issue #25604: Fix bug in integer true division that could have resulted in off-by-one-ulp results in unusual cases. https://hg.python.org/cpython/rev/370bbeba21b3 --

[issue27539] negative Fraction ** negative int not normalized

2016-08-21 Thread Mark Dickinson
Mark Dickinson added the comment: > How/when does this appear in 3.6 line? After allowing a couple of days for review, I'll commit the issue_27539_fix patch to the 3.5 branch, then immediately merge it to the 3.6 "default" branch. So that fix should appear in the upcoming 3.6 beta1.

[issue27539] negative Fraction ** negative int not normalized

2016-08-21 Thread Mark Dickinson
Mark Dickinson added the comment: > Do I report a new issue and refer to this one? Sure, that would work. A patch that included the change and a test that checks that `Fraction(3, 4, True)` raises TypeError would be good, too. -- ___ Python tracker

[issue27539] negative Fraction ** negative int not normalized

2016-08-21 Thread Vedran Čačić
Vedran Čačić added the comment: > it's independent of the fix, and should probably be a 3.6-only change. Fair enough. Two questions: How/when does this appear in 3.6 line? I guess there is a standard timeline of how bugfixes are "forwardported", but I don't know what it is. How do I make the

[issue25604] [Minor] bug in integer true division algorithm

2016-08-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset b9e12ca6fdb6 by Mark Dickinson in branch 'default': Issue #25604: Fix minor bug in integer true division, which could https://hg.python.org/cpython/rev/b9e12ca6fdb6 -- nosy: +python-dev ___ Python

[issue27539] negative Fraction ** negative int not normalized

2016-08-21 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a patch (against the 3.5 tip). I've dropped the keyword-only `_normalize` change; I have no objections to that change, but it's independent of the fix, and should probably be a 3.6-only change. -- Added file:

[issue16968] Fix test discovery for test_concurrent_futures.py

2016-08-21 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue27662] Check against PY_SSIZE_T_MAX instead of PY_SIZE_MAX in List_New

2016-08-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset c7f9e66826a0 by Mark Dickinson in branch 'default': Issue #27662: add missing Misc/NEWS entry. https://hg.python.org/cpython/rev/c7f9e66826a0 -- ___ Python tracker

[issue27782] Multi-phase extension module initialization, inconsistent exceptions and conflicts between code and PEP

2016-08-21 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for your work too, Nick! :) Active reply from the core devs always gives me more motivation to open source. -- ___ Python tracker

[issue16764] Make zlib accept keyword-arguments

2016-08-21 Thread Xiang Zhang
Xiang Zhang added the comment: I think it's okay to close now. -- ___ Python tracker ___ ___ Python-bugs-list

[issue27539] negative Fraction ** negative int not normalized

2016-08-21 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: -> mark.dickinson ___ Python tracker ___ ___

[issue27662] Check against PY_SSIZE_T_MAX instead of PY_SIZE_MAX in List_New

2016-08-21 Thread Mark Dickinson
Mark Dickinson added the comment: List_New_Calloc_v2.patch applied. Thanks! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue27662] Check against PY_SSIZE_T_MAX instead of PY_SIZE_MAX in List_New

2016-08-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset cd3d079ad2b5 by Mark Dickinson in branch 'default': Issue #27662: don't use PY_SIZE_MAX for overflow checking in List_New. Patch by Xiang Zhang. https://hg.python.org/cpython/rev/cd3d079ad2b5 -- nosy: +python-dev

[issue27782] Multi-phase extension module initialization, inconsistent exceptions and conflicts between code and PEP

2016-08-21 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks for the bug report and the patch! These kinds of collaborative interactions are my favourite aspect of open source participation :) -- resolution: -> fixed stage: commit review -> resolved status: open -> closed

[issue27782] Multi-phase extension module initialization, inconsistent exceptions and conflicts between code and PEP

2016-08-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 913268337886 by Nick Coghlan in branch '3.5': Issue #27782: Fix m_methods handling in multiphase init https://hg.python.org/cpython/rev/913268337886 New changeset fb509792dffc by Nick Coghlan in branch 'default': Merge #27782 fix from 3.5

[issue27805] In Python 3, open('/dev/stdout', 'a') raises OSError with errno=ESPIPE

2016-08-21 Thread Antti Haapala
Antti Haapala added the comment: Yeah, it definitely is a bug in CPython. open(mode='a') should always append to the end of the given file. If you're writing an append-only text log to some file-like object, that's the mode you use, not some version/platform/filesystem specific voodoo to

[issue25532] infinite loop when running inspect.unwrap over unittest.mock.call

2016-08-21 Thread Nick Coghlan
Nick Coghlan added the comment: My current inclination is that the right fix here is to have a hard limit in inspect.unwrap() itself, on the basis of "we won't eat all the memory on your machine, even when other code produces an infinite chain of distinct __wrapped__ attributes" is a

[issue25532] infinite loop when running inspect.unwrap over unittest.mock.call

2016-08-21 Thread Nick Coghlan
Nick Coghlan added the comment: The infinite loop reported here is an inspect.signature bug - it's supposed to prevent infinite loops, but we didn't account for cases where "obj.__wrapped__" implicitly generates a fresh object every time. unittest.mock.Mock is the only case of that in the

[issue16764] Make zlib accept keyword-arguments

2016-08-21 Thread Martin Panter
Martin Panter added the comment: All the interesting keyword arguments seem to work now (checking against my notes from earlier). Is there anything else anyone wants to do, or can we close this now? -- stage: commit review -> resolved ___ Python

[issue25532] infinite loop when running inspect.unwrap over unittest.mock.call

2016-08-21 Thread Hugo Geoffroy
Hugo Geoffroy added the comment: You are right, the fix would be better suited in `unwrap`. But, still, shouldn't any `__getattr__` implementation take care of not returning, for the `__wrapped__` attribute, a dynamic wrapper that provides the same attribute ? `__wrapped__` is commonly