[issue32872] backport of #32305 causes regressions in various packages

2018-03-27 Thread miss-islington
Change by miss-islington : -- pull_requests: +6005 ___ Python tracker ___

[issue32872] backport of #32305 causes regressions in various packages

2018-03-27 Thread Ned Deily
Ned Deily added the comment: New changeset e52ac045972a4f75d7f52e4ee0d6de128259134d by Ned Deily in branch 'master': bpo-32872: Avoid regrtest compatibility issue with namespace packages. (GH-6276)

[issue32872] backport of #32305 causes regressions in various packages

2018-03-27 Thread miss-islington
Change by miss-islington : -- pull_requests: +6004 ___ Python tracker ___

[issue33142] Fatal Python error: Py_Initialize: Unable to get the locale encoding on Debian/Python 3.6.4 source build

2018-03-27 Thread Ned Deily
Ned Deily added the comment: Since python3.6 is regularly built with various Debian releases, this seems unlikely to be a problem in Python itself. Suggest you verify that no venv or virtualenv is in use or that PYTHON* environment variables are set or that no modifications

[issue32872] backport of #32305 causes regressions in various packages

2018-03-27 Thread Ned Deily
Change by Ned Deily : -- pull_requests: +6003 ___ Python tracker ___ ___ Python-bugs-list

[issue33161] Refactor of pathlib's _WindowsBehavior.gethomedir

2018-03-27 Thread Ekin Dursun
Change by Ekin Dursun : -- keywords: +patch pull_requests: +6002 stage: -> patch review ___ Python tracker ___

[issue33161] Refactor of pathlib's _WindowsBehavior.gethomedir

2018-03-27 Thread Ekin Dursun
New submission from Ekin Dursun : At line 245, default value for drv is provided with KeyError handling, but it is better to use dict's get method. -- components: Library (Lib), Windows messages: 314562 nosy: onlined, paul.moore, steve.dower, tim.golden, zach.ware

[issue24132] Direct sub-classing of pathlib.Path

2018-03-27 Thread qb-cea
qb-cea added the comment: Hi all, I made a pull request proposing a fix for this issue. There is still quite a lot to be done: - I exposed some variables (and probably methods too) that used to be hidden; - I did not update the documentation; - I did not add a proper

[issue33153] interpreter crash when multiplying large tuples

2018-03-27 Thread Ivan Zakharyaschev
Ivan Zakharyaschev added the comment: It was run in i586 chroot on x86_64. -- ___ Python tracker ___

[issue33153] interpreter crash when multiplying large tuples

2018-03-27 Thread Ivan Zakharyaschev
Ivan Zakharyaschev added the comment: The traceback: [builder@localhost ~]$ python -c 'x = ("a", "b") * 2**20; x *= 2**20' Segmentation fault (core dumped) [builder@localhost ~]$ gdb python core.23284 GNU gdb (GDB) 7.9-alt4 (ALT) Copyright (C) 2015 Free Software Foundation,

[issue33128] PathFinder is twice on sys.meta_path

2018-03-27 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +6001 stage: needs patch -> patch review ___ Python tracker

[issue32850] Run gc_collect() before complaining about dangling threads

2018-03-27 Thread Nathaniel Smith
Nathaniel Smith added the comment: @Victor: So to make sure I understand, the point of the check is to complain about reference cycles involving thread objects, because when those happen in the stdlib you consider them bugs? -- ___

[issue33128] PathFinder is twice on sys.meta_path

2018-03-27 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: The same problem happens in `new_interpreter` as far as I understand. -- ___ Python tracker

[issue33128] PathFinder is twice on sys.meta_path

2018-03-27 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: It seems that the problem is that `_Py_InitializeEx_Private` calls `_Py_InitializeCore` and `_Py_InitializeMainInterpreter`. The first one calls at the end `initimport` that in turns calls `importlib._install_external_importers`

[issue32850] Run gc_collect() before complaining about dangling threads

2018-03-27 Thread Matthias Urlichs
Matthias Urlichs added the comment: > It's a deliberate choice. It helped me to find real bugs. For example, I > found a very old reference cycle in socket.create_connection(). Fair enough; I will change the patch to complain before gc'ing. --

[issue32850] Run gc_collect() before complaining about dangling threads

2018-03-27 Thread STINNER Victor
STINNER Victor added the comment: > This is not useful, esp. when the list of referrers to the "dangling" thread > looks like this: (...) I wrote the test.bisect tool to help to debug dangling threads issues. Sadly, sometimes the warning can occur randomly because

