[issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers

2018-04-05 Thread iunknwn
iunknwn added the comment: I've submitted a PR that should resolve this - it uses a simple atomic counter to ensure new threads are not created if existing threads are idle. One concern I do have - while writing the patch, I noticed the existing submit method (specifically

[issue27805] io.open('/dev/stdout', 'a') raises OSError with errno=ESPIPE

2018-04-05 Thread Skip Montanaro
Skip Montanaro added the comment: I was bitten by this porting a system from Python 2.7 to 3.6. "/dev/stderr" is a very nice default for logfiles. Users will frequently override the default, so you really want to open the logfile in append mode. Having to jump

[issue33232] Segmentation fault in operator.attrgetter

2018-04-05 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> larry ___ Python tracker ___ ___

[issue33217] x in enum.Flag member is True when x is not a Flag

2018-04-05 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +6100 stage: -> patch review ___ Python tracker ___

[issue33232] Segmentation fault in operator.attrgetter

2018-04-05 Thread Ray Donnelly
Change by Ray Donnelly : -- nosy: +Ray Donnelly ___ Python tracker ___ ___

[issue33234] Improve list() pre-sizing for inputs with known lengths

2018-04-05 Thread Raymond Hettinger
New submission from Raymond Hettinger : The list() constructor isn't taking full advantage of known input lengths or length hints. Ideally, it should pre-size and not over-allocate when the input size is known or can be reasonably estimated. Python 3.8.0a0

[issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers

2018-04-05 Thread iunknwn
Change by iunknwn : -- nosy: +iunknwn ___ Python tracker ___ ___ Python-bugs-list mailing

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-04-05 Thread Ethan Smith
Ethan Smith added the comment: I have a branch with an implementation of my suggestion here: https://github.com/ethanhs/cpython/tree/decorlineno I was hoping to see if this was seen as a reasonable patch that might be accepted. Also, while I think it would be nice, I take

[issue18875] Idle: Auto insertion of the closing parens, brackets, and braces

2018-04-05 Thread Terry J. Reedy
Terry J. Reedy added the comment: My question about the idea is whether beginners would use this, or if it is the sort of 'expert' feature that IDLE should avoid. I may ask on python-list for more opinions.

[issue33222] Various test failures if PYTHONUSERBASE is not canonicalized

2018-04-05 Thread Nitish
Change by Nitish : -- nosy: +nitishch ___ Python tracker ___ ___ Python-bugs-list

[issue15817] Misc/gdbinit: Expose command documentation to gdb help

2018-04-05 Thread Skip Montanaro
Skip Montanaro added the comment: This looks good to me. I added a pull request with a couple minor tweaks. Unfortunately, I can't tell how to add a "skip news" label. This doesn't seem "big" enough to warrant it. -- nosy: +skip.montanaro

[issue15257] Misc/.gdbinit:pystack is too brittle

2018-04-05 Thread Skip Montanaro
Skip Montanaro added the comment: I would prefer if these macros remain standalone (and thus fragile). Despite Python support in gdb, not everyone (more than five years after the bug report) don't use a gdb which was built --with-python. There is better support for

[issue15817] Misc/gdbinit: Expose command documentation to gdb help

2018-04-05 Thread Skip Montanaro
Change by Skip Montanaro : -- pull_requests: +6094 stage: -> patch review ___ Python tracker ___

[issue33205] GROWTH_RATE prevents dict shrinking

2018-04-05 Thread INADA Naoki
INADA Naoki added the comment: @Mark.Shannon, @rhettinger How do you think this? -- ___ Python tracker ___

[issue15817] Misc/gdbinit: Expose command documentation to gdb help

2018-04-05 Thread Skip Montanaro
Change by Skip Montanaro : -- versions: +Python 3.7 -Python 3.4 ___ Python tracker ___

[issue33228] Use Random.choices in tempfile

2018-04-05 Thread Wolfgang Maier
Wolfgang Maier added the comment: Actually, in Python2.7 random.choice is implemented with the same susceptibility to the rounding bug as Python3's choices, still nobody ever reported a tempfile IndexError problem (I guess). --

[issue33229] Documentation - io — Core tools for working with streams - seek()

2018-04-05 Thread Mikhail Zakharov
New submission from Mikhail Zakharov : Documentation for io.IOBase class and it's seek() method at https://docs.python.org/3/library/io.html mentions SEEK_* constants like: "SEEK_SET or 0 – start of the stream (the default); offset should be zero or positive

[issue33195] PyArg_Parse* should deprecate 'u' and 'z' family.

2018-04-05 Thread INADA Naoki
INADA Naoki added the comment: New changeset 29bc6f6347b1e05b22180fd296013bb2a104d589 by INADA Naoki in branch '3.6': bpo-33195: Doc: Deprecate Py_UNICODE in c-api/arg (GH-6329) https://github.com/python/cpython/commit/29bc6f6347b1e05b22180fd296013bb2a104d589

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-04-05 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker ___ ___

[issue33230] _decimal build failure (unsupported platform for that module) - evolution possible?

2018-04-05 Thread Stefan Krah
Stefan Krah added the comment: I don't have OS X. However, this is the first time in 6 years that anyone has reported an OS X build failure. Perhaps Ned knows the answer. -- nosy: +ned.deily, skrah ___ Python tracker

[issue33228] Use Random.choices in tempfile

2018-04-05 Thread INADA Naoki
INADA Naoki added the comment: @wolma Would you split your PR? One for fix docstring and one for using Random.choices. Since former is document bug, I want to backport it. (while _RandomNameSequence is private) -- nosy: +inada.naoki

[issue33228] Use Random.choices in tempfile

2018-04-05 Thread Wolfgang Maier
Wolfgang Maier added the comment: sorry, should have been issue 24567, of course. -- ___ Python tracker ___

[issue33228] Use Random.choices in tempfile

2018-04-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue24567. It affects Random.choices(), but not Random.choice() because the latter uses getrandbits(). -- nosy: +serhiy.storchaka ___ Python tracker

[issue33230] _decimal build failure (unsupported platform for that module) - evolution possible?

2018-04-05 Thread Hubert Holin
New submission from Hubert Holin : _decimal fails to build on my platform due to lack of support: In file included from /Developer/Python/3.6/Python/Python-3.6.5/Modules/_decimal/_decimal.c:34: /usr/local/include/mpdecimal.h:201:4: error: "unsupported platform: need

[issue33228] Use Random.choices in tempfile

2018-04-05 Thread Wolfgang Maier
Wolfgang Maier added the comment: @serhiy as I understand issue 33228, the double rounding problem potentially causing an IndexError can only affect choices() if the len of the sequence to choose from is greater than 2049, but the string in question

[issue33227] Cmd do_something only accepts one argument

2018-04-05 Thread Oz Tiram
New submission from Oz Tiram : Considering that I want to build an CLI interactive program using cmd.Cmd, which has multiple functions that accept two or more arguments, I always have to do parsing of arg inside my do_methods for example: class Calc(cmd.Cmd):

[issue33211] lineno and col_offset are wrong on function definitions with decorators

2018-04-05 Thread Nitish
Change by Nitish : -- nosy: +nitishch ___ Python tracker ___ ___ Python-bugs-list

[issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff

2018-04-05 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch pull_requests: +6091 stage: -> patch review ___ Python tracker ___

[issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff

2018-04-05 Thread Raymond Hettinger
Change by Raymond Hettinger : -- versions: +Python 3.6, Python 3.8 ___ Python tracker ___

[issue33195] PyArg_Parse* should deprecate 'u' and 'z' family.

2018-04-05 Thread INADA Naoki
Change by INADA Naoki : -- pull_requests: +6092 ___ Python tracker ___ ___

[issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff

2018-04-05 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___

[issue33227] Cmd do_something only accepts one argument

2018-04-05 Thread Oz Tiram
Change by Oz Tiram : -- components: +Library (Lib) type: -> enhancement ___ Python tracker ___

[issue33228] Use Random.choices in tempfile

2018-04-05 Thread Wolfgang Maier
New submission from Wolfgang Maier : A rather trivial change: tempfile._RandomNameSequence could make use of random.Random.choices introduced in 3.6. IMO, the suggested change would give clearer and also faster code. It also updates the docstring of the

[issue33228] Use Random.choices in tempfile

2018-04-05 Thread Wolfgang Maier
Change by Wolfgang Maier : -- keywords: +patch pull_requests: +6093 stage: -> patch review ___ Python tracker

[issue33231] Potential memory leak in normalizestring()

2018-04-05 Thread Josh Rosenberg
New submission from Josh Rosenberg : Patch is good, but while we're at it, is there any reason why this multi-allocation design was even used? It PyMem_Mallocs a buffer, makes a C-style string in it, then uses PyUnicode_FromString to convert C-style string to

[issue33231] Potential memory leak in normalizestring()

2018-04-05 Thread INADA Naoki
Change by INADA Naoki : -- components: Interpreter Core nosy: inada.naoki priority: normal severity: normal status: open title: Potential memory leak in normalizestring() type: resource usage versions: Python 3.6, Python 3.7, Python 3.8

[issue33229] Documentation - io — Core tools for working with streams - seek()

2018-04-05 Thread Josh Rosenberg
Josh Rosenberg added the comment: As indicated in the seek docs ( https://docs.python.org/3/library/io.html#io.IOBase.seek ), all three names were added to the io module in 3.1: > New in version 3.1: The SEEK_* constants. Since they're part of the io module

[issue6721] Locks in the standard library should be sanitized on fork

2018-04-05 Thread Olivier Chédru
Olivier Chédru added the comment: FWIW, I encountered the same kind of issue when using the mkstemp() function: under the hood, it calls gettempdir() and this one is protected by a lock too. Current thread 0x7ff10231f700 (most recent call first): File

[issue33229] Documentation - io — Core tools for working with streams - seek()

2018-04-05 Thread Mikhail Zakharov
Mikhail Zakharov added the comment: Seems in my, quite old 3.4.5 version, it doesn't work: $ python3 Python 3.4.5 (default, Jun 1 2017, 13:52:39) [GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> f

[issue33231] Potential memory leak in normalizestring()

2018-04-05 Thread INADA Naoki
Change by INADA Naoki : -- keywords: +patch pull_requests: +6095 stage: -> patch review ___ Python tracker ___

[issue33229] Documentation - io — Core tools for working with streams - seek()

2018-04-05 Thread Mikhail Zakharov
Mikhail Zakharov added the comment: OK, I got it. Sorry for disturbing you. The should be called like: io.SEEK_* -- ___ Python tracker

[issue33232] Segmentation fault in operator.attrgetter

2018-04-05 Thread Zachary Ware
Zachary Ware added the comment: Python 3.5 is in security-fix-only mode now, which means we won't be releasing any more binaries for it, and thus can't really do much about this other than possibly recommending that Windows users build with VS2017 instead of VS2015 in

[issue33232] Segmentation fault in operator.attrgetter

2018-04-05 Thread Alexander Sturm
Change by Alexander Sturm : Added file: https://bugs.python.org/file47522/annotated_dissasembly.txt ___ Python tracker ___

[issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally

2018-04-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 091e95e9004b794280ab35becec2c3e30dd5e96e by Raymond Hettinger (Wolfgang Maier) in branch 'master': bpo-33203: Ensure random.choice always raises IndexError on empty sequence (GH-6338)

[issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally

2018-04-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +6096 ___ Python tracker ___

[issue33232] Segmentation fault in operator.attrgetter

2018-04-05 Thread Alexander Sturm
New submission from Alexander Sturm : This issue can be reproduced using Python 3.5.2 - 3.5.5 compiled with VS2015 (tested both the official Python builds as well as local builds using VS2015 Version 14.0.25431.01 Update 3) on 64-bit Windows. To reproduce, run the attached

[issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally

2018-04-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +6097 ___ Python tracker ___

[issue33232] Segmentation fault in operator.attrgetter

2018-04-05 Thread Alexander Sturm
Alexander Sturm added the comment: As mentioned, the code is compiled correctly by VS2017 - both in 3.5.5 and 3.6.5. So I cannot reproduce the issue with Python 3.6.5. Would it be possible to switch the default platform toolset used to compile Python 3.5 in the next source

[issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally

2018-04-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset baf304e82e1b54dbeee6b78ddf168e33ed8d557a by Raymond Hettinger (Miss Islington (bot)) in branch '3.7': bpo-33203: Ensure random.choice always raises IndexError on empty sequence (GH-6338) (GH-6387)

[issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally

2018-04-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset e25af930a300c01aa043745058a8c7f6c32d89ae by Raymond Hettinger (Miss Islington (bot)) in branch '3.6': bpo-33203: Ensure random.choice always raises IndexError on empty sequence (GH-6338) (GH-6388)

[issue15817] Misc/gdbinit: Expose command documentation to gdb help

2018-04-05 Thread Ned Deily
Ned Deily added the comment: Thanks everyone! -- assignee: dmalcolm -> resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 -Python 3.7 ___ Python tracker

[issue33228] Use Random.choices in tempfile

2018-04-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: -0 on making anything other than the doc change. For the most part, we avoid sweeping through the standard library to substitute-in new features and instead have a preference for code stability rather than code churn. FWIW,

[issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally

2018-04-05 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue33219] x in IntFlag should test raise TypeError if x is not an IntFlag

2018-04-05 Thread Ethan Furman
Ethan Furman added the comment: issue33217 is tracking member-containment checks; modifying this one to track class-containment checks. Given class Color(Enum): RED = 1 class Fruit(Enum): APPLE = 1 then --> Fruit.APPLE in Color False --> Fruit.APPLE

[issue32823] Regression in test -j behavior and time in 3.7.0b1

2018-04-05 Thread Zachary Ware
Zachary Ware added the comment: I can't reproduce this. Even running `python -m test -j14` on a machine with 2 vCPUs, I get my first results at 2s, and even test___all__ passes in only 6 (though on my first run, with -j0 (== -j4), test___all__ took 41s but other

[issue15817] Misc/gdbinit: Expose command documentation to gdb help

2018-04-05 Thread Ned Deily
Ned Deily added the comment: New changeset 7286dbd8b20bd0a26fabe1a07ff368082a9c5ed6 by Ned Deily (Skip Montanaro) in branch 'master': bpo-15817: Expose command documentation to gdb help (GH-6384)

[issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff

2018-04-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 01b731fc2b04744a11e32f93aba8bfb9ddb3dd29 by Raymond Hettinger in branch 'master': bpo-33224: PEP 479 fix for difflib.mdiff() (GH-6381)

[issue33230] _decimal build failure (unsupported platform for that module) - evolution possible?

2018-04-05 Thread Ned Deily
Ned Deily added the comment: > However, this is the first time in 6 years that anyone has reported an OS X > build failure. Yes, I've never seen one before, either. But I think the culprit is pointed to in the error message. It looks like you have another version of

[issue33233] Suggest third-party cmd2 module as alternative to cmd

2018-04-05 Thread Ned Deily
New submission from Ned Deily : The cmd module in the standard library has languished for many years. In the mean time, third-party replacements for it have arisen. Perhaps the most popular is cmd2 which seems to be actively maintained, provides upward compatibility from

[issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff

2018-04-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +6099 ___ Python tracker ___

[issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff

2018-04-05 Thread miss-islington
Change by miss-islington : -- pull_requests: +6098 ___ Python tracker ___

[issue33227] Cmd do_something only accepts one argument

2018-04-05 Thread Ned Deily
Ned Deily added the comment: Thanks for your suggested enhancement to the cmd module. cmd has been around a *long* time and, unfortunately, has received very little maintenance or enhancement attention for many years. In the meantime, third-party replacements for cmd have

[issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff

2018-04-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 28c179094bcb7829d184fb3cfb3ef626505b9f77 by Raymond Hettinger (Miss Islington (bot)) in branch '3.7': bpo-33224: PEP 479 fix for difflib.mdiff() (GH-6381) (GH-6390)

[issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff

2018-04-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 8da15f09458fd4f4fe341861e41723892b25a11b by Raymond Hettinger (Miss Islington (bot)) in branch '3.6': bpo-33224: PEP 479 fix for difflib.mdiff() (GH-6381) (GH-6391)

[issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff

2018-04-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for timely report. I appreciate you exercising the beta release to shake out bugs. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python