[issue42451] Indicate in the docs that PyTuple_GetItem does not support negative indices

2020-11-26 Thread Yasser Alshalaan
Change by Yasser Alshalaan : -- keywords: +patch nosy: +Yasser Alshalaan nosy_count: 2.0 -> 3.0 pull_requests: +22411 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23529 ___ Python tracker

[issue34451] docs: tutorial/introduction doesn't mention toggle of prompts

2020-11-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: - It would apply to PDF renderings or CHM files etc. + We wouldn't the the proposed text to be visible in PDF renderings or CHM files etc. -- ___ Python tracker

[issue42478] ipaddress.IPv4network.interfaces()

2020-11-26 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not sure what you mean by iterating over the interfaces in a subnet. Could you give an example? -- nosy: +eric.smith ___ Python tracker

[issue17852] Built-in module _io can lose data from buffered files in reference cycles

2020-11-26 Thread Inada Naoki
Inada Naoki added the comment: New changeset c8aaf71dde464c0c351e2f935f87652c3d54 by Volker-Weissmann in branch 'master': bpo-17852: Doc: Fix the tutorial about closing files (GH-23135) https://github.com/python/cpython/commit/c8aaf71dde464c0c351e2f935f87652c3d54 -- nosy:

[issue17852] Built-in module _io can lose data from buffered files in reference cycles

2020-11-26 Thread Volker Weißmann
Volker Weißmann added the comment: The PR below fixed it: https://github.com/python/cpython/pull/23135 -- ___ Python tracker ___

[issue17852] Built-in module _io can lose data from buffered files in reference cycles

2020-11-26 Thread miss-islington
miss-islington added the comment: New changeset 01fcde89d7d56321078be1739e759fece61d0a2b by Miss Islington (bot) in branch '3.8': bpo-17852: Doc: Fix the tutorial about closing files (GH-23135) https://github.com/python/cpython/commit/01fcde89d7d56321078be1739e759fece61d0a2b --

[issue17852] Built-in module _io can lose data from buffered files in reference cycles

2020-11-26 Thread miss-islington
Change by miss-islington : -- pull_requests: +22410 pull_request: https://github.com/python/cpython/pull/23528 ___ Python tracker ___

[issue17852] Built-in module _io can lose data from buffered files in reference cycles

2020-11-26 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 13.0 -> 14.0 pull_requests: +22409 pull_request: https://github.com/python/cpython/pull/23527 ___ Python tracker

[issue41818] Lib/pty.py major revision

2020-11-26 Thread Soumendra Ganguly
Change by Soumendra Ganguly : -- pull_requests: +22408 pull_request: https://github.com/python/cpython/pull/23526 ___ Python tracker ___

[issue40840] lzma.h file not found building on macOS

2020-11-26 Thread Jason R. Coombs
Jason R. Coombs added the comment: Yes. If I trust my message from earlier, this issue is resolved. Closing now. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue41818] Lib/pty.py major revision

2020-11-26 Thread Soumendra Ganguly
Soumendra Ganguly added the comment: The reproducer was helpful. https://github.com/python/cpython/pull/23526 should fix this issue. -- ___ Python tracker ___

[issue42478] ipaddress.IPv4network.interfaces()

2020-11-26 Thread Wyko ter Haar
New submission from Wyko ter Haar : It would be really nice if we could get an iterator just like ip_network.hosts() that iterates over the interfaces in a subnet. -- messages: 381921 nosy: wyko.ter.haar priority: normal severity: normal status: open title:

[issue34451] docs: tutorial/introduction doesn't mention toggle of prompts

2020-11-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: The toggle option is only in the HTML version with javascript enabled. It would apply to PDF renderings or CHM files etc. -- nosy: +rhettinger ___ Python tracker

[issue42469] Space in re's {min, max} should raise an error, rather than fail silently

2020-11-26 Thread Raymond Hettinger
Change by Raymond Hettinger : -- priority: normal -> low type: -> behavior versions: +Python 3.10 -Python 3.9 ___ Python tracker ___