[issue32850] Run gc_collect() before complaining about dangling threads

2018-03-27 Thread STINNER Victor
STINNER Victor added the comment: > Lib/test/support/__init__.py::threading_cleanup() complains about dangling > threads even if the reference in question would be cleaned up by the garbage > collector. It's a deliberate choice. It helped me to find real bugs. For

[issue32850] Run gc_collect() before complaining about dangling threads

2018-03-27 Thread Nathaniel Smith
Nathaniel Smith added the comment: Yes, a PR would be better... also, the two versions of the patch appear to be identical? CC'ing Antoine and Victor b/c they seem to have written this dangling_threads checking stuff and I'm not sure I understand it :-). As some extra

[issue33160] Negative values in positional access inside formatting

2018-03-27 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Should str.format allow negative indexes when used for __getitem__ access? ___ Python tracker

[issue32517] test_read_pty_output() of test_asyncio hangs on macOS 10.13.2 (darwin 17.3.0)

2018-03-27 Thread Ned Deily
Change by Ned Deily : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue32517] test_read_pty_output() of test_asyncio hangs on macOS 10.13.2 (darwin 17.3.0)

2018-03-27 Thread Ned Deily
Ned Deily added the comment: New changeset 6a2539c43412567a4c693da8e7fdf5e73191fd16 by Ned Deily in branch '3.7': bpo-32517: re-enable test_read_pty_output on macOS (GH-6112) https://github.com/python/cpython/commit/6a2539c43412567a4c693da8e7fdf5e73191fd16 --

[issue32517] test_read_pty_output() of test_asyncio hangs on macOS 10.13.2 (darwin 17.3.0)

2018-03-27 Thread Ned Deily
Ned Deily added the comment: New changeset 8534d5e4e918be82b041754ecd89af519e5b by Ned Deily in branch 'master': bpo-32517: fix test_read_pty_output() hangs on macOS 10.13.2+ (GH-6037) (GH-6113)

[issue33160] Negative values in positional access inside formatting

2018-03-27 Thread Ned Deily
Change by Ned Deily : -- nosy: +eric.smith type: -> enhancement versions: +Python 3.8 -Python 3.6 ___ Python tracker ___

[issue33160] Negative values in positional access inside formatting

2018-03-27 Thread Facundo Batista
New submission from Facundo Batista : This works fine: >>> "{[0]}".format([1, 2, 3]) '1' This should work too: >>> "{[-1]}".format([1, 2, 3]) Traceback (most recent call last): File "", line 1, in TypeError: list indices must be integers or slices, not str

[issue32850] Run gc_collect() before complaining about dangling threads

2018-03-27 Thread Christian Heimes
Christian Heimes added the comment: We generally prefer pull requests on github over patches on the bug tracker. Please follow the guidelines for contributing to CPython, https://devguide.python.org/pullrequest/ -- nosy: +christian.heimes

[issue32850] Run gc_collect() before complaining about dangling threads

2018-03-27 Thread Matthias Urlichs
Matthias Urlichs added the comment: Apparently this patch has not been applied yet. Is there a reason for that, besides "it's obviously correct so there must be something wrong with it"? ;-) -- ___ Python tracker

[issue33159] Implement PEP 473

2018-03-27 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +6000 stage: -> patch review ___ Python tracker ___

[issue33159] Implement PEP 473

2018-03-27 Thread skreft
New submission from skreft : Implement PEP 473. -- messages: 314546 nosy: skreft priority: normal severity: normal status: open title: Implement PEP 473 versions: Python 3.8 ___ Python tracker

[issue33155] Use super().method instead in Logging

2018-03-27 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> vinay.sajip ___ Python tracker ___

[issue25257] In subject line email library inserts unwanted space after a thousands comma in a number

2018-03-27 Thread Bob Hossley
Bob Hossley added the comment: Mike, Thank you. I moved to Python 3 some time ago. I confirm that Python 3 does not have the problem. But I can't conveniently verify your workaround for Python 2. Regards, Bob bhoss...@ieee.org On 2018-03-27 11:30 AM, Mike Edmunds wrote:

[issue25257] In subject line email library inserts unwanted space after a thousands comma in a number

2018-03-27 Thread Mike Edmunds
Mike Edmunds added the comment: Here's a workaround for Python 2.7: ``` class HeaderBugWorkaround(email.header.Header): def encode(self, splitchars=' ', **kwargs): # only split on spaces, rather than splitchars=';, ' return email.header.Header.encode(self,

[issue13829] exception error in _scproxy.so when called after fork

