[issue16500] Allow registering at-fork handlers

2017-05-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please update the documentation Antoine? * An entry in the C API section of Misc/NEWS. * The "What's New" document needs changes in multiple places: the os module improvement, C API additions and deprecation, and may be in porting guide. * Update

[issue16500] Allow registering at-fork handlers

2017-05-28 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- pull_requests: +1928 ___ Python tracker ___ ___

[issue16500] Allow registering at-fork handlers

2017-05-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Can multiprocessing.util.register_after_fork() be rewritten with using the > new API? It wouldn't benefit much from it, and there might be timing issue given the comments in BaseProcess._bootstrap(): old_process = _current_process

[issue30493] Increase coverage of base64

2017-05-28 Thread Lee Cannon
Lee Cannon added the comment: Suggested changes have been applied to the PR. -- ___ Python tracker ___ ___

[issue30495] IDLE: modernize textview module

2017-05-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 0aa0a06e8b719533aefd175a5716f1698f474052 by terryjreedy (csabella) in branch 'master': bpo-30495: IDLE: Modernize textview.py with docstrings and PEP8 names (#1839) https://github.com/python/cpython/commit/0aa0a06e8b719533aefd175a5716f1698f474052

[issue16500] Allow registering at-fork handlers

2017-05-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In PR 1834 Gregory proposes an alternate API: os.register_at_fork(*, before=None, after_in_parent=None, after_in_child=None) Maybe open a new issue for this? -- ___ Python tracker

[issue30346] Odd behavior when unpacking `itertools.groupby`

2017-05-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Raymond, could you please look at these patches? Both are small. What do you prefer? -- ___ Python tracker ___

[issue30496] Incomplete traceback with `exec`

2017-05-28 Thread Stefan Seefeld
New submission from Stefan Seefeld: The following code is supposed to catch and report errors encountered during the execution of a (python) script: ``` import traceback import sys try: env = {} with open('script') as f: exec(f.read(), env) except: type_, value_, tb =

[issue11822] Improve disassembly to show embedded code objects

2017-05-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +1931 ___ Python tracker ___ ___

[issue30300] asyncio.Controller

2017-05-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think the API is too specific. Instead of requiring hostname and port, why not let the user override setup and teardown coroutines? In your case, this could be: async def setup(self): self.server = await self.loop.create_server(...) async def

[issue16500] Allow registering at-fork handlers

2017-05-28 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- status: open -> closed ___ Python tracker ___ ___

[issue16500] Allow registering at-fork handlers

2017-05-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset 4a8bcdf79cdb3684743fe1268de62ee88bada439 by Antoine Pitrou in branch 'master': bpo-16500: Use register_at_fork() in the threading module (#1843) https://github.com/python/cpython/commit/4a8bcdf79cdb3684743fe1268de62ee88bada439 --

[issue16500] Allow registering at-fork handlers

2017-05-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Can threading._after_fork() be rewritten with using the new API? -- ___ Python tracker ___

[issue16500] Allow registering at-fork handlers

2017-05-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Can multiprocessing.util.register_after_fork() be rewritten with using the new API? -- ___ Python tracker ___

[issue30177] pathlib.resolve(strict=False) only includes first child

2017-05-28 Thread Richard Cooper
Richard Cooper added the comment: Pull Request (PR 1649) treats this as a documentation problem. I would argue that the documentation is correct and this is a bug in the code. The `strict` flag was added as a result of issue19717. The decision on what to do when strict=False seems to come in

[issue16500] Allow registering at-fork handlers

2017-05-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset f7ecfac0c15f0c43ef5e6c0081eb3a059af9f074 by Antoine Pitrou in branch 'master': Doc nits for bpo-16500 (#1841) https://github.com/python/cpython/commit/f7ecfac0c15f0c43ef5e6c0081eb3a059af9f074 -- ___

[issue16500] Allow registering at-fork handlers

2017-05-28 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- pull_requests: +1929 ___ Python tracker ___ ___

[issue30248] Using boolean arguments in the _json module

2017-05-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue11822] Improve disassembly to show embedded code objects

2017-05-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 1844 implements Nick's suggestion, but I don't like it. This complicates both the interface and the implementation. help() also can produce very noisy output if request the documentation of the whole module. But the output of help() usually is piped

[issue30431] input function truncates prompt by NULL byte

2017-05-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If stdin and stdout are attached to a terminal, input() uses the readline library (if it is available) for displaying the prompt and reading user input. This is the limitation of the readline library and Python C API that this works with null-terminated C

[issue13349] Non-informative error message in index() and remove() functions

2017-05-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Raymond. But shouldn't we change error messages that contains the repr of not found value? Affected collections are list, deque and range. >>> [].index('spam') Traceback (most recent call last): File "", line 1, in ValueError: 'spam' is not

[issue25791] Raise an ImportWarning when __spec__.parent/__package__ isn't defined for a relative import

2017-05-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: This new warning is introducing difficulties for some Cython-compiled modules: https://github.com/cython/cython/issues/1720 -- nosy: +pitrou ___ Python tracker

[issue16500] Allow registering at-fork handlers

2017-05-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 28/05/2017 à 11:22, Serhiy Storchaka a écrit : > > Serhiy Storchaka added the comment: > > Can threading._after_fork() be rewritten with using the new API? It should be possible indeed. Let me see. -- ___

[issue30495] IDLE: modernize textview module

2017-05-28 Thread Cheryl Sabella
Cheryl Sabella added the comment: Thanks Terry! I had done a search in Spyder using "textView" and only found those files that I changed, but now I see what I did wrong. If I do it within a different git branch that isn't up to update with the master, it won't show up, but if I do it in the

[issue30248] Using boolean arguments in the _json module

2017-05-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ac5bbd43bc7b769c13ae0412cb28a3521f4d4ff1 by Serhiy Storchaka in branch 'master': bpo-30248: Convert boolean arguments only once in _json. (#1423) https://github.com/python/cpython/commit/ac5bbd43bc7b769c13ae0412cb28a3521f4d4ff1 --

[issue19717] resolve() fails when the path doesn't exist

2017-05-28 Thread Marcel Plch
Changes by Marcel Plch : -- pull_requests: +1930 ___ Python tracker ___ ___

[issue30498] Run Python's slowest tests in the first 3/4 of tests when using -r

2017-05-28 Thread Brett Cannon
Brett Cannon added the comment: One way to control this would allow `-r` to take an optional `fast` argument to do this selective shuffle of the slowest tests, i.e. `-r fast` would still randomize but control for the slowest tests showing up in the first 75% of tests. --

[issue11822] Improve disassembly to show embedded code objects

2017-05-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Would it help if pipe the output of dis() through a pager > if the output file and stdin are attached to a terminal? -1 for adding a pager. -- ___ Python tracker

[issue16500] Allow registering at-fork handlers

2017-05-28 Thread Gregory P. Smith
Gregory P. Smith added the comment: I'll just reuse this issue, I started that work just to try and clean up the new API and docs added in this one to be more modern. Thanks for the code review, good suggestions! -- assignee: -> gregory.p.smith stage: resolved -> commit review

[issue30498] Run Python's slowest tests in the first 3/4 of tests when using -r

2017-05-28 Thread Brett Cannon
New submission from Brett Cannon: If we guaranteed that the slowest tests in the test suite started early enough in the test run to complete before the final test finished, we could shave off several minutes worth of time in cases where the slowest tests are the hold-up. So perhaps if we

[issue25791] Raise an ImportWarning when __spec__.parent/__package__ isn't defined for a relative import

2017-05-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: AFAICT, Cython simply calls PyModule_Create() on Python 3. -- nosy: +scoder ___ Python tracker ___

[issue25791] Raise an ImportWarning when __spec__.parent/__package__ isn't defined for a relative import

2017-05-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: multidict is a package, the Cython module is multidict._multidict. Cython translated "import sys" into this: __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) And __Pyx_Import is this:

[issue30495] IDLE: modernize textview module

2017-05-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: I believe you said elsewhere that you would like to try the refactoring that splits a window+frame class into a window class and a frame class. It would be great if you became good at doing this. If the current class name is used externally, I might consider

[issue30497] Line number of docstring in AST

2017-05-28 Thread Steven Myint
New submission from Steven Myint: Since #29463, it is no longer obvious how to get the line number of a docstring in the AST: import ast x = ast.parse('''\ def foo(): """This is a docstring.""" ''') # In Python 3.6, the docstring and line number would be:

[issue30495] IDLE: modernize textview module

2017-05-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: What I have learned: 1. As with hg, the local master should be updated at least at the beginning of each work session, and python.exe rebuilt. 2. Patches to master should be developed with all 'other' files updated. For completely new branches, this is

[issue13349] Non-informative error message in index() and remove() functions

2017-05-28 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: Thanks, I understand why this isn't the best idea now. > shouldn't we change error messages that contains the repr of not found value? That is what I was thinking too, apart from removing the repr from other messages it will also unify reporting for

[issue29626] Issue with spacing in argparse module while using help

2017-05-28 Thread R. David Murray
R. David Murray added the comment: If I'm interpreted what the OP wrote correctly, he wanted the help text to not show that the option takes an argument, but instead rely on the help text to show that. That works for the option text, but it doesn't work for the synopsis (the synopsis is just

[issue25791] Raise an ImportWarning when __spec__.parent/__package__ isn't defined for a relative import

2017-05-28 Thread Brett Cannon
Brett Cannon added the comment: Is Cython not defining actual module objects or working around types.ModuleType? I'm just trying to figure out how a Cython module is ending up in a place where the attributes that are set by PyModule_NewObject() aren't there

[issue25791] Raise an ImportWarning when __spec__.parent/__package__ isn't defined for a relative import

2017-05-28 Thread Brett Cannon
Brett Cannon added the comment: OK, so the warning is triggered if __package is None or __spec__ is None (https://github.com/python/cpython/blob/ac5bbd43bc7b769c13ae0412cb28a3521f4d4ff1/Lib/importlib/_bootstrap.py#L1038). That's defined in _calc___package__() which is only called if index != 0

[issue30499] Deprecated note in set documentation

2017-05-28 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: docs@python -> rhettinger ___ Python tracker ___

[issue30500] urllib connects to a wrong host

2017-05-28 Thread Nam Nguyen
New submission from Nam Nguyen: Reported by Orange Tsai: == Hi, Python Security Team import urllib from urlparse import urlparse url = 'http://127.0.0.1#@evil.com/' print urlparse(url).netloc # 127.0.0.1 print urllib.urlopen(url).read()# will access evil.com I have

[issue25791] Raise an ImportWarning when __spec__.parent/__package__ isn't defined for a relative import

2017-05-28 Thread Nick Coghlan
Nick Coghlan added the comment: Is it possible Cython is still supporting pre-PEP-328 style implicit relative imports, even in Python 2.7+? -- ___ Python tracker

[issue30500] urllib connects to a wrong host

2017-05-28 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- versions: +Python 3.5, Python 3.6 ___ Python tracker ___

[issue3062] Turtle speed() function has no effect under Mac OS X

2017-05-28 Thread Carol Willing
Carol Willing added the comment: Turtle speed() functions appropriately on current MacOS 10.12.4. Both Python 3.1 and 3.2 have reached End of Life. Issue closed as out of date. -- nosy: +willingc resolution: -> out of date stage: needs patch -> resolved status: open -> closed

[issue7074] Turtle module crashes python

2017-05-28 Thread Carol Willing
Carol Willing added the comment: Ran the turtlecrash.py example with Python 3.6 on MacOS 10.12.4. I was unable to create a crash using keypresses. I recommend closing as 3.2 has reached EOL and 3.3 will reach EOL in less than 5 months. I'm going to change status to Pending and Resolution to

[issue30500] urllib connects to a wrong host

2017-05-28 Thread Martin Panter
Martin Panter added the comment: See also Issue 18140, where it looks like people _want_ the hash (#) to be part of the username and/or password. Another option may be to raise an exception. -- nosy: +martin.panter ___ Python tracker

[issue11978] Report correct coverage.py data for tests that invoke subprocesses

2017-05-28 Thread Brett Cannon
Brett Cannon added the comment: I learned a few thing trying to make this work. One is that the COVERAGE_PROCESS_START does need to point to an actual .ini file (which includes an empty file). Two,

[issue11978] Report correct coverage.py data for tests that invoke subprocesses

2017-05-28 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: -> brett.cannon ___ Python tracker ___ ___

[issue29626] Issue with spacing in argparse module while using help

2017-05-28 Thread paul j3
paul j3 added the comment: I don't anticipate any backward compatibility issues with the proposed patch. But at the same time it feels almost too trivial of an issue to merit a patch. A short metavar such as `metavar="ID"' or even `metavar="_"' would be nearly as compact, and still leave

[issue29670] argparse: does not respect required args pre-populated into namespace

2017-05-28 Thread paul j3
paul j3 added the comment: http://bugs.python.org/issue26394 Have argparse provide ability to require a fallback value be present is a related issue - getting 'required' values from a config file. -- ___ Python tracker

[issue26394] Have argparse provide ability to require a fallback value be present

2017-05-28 Thread paul j3
paul j3 added the comment: http://bugs.python.org/issue29670 argparse: does not respect required args pre-populated into namespace wants to put 'required' values in the Namespace. That's a similar issue. An idea that I tried for that (but didn't submit as a patch) is to move the tests at the

[issue30499] Deprecated note in set documentation

2017-05-28 Thread Julien Palard
New submission from Julien Palard: While translating doc to french, I found a surprising comment in stdtypes.html about sets, stating: > To support searching for an equivalent frozenset, the elem set is temporarily > mutated during the search and then restored. During the search, the elem set

[issue30499] Deprecated note in set documentation

2017-05-28 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +1932 ___ Python tracker ___

[issue30300] asyncio.Controller

2017-05-28 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Hi Antoine, On May 28, 2017, at 11:07 AM, Antoine Pitrou wrote: >I think the API is too specific. Can you elaborate? What's too specific about it? Do you have in mind a use case where you wouldn't need to provide hostname and port? >Instead of requiring