[issue42469] Space in re's {min, max} should raise an error, rather than fail silently

2020-11-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: If this can be fixed without doing brain surgery on the code, it would be nice to have this flagged as an error. People should learn as early as possible that regex patterns tend to be unforgiving about extra spaces. -- nosy: +rhettinger

[issue38638] Backtrace of exit phase of context managers

2020-11-26 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Traceback from __exit__ method is misleading ___ Python tracker

[issue42477] ip_interface addition and subtraction changes netmask

2020-11-26 Thread Wyko ter Haar
New submission from Wyko ter Haar : When increasing IPv4Interface('10.0.0.0/29)' by 1, I would expect to get IPv4Interface('10.0.0.1/29') . Unfortunately, it seems to change the netmask on it as well. That seems really unintuitive to me. For example: >>> ip_interface('10.0.0.0/24')

[RELEASE] Python 3.9.1rc1 is now ready for testing

2020-11-26 Thread Łukasz Langa
Python 3.9.1rc1 is the release candidate of the first maintenance release of Python 3.9. Go get it here: https://www.python.org/downloads/release/python-391rc1/ Assuming no critical problems are found prior to 2020-12-11, the currently

[issue34451] docs: tutorial/introduction doesn't mention toggle of prompts

2020-11-26 Thread Irit Katriel
Change by Irit Katriel : -- type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34451] docs: tutorial/introduction doesn't mention toggle of prompts

2020-11-26 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +easy versions: +Python 3.10, Python 3.9 -Python 3.4, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker ___

[issue31189] README.rst: installing multiple versions: typo

2020-11-26 Thread Irit Katriel
Change by Irit Katriel : -- nosy: +zach.ware versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7 ___ Python tracker ___ ___

[issue42299] Remove formatter module

2020-11-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: A coda on my 'obsolete and superseded' claim: text formatting events have 2 sources -- the text being displayed and user actions while reading. formatter somewhat mixes these together. html.parser.HTMLParser generates events from the text in the form of

[issue31248] method wrapper type has invalid __name__/__qualname__ 'method-wrapper'

2020-11-26 Thread Irit Katriel
Irit Katriel added the comment: Why is this a problem? -- nosy: +iritkatriel status: open -> pending ___ Python tracker ___ ___

[issue27259] [array doc] Possible missing deprecation warnings?

2020-11-26 Thread Irit Katriel
Change by Irit Katriel : -- components: +Library (Lib) title: Possible missing deprecation warnings? -> [array doc] Possible missing deprecation warnings? versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.6 ___ Python tracker

RE: Why can't numpy array be restored to saved value?

2020-11-26 Thread pjfarley3
> -Original Message- > From: Christian Gollwitzer > Sent: Thursday, November 26, 2020 3:26 AM > To: python-list@python.org > Subject: Re: Why can't numpy array be restored to saved value? > > Am 25.11.20 um 07:47 schrieb pjfarl...@earthlink.net: > > Why isn't the final value of the numpy

[issue26454] add support string that are not inherited from PyStringObject

2020-11-26 Thread Irit Katriel
Irit Katriel added the comment: I don't understand what the issue is. Can you clarify? -- nosy: +iritkatriel status: open -> pending ___ Python tracker ___

[issue40840] lzma.h file not found building on macOS

2020-11-26 Thread Ronald Oussoren
Ronald Oussoren added the comment: Is this issue resolved? -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue42476] Allow cross compiling python for macos-arm64 from macos-x86_64

2020-11-26 Thread Ronald Oussoren
Ronald Oussoren added the comment: I've added some review comments to the PR. Note that cross building like this will not be as well tested by us as regular builds. -- components: +macOS nosy: +ned.deily, ronaldoussoren ___ Python tracker

[issue25479] Increase unit test coverage for abc.py

2020-11-26 Thread Irit Katriel
Irit Katriel added the comment: The patch needs to be converted to a github PR. -- keywords: +easy (C) nosy: +iritkatriel versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.6 ___ Python tracker