2018-03-27 Thread triccare triccare
triccare triccare added the comment: I have run into this bug which can be reliably reproduced by importing tkinter. However, I have found another workaround if one does not want to deal with the environmental variable and may point to a possible bug fix. Before forking,

[issue33151] importlib.resources breaks on subdirectories

2018-03-27 Thread Barry A. Warsaw
Change by Barry A. Warsaw : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue33151] importlib.resources breaks on subdirectories

2018-03-27 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: New changeset fd1b8f87b3e63495cadd37c8f1b90191b46ee52a by Barry Warsaw (Miss Islington (bot)) in branch '3.7': bpo-33151: Handle submodule resources (GH-6268) (GH-6270)

[issue33158] Add fileobj property to csv reader and writer objects

2018-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > A fileobj property would be convenient, as you otherwise, for example, need > to pass an extra argument to routines that need both the csv object and the > underlying file object. But you should already have this object for

[issue33155] Use super().method instead in Logging

2018-03-27 Thread Mads Jensen
Change by Mads Jensen : -- keywords: +patch pull_requests: +5999 stage: -> patch review ___ Python tracker ___

[issue33151] importlib.resources breaks on subdirectories

2018-03-27 Thread miss-islington
Change by miss-islington : -- pull_requests: +5998 ___ Python tracker ___

[issue33151] importlib.resources breaks on subdirectories

2018-03-27 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: New changeset 30e507dff465a31901d87df791a2bac40dc88530 by Barry Warsaw in branch 'master': bpo-33151: Handle submodule resources (GH-6268) https://github.com/python/cpython/commit/30e507dff465a31901d87df791a2bac40dc88530 --

[issue32742] zipfile extractall needlessly re-wraps ZipInfo instances

2018-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is an obscure behavior change introduced by this PR. Technically a ZIP file can contain several entries with the same name. Currently extractall() will extract the last of them multiple times. The result doesn't differ

[issue33158] Add fileobj property to csv reader and writer objects

2018-03-27 Thread Samwyse
New submission from Samwyse : Many objects have properties that allow access to the arguments used to create them. In particular, file objects have a name property that returns the name used when opening a file. A fileobj property would be convenient, as you otherwise,

[issue33144] random._randbelow optimization

2018-03-27 Thread Wolfgang Maier
Wolfgang Maier added the comment: Thanks, Raymond. I'll do that once I've addressed Serhiy's points. -- ___ Python tracker

[issue33144] random._randbelow optimization

2018-03-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: Wolfgang, can you submit this as a PR. -- ___ Python tracker ___

[issue31550] Inconsistent error message for TypeError with subscripting

2018-03-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: Marked as closed for the reasons listed. Thank you for the suggestion, but we're going to decline. -- resolution: -> rejected stage: patch review -> resolved status: open -> closed

[issue33144] random._randbelow optimization

2018-03-27 Thread Wolfgang Maier
Wolfgang Maier added the comment: Serhiy: > I like the idea in general, but have comments about the implementation. > > __init_subclass__ should take **kwargs and pass it to > super().__init_subclass__(). type(cls.random) is not the same as >

[issue33157] Strings beginning with underscore not removed from lists - feature or bug?

2018-03-27 Thread Steven D'Aprano
Steven D'Aprano added the comment: In addition to Xiang Zhang's comments, this is neither a feature nor a bug, but a misunderstanding. This has nothing to do with strings or underscores: py> L = [1, 2, 3, 4, 5] py> for item in L: ... L.remove(item) ... py> L

[issue33157] Strings beginning with underscore not removed from lists - feature or bug?

2018-03-27 Thread Xiang Zhang
Xiang Zhang added the comment: You may refer to stackoverflow for an explanation, for example, https://stackoverflow.com/questions/6260089/strange-result-when-removing-item-from-a-list -- ___ Python tracker

[issue33157] Strings beginning with underscore not removed from lists - feature or bug?

2018-03-27 Thread Xiang Zhang
Xiang Zhang added the comment: It's just the right behavior. You are modifying the list while iterating over it. It has no business of underscore. >>> test = ['_a', 'a', '_b', 'b'] >>> for i in test: test.remove(i) >>> test ['a', 'b'] -- nosy: +xiang.zhang

[issue33157] Strings beginning with underscore not removed from lists - feature or bug?

