[issue30100] WeakSet should allow discard and remove on items that can't have weak references

2017-04-23 Thread donkopotamus
Changes by donkopotamus : -- title: WeakSet should all discard and remove on items that can have weak references -> WeakSet should allow discard and remove on items that can't have weak references ___ Python tracker

[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-23 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: I merged the PR, backported it to 3.5 and 3.6, and added Cheryl to Misc/ACKS. Thanks everyone :) -- resolution: -> fixed stage: backport needed -> resolved status: open -> closed ___ Python tracker

[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-23 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: New changeset 9eb5ca0774f94215be48442100c829db2484e146 by Mariatta in branch 'master': bpo-29751: add Cheryl Sabella to Misc/ACKS (GH-1268) https://github.com/python/cpython/commit/9eb5ca0774f94215be48442100c829db2484e146 --

[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-23 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: New changeset ea0efa3bc1d0b832da75519c6f85d767ae44feda by Mariatta in branch '3.6': [3.6] bpo-29751: Improve PyLong_FromString documentation (GH-915) (#1266) https://github.com/python/cpython/commit/ea0efa3bc1d0b832da75519c6f85d767ae44feda --

[issue30146] Difference in behavior between set() and collections.abc.MutableSet() derived objects

2017-04-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> rhettinger ___ Python tracker ___

[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-23 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: New changeset d51d093b9bbca108f59bad0f1730c48ebf5b2e14 by Mariatta in branch '3.5': [3.5] bpo-29751: Improve PyLong_FromString documentation (GH-915) (#1267) https://github.com/python/cpython/commit/d51d093b9bbca108f59bad0f1730c48ebf5b2e14 --

[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-23 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +1380 ___ Python tracker ___ ___

[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-23 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +1379 ___ Python tracker ___ ___

[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-23 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +1378 ___ Python tracker ___ ___

[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-23 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- stage: patch review -> backport needed ___ Python tracker ___

[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-23 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: New changeset 26896f2832324dde85cdd63d525571ca669f6f0b by Mariatta (csabella) in branch 'master': bpo-29751: Improve PyLong_FromString documentation (GH-915) https://github.com/python/cpython/commit/26896f2832324dde85cdd63d525571ca669f6f0b -- nosy:

[issue30140] Binary arithmetic does not always call subclasses first

2017-04-23 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- nosy: +rhettinger ___ Python tracker ___ ___

[issue30140] Binary arithmetic does not always call subclasses first

2017-04-23 Thread Stephan Hoyer
Stephan Hoyer added the comment: Posted to python-ideas: https://mail.python.org/pipermail/python-ideas/2017-April/045451.html Mark -- just out of curiosity, could you point me to where this logic is implemented in CPython's source? This feels like something that could once been called a bug

[issue30150] raw debug allocators to not return malloc alignment

2017-04-23 Thread Julian Taylor
New submission from Julian Taylor: The debug raw allocator do not return the same alignment as malloc. See _PyMem_DebugRawAlloc: https://github.com/python/cpython/blob/master/Objects/obmalloc.c#L1873 The line return p + 2*SST adds 2 * sizeof(size_t) to the pointer returned by malloc. On for

[issue30146] Difference in behavior between set() and collections.abc.MutableSet() derived objects

2017-04-23 Thread Ned Deily
Ned Deily added the comment: OK, thanks for supplying a concrete example. From it, it's clear that it has nothing specific to do with Python on macOS. Adding Raymond as maintainer of sets. -- components: -macOS nosy: +rhettinger -ronaldoussoren title: Fix for issue 8743 not

[issue27613] Empty iterator with fake __len__ is rendered as a single bracket ] when using json's iterencode

2017-04-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: Thank you Raymond. What I missed before is a) the OP's misnamed EmptyIterator is an iterable (possibly non-empty) but not an iterator, empty or otherwise, and b) a sequence __len__ that lies is just a bug. (So is a iterator that does not yield the contents

[issue30149] inspect.signature() doesn't support partialmethod without explicit self parameter

2017-04-23 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: >>> import functools, inspect >>> class A: ... f = functools.partialmethod((lambda self, x, y, *args: ...), 1) ... >>> inspect.signature(A.f) >>> class A: ... f = functools.partialmethod((lambda *args: ...), 1) ... >>> inspect.signature(A.f)

[issue30148] Pathological regex behaviour

2017-04-23 Thread Matthew Barnett
Matthew Barnett added the comment: If 'ignores' is '', you get this: (?:\b(?:extern|G_INLINE_FUNC|%s)\s*) which can match an empty string, and it's tried repeatedly. That's inadvisable. There's also: (?:\s+|\*)+ which can match whitespace in multiple ways. That's inadvisable too.

[issue30146] Fix for issue 8743 not available in python MacOS 3.6.1

2017-04-23 Thread Horacio Hoyos
Horacio Hoyos added the comment: Guess my second attempt didn't work as expected ;-). I have attached the file now. To run just invoke the script: $ python3 example.py s did not screen-out general iterables I would expect to see no output. -- Added file:

[issue30147] Change in re.escape output is not documented in whatsnew

2017-04-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- title: change in re.escape output is not docuented in whatsnew -> Change in re.escape output is not documented in whatsnew ___ Python tracker

[issue30148] Pathological regex behaviour

2017-04-23 Thread Jussi Pakkanen
New submission from Jussi Pakkanen: Attached is a script that runs a single regex against one line of text taking over 12 seconds. If you run the exact same regex in Perl it finishes immediately. The slowness has something to do with spaces. If you replace consecutive spaces in the input

[issue30146] Fix for issue 8743 not available in python MacOS 3.6.1

2017-04-23 Thread Ned Deily
Ned Deily added the comment: And rather than focusing on what lines of code you believe are missing, please provide a complete script or lines of Python code with any instructions on how to run them, the actual output you see when you run it, and what you expect the output should be.

[issue30147] change in re.escape output is not docuented in whatsnew

2017-04-23 Thread R. David Murray
R. David Murray added the comment: re.escape was escaping too much previously, and this has been fixed in 3.7 (and only 3.7, because it may cause testing issues such as you have observed). See issue 29995. A note needs to be added to the 'porting' section of whats new covering this.

[issue30146] Fix for issue 8743 not available in python MacOS 3.6.1

2017-04-23 Thread R. David Murray
R. David Murray added the comment: You don't appear to have successfully attached the script. Can you try again please? The patching in the issue you point to does not patch __and__, it just sets it equal to __rand__. -- nosy: +r.david.murray ___

[issue30147] change in interface for compiled regex.pattern

2017-04-23 Thread Greg Lindahl
New submission from Greg Lindahl: The following script runs fine in python 3.6 and recently started failing the assertion in 3.7-dev and nightly import re r = re.compile(re.escape('/foo')) print(r) print(r.pattern) assert r.pattern.startswith('\\/') -- components: Regular Expressions

[issue25794] __setattr__ does not always overload operators

2017-04-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Eryk, could you create a pull request? Please take into account my and Berker's comments on Rietveld. -- ___ Python tracker

[issue30146] Fix for issue 8743 not available in python MacOS 3.6.1

2017-04-23 Thread Horacio Hoyos
New submission from Horacio Hoyos: Hi, attempt 2. My system is MacOs Yosemite (10.10.5), I have installed Python 3.6.1 downloaded from the official Python website. I was having issues while testing a custom Set implementation using the _collections_abc base MutableSet and found that my issue

[issue29619] st_ino (unsigned long long) is casted to long long in posixmodule.c:_pystat_fromstructstat

2017-04-23 Thread Xavier de Gaye
Xavier de Gaye added the comment: sizeof(unsigned long long) is 8 on Android x86 and HAVE_LARGEFILE_SUPPORT is undefined. According to msg280053 HAVE_LARGEFILE_SUPPORT is also undefined on Android x86_64 (and also on Linux x86_64). > Maybe the code should be simplified to always use unsigned

[issue29352] provide the authorative source for s[i:j] negative slice indices (<-len(s)) behavior for standard sequences

2017-04-23 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: docs@python -> rhettinger nosy: +rhettinger ___ Python tracker ___

[issue27613] Empty iterator with fake __len__ is rendered as a single bracket ] when using json's iterencode

2017-04-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This looks as a strong argument to me. Thanks Raymond. -- resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue27613] Empty iterator with fake __len__ is rendered as a single bracket ] when using json's iterencode

2017-04-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: Per PEP-8, the Python preferred-style is, "For sequences, (strings, lists, tuples), use the fact that empty sequences are false." Yes: if not seq: if seq: No: if len(seq): if not len(seq): The Python libraries are not obliged to

[issue30144] Import collections ABC from collections.abc rather than collections

2017-04-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 This patch looks like a step in the right direction. -- ___ Python tracker ___

[issue23404] 'make touch' does not work with git clones of the source repository

2017-04-23 Thread Brett Cannon
Brett Cannon added the comment: Yep, that's exactly what I was suggesting, Martin (and sorry if I missed you saying that earlier; on vacation so trying to keep email/open source time to minimum :) . -- ___ Python tracker

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

2017-04-23 Thread Matthew Cowles
Matthew Cowles added the comment: > Do you have access to IDLE on any system other than Windows? I don't have a Windows machine at all. For what it's worth, here's the behavior I'm talking about, albeit with an old version of Python: $ mkdir testidle $ cd testidle $ /usr/local/bin/python

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

2017-04-23 Thread Mariatta Wijaya
New submission from Mariatta Wijaya: We could use a How To or a tutorial for asyncio in the docs. -- assignee: docs@python components: Documentation, asyncio messages: 292168 nosy: Mariatta, docs@python, yselivanov priority: normal severity: normal status: open title: Create a How to or

[issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']`

2017-04-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 1264 implements this idea. Seems this is a duplicate of issue23203 which contains the same idea. -- stage: needs patch -> patch review ___ Python tracker

[issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']`

2017-04-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +1377 ___ Python tracker ___ ___

[issue30142] The "callable" fixer doesn't exist

2017-04-23 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- assignee: docs@python -> Mariatta keywords: +easy nosy: +Mariatta stage: -> needs patch ___ Python tracker

[issue30144] Import collections ABC from collections.abc rather than collections

2017-04-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If this is the main cause I can replace collections.abc in this patch with _collections_abc. But I prefer to do this in separate commit. My next patch will include other changes for the number of imports. -- ___

[issue30140] Binary arithmetic does not always call subclasses first

2017-04-23 Thread Eric Wieser
Changes by Eric Wieser : -- nosy: +Eric.Wieser ___ Python tracker ___ ___

[issue30144] Import collections ABC from collections.abc rather than collections

2017-04-23 Thread Stefan Krah
Stefan Krah added the comment: I thought splitting off abc was done for performance reasons (reduce the number of imports at Python startup), not for more idiomatic code. -- nosy: +skrah ___ Python tracker

[issue30144] Import collections ABC from collections.abc rather than collections

2017-04-23 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Now abstract collection classes are defined in collections.abc rather than collections. collections contains just aliases for compatibility. Importing collections ABC from collections.abc is more idiomatic. And when aliases will be removed from collection

[issue30144] Import collections ABC from collections.abc rather than collections

2017-04-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +1376 ___ Python tracker ___ ___

[issue30141] If you forget to call do_handshake, then everything seems to work but hostname checking is disabled

2017-04-23 Thread Nathaniel Smith
Changes by Nathaniel Smith : -- title: If you forget to call do_handshake, then everything seems to work but hostname is disabled -> If you forget to call do_handshake, then everything seems to work but hostname checking is disabled

[issue30143] Using collections ABC from collections.abc rather than collections in 2to3 converted code

2017-04-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +1375 ___ Python tracker ___ ___

[issue30143] Using collections ABC from collections.abc rather than collections in 2to3 converted code

2017-04-23 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch makes 2to3 generating a code that uses abstract collection classes Sequence and Mapping from collections.abc rather than collections. Since abstract collection classes now are defined in collections.abc and collections contains only aliases

[issue30142] The "callable" fixer doesn't exist

2017-04-23 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: The "callable" fixer was removed in dbdf029a5575f6e6ec0140260236963ed7d2c2be, but it still is mentioned in the documentation. https://docs.python.org/3/library/2to3.html#2to3fixer-callable -- assignee: docs@python components: 2to3 (2.x to 3.x

[issue30141] If you forget to call do_handshake, then everything seems to work but hostname is disabled

2017-04-23 Thread Christian Heimes
Christian Heimes added the comment: Sigh, this is the seventh or eight security issue related to Python's hostname verification, maybe more. I know for years that Python's current approach is buggy and a collection of bad ideas. That's it, I'm going to rip out ssl.match_hostname() and let

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

2017-04-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: >From the viewpoint of IDLE and masking, the stdlib has three parts: idlelib, >other modules that IDLE imports, and other modules that IDLE does not import. >As I already noted, this division is different for IDLE and user processes. IDLE may delay importing

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

2017-04-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: I will make this one of my priority issues once I get up to speed with the new workflow. However, it is not a trivial issue, and I am not sure that all my beliefs of a year ago were correct. What I really do not want to do is break IDLE running when users

[issue30141] If you forget to call do_handshake, then everything seems to work but hostname is disabled

2017-04-23 Thread Nathaniel Smith
New submission from Nathaniel Smith: Basically what it says in the title... if you create an SSL object via wrap_socket with do_handshake_on_connect=False, or via wrap_bio, and then forget to call do_handshake and just go straight to sending and receiving data, then the encrypted connection

[issue30140] Binary arithmetic does not always call subclasses first

2017-04-23 Thread Mark Dickinson
Mark Dickinson added the comment: This is probably worth bringing up on the python-dev or python-ideas mailing lists for greater visibility. I can't think of any plausible non-historical reason why it makes sense for comparisons to behave one way and arithmetic operators another. Altering

[issue30140] Binary arithmetic does not always call subclasses first

2017-04-23 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___

[issue29840] Avoid raising OverflowError in bool()

2017-04-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This was documented in issue15718. -- resolution: -> wont fix stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue15718] Possible OverflowError in __len__ method undocumented (when called via len() function)

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

[issue30095] HTMLCalendar allow custom classes

2017-04-23 Thread Oz Tiram
Oz Tiram added the comment: @Walter, I implemented two possible solutions. Chronologically speaking V2 was implemented before V1, but it's a bit über-smart and might surprise it's users requiring the class attributes to be some kind of iterable. The first version is my current preferred