[issue42475] wrongly cache pattern by re.compile

2020-11-26 Thread Matthew Barnett
Matthew Barnett added the comment: That behaviour has nothing to do with re. This line: samples = filter(lambda sample: not pttn.match(sample), data) creates a generator that, when evaluated, will use the value of 'pttn' _at that time_. However, you then bind 'pttn' to something else.

[issue42471] Slowdown in socket tests noticed since Py3.8

2020-11-26 Thread Bert JW Regeer
Bert JW Regeer added the comment: Ned: You are correct, I hadn't even considered that as a potential issue. Added a context to grab the fork multiprocessing context and we are back to the speed it was before. This slowdown is pretty huge for just changing the way the process is forked.

[issue42470] DeprecationWarning triggers for sequences which happen to be sets as well

2020-11-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: +0 Do you want to submit a PR for this? Some thoughts: * The current logic matches the logic before the warning was added. * The proposed logic matches what the code will do after the deprecation period (it will only check for non-sequences). * There

[issue42476] Allow cross compiling python for macos-arm64 from macos-x86_64

2020-11-26 Thread Isuru Fernando
Change by Isuru Fernando : -- keywords: +patch pull_requests: +22407 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23523 ___ Python tracker ___

RE: Why can't numpy array be restored to saved value?

2020-11-26 Thread pjfarley3
> -Original Message- > From: Greg Ewing > Sent: Thursday, November 26, 2020 12:01 AM > To: python-list@python.org > Subject: Re: Why can't numpy array be restored to saved value? > > On 25/11/20 7:47 pm, pjfarl...@earthlink.net wrote: > > Why isn't the final value of the numpy array

[issue42476] Allow cross compiling python for macos-arm64 from macos-x86_64

2020-11-26 Thread Isuru Fernando
New submission from Isuru Fernando : Only a few changes are needed and I will send a Pull request. This was used for providing macos-arm64 builds for conda where we are using cross compiling exclusively for all macos-arm64 builds -- components: Build messages: 381908 nosy: isuruf,

[issue42475] wrongly cache pattern by re.compile

2020-11-26 Thread ProFatXuanAll
New submission from ProFatXuanAll : When I run the following code, I expected to get output result `['i am next line with [unk]']`, but instead I get the original list in `data`. Code snippet ```py import re data = [ '= hello =', 'i am next line with ', ] pttn = re.compile(r'=.*=')

[issue42474] improve test coverage for TracebackException's __eq__

2020-11-26 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +patch pull_requests: +22406 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23522 ___ Python tracker ___

[issue42474] improve test coverage for TracebackException's __eq__

2020-11-26 Thread Irit Katriel
New submission from Irit Katriel : Currently there are no tests for comparison between non-equal instances of traceback.TracebackException, so changing it's __eq__ to return True instead of self.__dict__ == other.__dict__ would not break any tests. -- assignee: iritkatriel

[issue42473] re.sub ignores flag re.M

2020-11-26 Thread Matthew Barnett
Matthew Barnett added the comment: Not a bug. Argument 4 of re.sub is the count: sub(pattern, repl, string, count=0, flags=0) not the flags. -- nosy: +mrabarnett resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python

[issue42471] Slowdown in socket tests noticed since Py3.8

2020-11-26 Thread Ned Deily
Ned Deily added the comment: Do your tests use the multiprocessing module? As of 3.8, the default start method for multiprocessing on macOS was changed from “fork” to “spawn”: https://docs.python.org/3.8/library/multiprocessing.html#contexts-and-start-methods -- nosy: +ned.deily,

[issue42472] security hole in eval()

2020-11-26 Thread STINNER Victor
STINNER Victor added the comment: > The specification specifically allows for the restriction of access to > globals via the second argument to eval. The Python language reference doesn't provide any warranty like that. https://docs.python.org/dev/library/functions.html#eval I close the

[issue41625] Add splice() to the os module

2020-11-26 Thread STINNER Victor
Change by STINNER Victor : -- resolution: fixed -> status: closed -> open ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue41625] Add splice() to the os module

2020-11-26 Thread STINNER Victor
STINNER Victor added the comment: > ./Modules/posixmodule.c:10429:15: error: implicit declaration of function > 'splice'; did you mean 'plock'? [-Werror=implicit-function-declaration] Is it possible that posixmodule.c lacks an #include to get the function on AIX? On AIX 7.1, man splice

[issue41818] Lib/pty.py major revision

2020-11-26 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42473] re.sub ignores flag re.M

2020-11-26 Thread Jérôme Laurens
New submission from Jérôme Laurens : Test code: ``` import re test='''012345678 012345678 ''' pattern = r'^\s+?$' m = re.search(pattern, test, re.M) if m: print(f'TEST FOUND "{m.span()}"') def replace(m): print(f'TEST REMOVE {m.span()}') return '' test =