2018-03-27 Thread yemiteliyadu
New submission from yemiteliyadu : Strings beginning with underscore not removed from lists Reproducible as shown below: Python 3.6.4 |Anaconda custom (64-bit)| (default, Jan 16 2018, 12:04:33) [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin

[issue33152] Use list comprehension in timeit module instead of loop with append

2018-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: We usually do not do such kind of changes due to the risk of introducing new bugs (as your PR demonstrated). Only when other changes are applied to the module, the surrounded code can be cleaned up. Or the maintainer of the

[issue33152] Use list comprehension in timeit module instead of loop with append

2018-03-27 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- title: clean code -> Use list comprehension in timeit module instead of loop with append ___ Python tracker

[issue33111] Merely importing tkinter breaks parallel code (multiprocessing, sharedmem)

2018-03-27 Thread Ethan Welty
Ethan Welty added the comment: @ronaldoussoren: The order of the imports made no difference. Even with the call at the top, I got endless errors with both 'spawn' and 'forkserver', with or without importing a graphics backend. Only 'fork' works, and only if a graphics

[issue33149] Parser stack overflows

2018-03-27 Thread Ned Deily
Change by Ned Deily : -- stage: -> resolved status: open -> closed ___ Python tracker ___

[issue32861] urllib.robotparser: incomplete __str__ methods

2018-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The default entry was moved out of entries added in issue523041, but RobotFileParser.__str__ was not updated. Support for "Crawl-delay" and "Request-Rate" was added in issue16099, but Entry.__str__ was not updated. This looks

[issue33156] Use super().method instead in email classes.

2018-03-27 Thread R. David Murray
R. David Murray added the comment: Thank you for wanting to improve Python, but unless this is actually causing a problem for someone, there is a greater chance of introducing a bug by making such changes than the benefit of the "cleanup". So we generally don't accept

[issue33014] Clarify str.isidentifier docstring; fix keyword.iskeyword docstring

2018-03-27 Thread R. David Murray
R. David Murray added the comment: I think my wording would be an improvement to the docs as well. You could link just the keyword function if you are worried about too many links, since that would keep the link count the same. --

[issue33146] contextlib.suppress should capture exception for inspection and filter on substrings

2018-03-27 Thread Nick Coghlan
Nick Coghlan added the comment: I wouldn't expand the scope of contextlib.suppress, since it has a pretty clear purpose: pretend the exception never happened. (This was even clearer with the original "ignored" name, before I was talked into changing it to use the current

[issue32569] Blake2 module, memory clearance update

2018-03-27 Thread David CARLIER
David CARLIER added the comment: Little update it has been accepted and merged today : https://github.com/BLAKE2/libb2/commit/620681a3b15c4d7239b9323b9da5ea208a959d3d -- nosy: +David CARLIER2 ___ Python tracker

[issue33153] interpreter crash when multiplying large tuples

2018-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: tuplerepeat() in Objects/tupleobject.c uses a questionable check that relies on signed integer overflow. It is a matter of time when this rifle will shoot in the foot. But I didn't expected issues with old good gcc 6.3. Was the

[issue33156] Use super().method instead in email classes.

2018-03-27 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- type: -> enhancement ___ Python tracker ___

[issue33155] Use super().method instead in Logging

2018-03-27 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +vinay.sajip type: -> enhancement versions: +Python 3.8 ___ Python tracker ___

[issue31853] Use super().method instead of socket.method in SSLSocket

2018-03-27 Thread Christian Heimes
Christian Heimes added the comment: I agree Also this ticket was closed a couple of months ago and is about the SSL module. Your PR is about a different module. Although I think that recycling is generally a good idea, it doesn't apply to ticket numbers. --

[issue31853] Use super().method instead of socket.method in SSLSocket

2018-03-27 Thread Nathaniel Smith
Nathaniel Smith added the comment: The only time this should matter semantically is if someone is trying to subclass SSLSocket and use multiple inheritance. This is something that people *really* shouldn't do. It also potentially makes it harder to backport ssl changes to

[issue33156] Use super().method instead in email classes.

2018-03-27 Thread Mads Jensen
New submission from Mads Jensen : There are lots of legacy calls in the form of ClassName.method, which should be replaced with super().method. -- components: email messages: 314519 nosy: barry, madsjensen, r.david.murray priority: normal pull_requests: 5997 severity:

[issue31853] Use super().method instead of socket.method in SSLSocket

2018-03-27 Thread INADA Naoki
INADA Naoki added the comment: Why *should*? Legacy ParentClass.method() call is faster than super().method() call, because there are no temporary proxy object. I don't think there are enough reason to replace all legacy parent calls. -- nosy: +inada.naoki

[issue33155] Use super().method instead in Logging

2018-03-27 Thread Mads Jensen
New submission from Mads Jensen : There are lots of legacy calls in the form of ClassName.method, which should be replaced with super().method. This is an issue in many modules; I've been asked to create a report for each module that the PR touches. -- components:

[issue31853] Use super().method instead of socket.method in SSLSocket

2018-03-27 Thread Mads Jensen
Mads Jensen added the comment: There are lots of legacy calls in the form of ClassName.method, which should be replaced with super().method. -- components: +email -SSL nosy: +barry, r.david.murray pull_requests: +5996 ___ Python

[issue33111] Merely importing tkinter breaks parallel code (multiprocessing, sharedmem)

2018-03-27 Thread Ronald Oussoren
Ronald Oussoren added the comment: @ezwelty: The import of multiprocessing and the call to set_start_method should be at the very start of the code, before other imports, to avoid the annoying Apple behavior I mentioned. --

[issue16482] pdb.set_trace() clobbering traceback on error

2018-03-27 Thread daniel hahler
daniel hahler added the comment: Just for reference: https://github.com/python/cpython/pull/6233 is about fixing this. -- keywords: +patch nosy: +blueyed pull_requests: +5995 stage: needs patch -> patch review ___ Python

[issue33154] subprocess.Popen ResourceWarning should have activation-deactivation flags

2018-03-27 Thread Arno-Can Uestuensoez
Arno-Can Uestuensoez added the comment: See also issue26741 - subprocess.Popen should emit a ResourceWarning in destructor if ... -- ___ Python tracker

[issue33153] interpreter crash when multiplying large tuples

2018-03-27 Thread INADA Naoki
INADA Naoki added the comment: Would you paste traceback? -- nosy: +inada.naoki ___ Python tracker ___

[issue33154] subprocess.Popen ResourceWarning should have activation-deactivation flags

2018-03-27 Thread Arno-Can Uestuensoez
New submission from Arno-Can Uestuensoez : The subprocess call *subprocess.Popen* in Python3.6 was added a number of resource warnings, including subprocess run-state and open files. This is a very good facility for debugging, but causes a lot of trouble for programs

[issue33153] interpreter crash when multiplying large tuples

2018-03-27 Thread Ivan Zakharyaschev
New submission from Ivan Zakharyaschev : The issue https://bugs.python.org/msg314475 has arisen for tuples (but not for lists, as in the example there) in 2.7.14 for me. How should we fix it in a better way? This bug is not reproducible in python 3.5.4. [builder@localhost

[issue1704621] interpreter crash when multiplying large lists

2018-03-27 Thread Ivan Zakharyaschev
Ivan Zakharyaschev added the comment: New issue filed: https://bugs.python.org/issue33153 -- ___ Python tracker ___

[issue33153] interpreter crash when multiplying large tuples

2018-03-27 Thread Ivan Zakharyaschev
Ivan Zakharyaschev added the comment: I meant the old issue https://bugs.python.org/issue1704621 . -- ___ Python tracker ___

[issue33014] Clarify str.isidentifier docstring; fix keyword.iskeyword docstring

2018-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with David about the docstring. But I think that no changes are needed in the module documentation. David's wording would contain two links (for iskeyword() and for keyword), and many links distract the attention. We

[issue31550] Inconsistent error message for TypeError with subscripting

2018-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If the reason of this change was making the error message more consistent with other error messages in classic classes (at the cost of larger dereference with Python 3), it LGTM. --

[issue33124] Lazy execution of module bytecode

2018-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Function definitions usually are cheap, as well as global constants definitions (unless they use complex comprehensions or call heavy functions for initialization). Creating a class is an order or more slower than creating a

[issue33152] clean code

2018-03-27 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +5994 stage: -> patch review ___ Python tracker ___

[issue33152] clean code

2018-03-27 Thread Windson Yang
New submission from Windson Yang : https://github.com/python/cpython/blob/master/Lib/timeit.py#L202 use a list comprehension instead -- components: Distutils messages: 314504 nosy: Windson Yang, dstufft, eric.araujo priority: normal severity: normal status: open

[issue33146] contextlib.suppress should capture exception for inspection and filter on substrings

2018-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm not sure that contextlib.suppress() should be added at first place. try: os.remove(somefile) except FileNotFoundError: pass is a tiny bit longer, but is more explicit, doesn't depend on the other

[issue33150] Signature error for methods of class configparser.Interpolation

2018-03-27 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +lukasz.langa ___ Python tracker ___ ___

[issue33144] random._randbelow optimization

2018-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think this is excellent application of __init_subclass__. It is common to patch an instance method in __init__, but this can create a reference loop if patch it by other instance method. In this case the choice doesn't depend