[issue42472] security hole in eval()

2020-11-26 Thread Christian Heimes
Christian Heimes added the comment: Your assumption is incorrect. The eval() does not promise that default builtins cannot be access through other means. The behavior has been discussed several times and at great length over the past decade. --

[issue42466] asyncio loop.getaddrinfo raises RuntimeError

2020-11-26 Thread Andrew Svetlov
Andrew Svetlov added the comment: Because it did work in a gray area. The finalization logic has slightly changed, some tricks that were working before now fails. Sure, other undocumented tricks start working :) The rule of thumb: please stop and close the asyncio loop before exiting the

[issue42472] security hole in eval()

2020-11-26 Thread Chris Drake
Chris Drake added the comment: The specification specifically allows for the restriction of access to globals via the second argument to eval. While Christian and Victor make interesting, albeit suicidal, comments and references to other efforts, the fact remains that this is a violation of

[issue42466] asyncio loop.getaddrinfo raises RuntimeError

2020-11-26 Thread Giacomo Caironi
Giacomo Caironi added the comment: Ok but then why does it work in python3.8 and not in python 3.9? -- ___ Python tracker ___ ___

[issue42466] asyncio loop.getaddrinfo raises RuntimeError

2020-11-26 Thread Andrew Svetlov
Andrew Svetlov added the comment: Because you have `test.start()` and immediately finish the script. The interpreted goes to *shutdown* state and implicitly waits for `test.join()` because the test thread is not a daemon. -- ___ Python tracker

[issue42472] security hole in eval()

2020-11-26 Thread STINNER Victor
STINNER Victor added the comment: I suggest you to read https://python-security.readthedocs.io/security.html about the Python security model. In short, as soon as you let users to execute arbitrary Python code, they get a full access to the machine. If you want to restrict access, you must

[issue42472] security hole in eval()

2020-11-26 Thread Christian Heimes
Christian Heimes added the comment: Would you care to explain why this should not work and how this behavior is in violation of the language specification? It is perfectly valid expression. From a security perspective it may be an undesired feature. However Python does neither claim nor

[issue42466] asyncio loop.getaddrinfo raises RuntimeError

2020-11-26 Thread Giacomo Caironi
Giacomo Caironi added the comment: Why do you say that `getaddrinfo()` is called at the interpreter shutdown state? On my machine it works and the output is [(, , 6, '', ('216.58.208.132', 8333)), (, , 17, '', ('216.58.208.132', 8333)), (, , 0, '', ('216.58.208.132', 8333)), (, , 6, '',

[issue42472] security hole in eval()

2020-11-26 Thread Chris Drake
New submission from Chris Drake : This should not work:- python3.7 -c 'print(eval("().__class__.__base__.__subclasses__()[-1].__init__.__globals__",{"__builtins__": {}},{"__builtins__": {}}))' and should be properly fixed. -- messages: 381892 nosy: cryptophoto priority: normal

[issue42392] remove the 'loop' parameter from __init__ in all classes in asyncio.locks

2020-11-26 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- pull_requests: +22405 pull_request: https://github.com/python/cpython/pull/23521 ___ Python tracker ___

[issue42471] Slowdown in socket tests noticed since Py3.8

2020-11-26 Thread Bert JW Regeer
New submission from Bert JW Regeer : I am being fairly vague here, but it is mainly because I don't know the best way to reduce the test cases down to pinpoint the problem. I maintain Waitress, a pure Python HTTP server, and ever since Python 3.8 there's been a marked slowdown of the

[issue41332] connect_accepted_socket() missing from AbstractEventLoop

2020-11-26 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker

[issue41332] connect_accepted_socket() missing from AbstractEventLoop

2020-11-26 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset e3ef4d7f653976ac0ccacc4e3fde06bf0e0f139b by Alex Grönholm in branch 'master': bpo-41332: Added missing connect_accepted_socket() to AbstractEventLoop (GH-21533) https://github.com/python/cpython/commit/e3ef4d7f653976ac0ccacc4e3fde06bf0e0f139b

[issue41562] StreamReaderProtocol inheritance

2020-11-26 Thread Andrew Svetlov
Andrew Svetlov added the comment: You are right, but the existing inheritance is also correct (while a little redundant). Sorry, I don't think we should do anything: don't fix if not broken. -- resolution: -> not a bug stage: -> resolved status: open -> closed

[issue41625] Add splice() to the os module

2020-11-26 Thread Michael Felt
Michael Felt added the comment: This is still broken. Since this was included in master - the AIX buildbot is failing to compile (https://buildbot.python.org/all/#/builders/438/builds/391 and https://buildbot.python.org/all/#/builders/302/builds/377) Strangely enough - the first bot

[issue42347] loop.call_exception_handler documentation is lacking

2020-11-26 Thread Andrew Svetlov
Andrew Svetlov added the comment: Pull Request is welcome! -- ___ Python tracker ___ ___ Python-bugs-list mailing list

Re: Why can't numpy array be restored to saved value?

2020-11-26 Thread Christian Gollwitzer
Am 25.11.20 um 07:47 schrieb pjfarl...@earthlink.net: Why isn't the final value of the numpy array npary in the following code the same as the initial value before some but not all elements of the array were changed to a new value? I know I am missing something basic here. I thought I

[issue42470] DeprecationWarning triggers for sequences which happen to be sets as well

2020-11-26 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42413] Replace custom exceptions for timeouts with TimeoutError

2020-11-26 Thread Andrew Svetlov
Andrew Svetlov added the comment: Pull Request https://github.com/python/cpython/pull/23520/ applies the discussed change to both asyncio and concurrent.futures. I did the minimally invasive change, libraries still use `asyncio.TimeoutError` and `concurrent.futures.TimeoutError` internally

[issue42413] Replace custom exceptions for timeouts with TimeoutError

2020-11-26 Thread Andrew Svetlov
Change by Andrew Svetlov : -- pull_requests: +22404 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23520 ___ Python tracker ___

[issue42470] DeprecationWarning triggers for sequences which happen to be sets as well

2020-11-26 Thread Xavier Morel
New submission from Xavier Morel : In 3.9, using `random.sample` on sets triggers DeprecationWarning: Sampling from a set deprecated since Python 3.9 and will be removed in a subsequent version. *However* it also triggers on types which implement *both* Sequence and Set, despite Sequence

[issue42413] Replace custom exceptions for timeouts with TimeoutError

2020-11-26 Thread Andrew Svetlov
Change by Andrew Svetlov : -- components: +Library (Lib), asyncio ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue42413] Replace custom exceptions for timeouts with TimeoutError

2020-11-26 Thread Andrew Svetlov
Change by Andrew Svetlov : -- title: Replace custom exception socket.timeout with TimeoutError -> Replace custom exceptions for timeouts with TimeoutError ___ Python tracker

[issue42466] asyncio loop.getaddrinfo raises RuntimeError

2020-11-26 Thread Andrew Svetlov
Andrew Svetlov added the comment: Your snippet exits just after starting. `getaddrinfo()` is called at the interpreter shutdown state. I'm not sure that do you expect to get here. We can put some effort and raise an error with another message but cannot make the example working. I suggest