[issue43033] Incorrect handling of PyObject_SetAttrString() in the _zoneinfo module

2021-01-27 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +23169 pull_request: https://github.com/python/cpython/pull/24349 ___ Python tracker _

[issue43033] Incorrect handling of PyObject_SetAttrString() in the _zoneinfo module

2021-01-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 5327f370344a627f1578d8183d197feb286371c6 by Zackery Spytz in branch 'master': bpo-43033: Fix the handling of PyObject_SetAttrString() in _zoneinfo.c (GH-24345) https://github.com/python/cpython/commit/5327f370344a627f1578d8183d197feb286371c6

[issue43030] signed/unsigned mismatch in Py_UNICODE_ISSPACE macro

2021-01-27 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch nosy: +serhiy.storchaka nosy_count: 3.0 -> 4.0 pull_requests: +23170 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24350 ___ Python tracker

[issue43030] signed/unsigned mismatch in Py_UNICODE_ISSPACE macro

2021-01-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No, it is not enough, because we do not want to use ch as index if it is negative. -- ___ Python tracker ___ _

[issue43033] Incorrect handling of PyObject_SetAttrString() in the _zoneinfo module

2021-01-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset cb77c5e1ddd9328e4706f8fdf893aa6bf697942c by Miss Islington (bot) in branch '3.9': bpo-43033: Fix the handling of PyObject_SetAttrString() in _zoneinfo.c (GH-24345) (GH-24349) https://github.com/python/cpython/commit/cb77c5e1ddd9328e4706f8fdf8

[issue43033] Incorrect handling of PyObject_SetAttrString() in the _zoneinfo module

2021-01-27 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue43031] aarch64 RHEL7 LTO + PGO 3.7: "make" hangs when running test_asyncio

2021-01-27 Thread STINNER Victor
STINNER Victor added the comment: New changeset 6790005a9a30ae3eca69d1957fb072171643a366 by Victor Stinner in branch 'master': bpo-43031: Set a timeout when running tests in PGO build (GH-24339) https://github.com/python/cpython/commit/6790005a9a30ae3eca69d1957fb072171643a366 -- __

[issue43031] aarch64 RHEL7 LTO + PGO 3.7: "make" hangs when running test_asyncio

2021-01-27 Thread STINNER Victor
STINNER Victor added the comment: I close the issue. I added a timeout (20 min) in master when running tests for a PGO build. > I created https://github.com/python/buildmaster-config/pull/228 to skip PGO > builds on Python 3.7, since test_asyncio hangs on PGO builds. Done. I remove all Pyth

[issue42979] _zoneinfo: zoneinfomodule_exec() doesn't check for PyDateTime_IMPORT failure

2021-01-27 Thread STINNER Victor
STINNER Victor added the comment: New changeset eeb701adc0fc29ba803fddf133d917ff45639a00 by Hai Shi in branch 'master': bpo-42979: _zoneinfo exec function checks for PyDateTime_IMPORT failure (GH-24333) https://github.com/python/cpython/commit/eeb701adc0fc29ba803fddf133d917ff45639a00 -

[issue42979] _zoneinfo: zoneinfomodule_exec() doesn't check for PyDateTime_IMPORT failure

2021-01-27 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +23171 pull_request: https://github.com/python/cpython/pull/24351 ___ Python tracker _

[issue42307] make install must not copy python.o into $prefix/lib/python3.10/config-3.10-x86_64-linux-gnu/

2021-01-27 Thread Miro Hrončok
Change by Miro Hrončok : -- nosy: +hroncok ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue42979] _zoneinfo: zoneinfomodule_exec() doesn't check for PyDateTime_IMPORT failure

2021-01-27 Thread STINNER Victor
STINNER Victor added the comment: Thanks for the fix Hai Shi! > By the way, the import machinery should raise a SystemError if a module exec > function raises an exception *and* reports a success: see > _Py_CheckFunctionResult(). It's already the case. Example: >>> import _zoneinfo Traceba

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I am -1 exposing the C-API of the tokenizer. For the new parser several modifications of the C tokenizer had to be done and some of them modify existing behaviour slightly. I don't want to corner ourselves in a place where we cannot make improvements

[issue42979] _zoneinfo: zoneinfomodule_exec() doesn't check for PyDateTime_IMPORT failure

2021-01-27 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23172 pull_request: https://github.com/python/cpython/pull/24352 ___ Python tracker ___ __

[issue42979] _zoneinfo: zoneinfomodule_exec() doesn't check for PyDateTime_IMPORT failure

2021-01-27 Thread STINNER Victor
STINNER Victor added the comment: New changeset 895591c1f0bdec5ad357fe6a5fd0875990061357 by Miss Islington (bot) in branch '3.9': bpo-42979: _zoneinfo exec function checks for PyDateTime_IMPORT failure (GH-24333) (GH-24351) https://github.com/python/cpython/commit/895591c1f0bdec5ad357fe6a5fd

[issue43035] FileNotFoundError in distutils\file_util.py copy_tree

2021-01-27 Thread Karthik Nishanth
New submission from Karthik Nishanth : I am making a bdist_wheel for a private python binary module. `python setup.py bdist_wheel` fails on a very specific windows VM repeatedly. This works fine on both a regular windows machine & linux machines. Attached the complete distutils verbose logs.

[issue43035] FileNotFoundError in distutils\file_util.py copy_tree

2021-01-27 Thread Christian Heimes
Christian Heimes added the comment: distutils is a legacy package. setuptools is the successor of distutils. Could you please try again with setuptools? -- nosy: +christian.heimes ___ Python tracker ___

[issue43035] FileNotFoundError in distutils\file_util.py copy_tree

2021-01-27 Thread Karthik Nishanth
Karthik Nishanth added the comment: Sorry, I did use the `setup` function from `from setuptools import setup` I marked the component as Distutils because I noticed setuptools called distutils internally in the stacktrace -- ___ Python tracker <

[issue43035] FileNotFoundError in distutils\file_util.py copy_tree

2021-01-27 Thread Christian Heimes
Christian Heimes added the comment: It looks like you version number is confusing setuptools and distutils. Setuptools even warns you about the invalid version number: UserWarning: The version specified ('2.3.0-pre-alpha-1+c8273a4c-1-preview') is an invalid version, this may not work as expe

[issue43036] TOS-behaviour documentation is

2021-01-27 Thread Xavier Morel
New submission from Xavier Morel : I was looking at the disassembly of a fairly straightforward listcomp: [e for e in s if e[0]] 1 0 BUILD_LIST 0 2 LOAD_FAST0 (.0) >>4 FOR_ITER16 (to 22) 6 STO

[issue42955] Add sys.stdlib_module_names: list of stdlib module names (Python and extension modules)

2021-01-27 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23173 pull_request: https://github.com/python/cpython/pull/24353 ___ Python tracker ___ __

[issue43035] FileNotFoundError in distutils\file_util.py copy_tree

2021-01-27 Thread Karthik Nishanth
Karthik Nishanth added the comment: I use the same version of python on my local windows machine and in the VM. Since I am not explicitly upgrading setuptools in my scripts, I should expect the same error on my windows machine too, right? This also works on linux. The stacktrace also says t

[issue42507] test_ttk_guionly test failures on macOS with Tcl/Tk 8.6.10

2021-01-27 Thread STINNER Victor
STINNER Victor added the comment: Failure on the Ubuntu job run on my PR 24353: https://github.com/python/cpython/pull/24353/checks?check_run_id=1776422914 == FAIL: test_identify (tkinter.test.test_ttk.test_widgets.ComboboxTe

[issue43037] Importlib reload by module name (String)

2021-01-27 Thread Stefan Mosoi
New submission from Stefan Mosoi : Weird behaviour (maybe it's my opinion) in reload from importlib if i do: import importlib import sys import datetime importlib.reload(datetime.timedelta.__module__) I get Typeerror: reload() argument must be a module but if i do import importlib import sys

[issue42979] _zoneinfo: zoneinfomodule_exec() doesn't check for PyDateTime_IMPORT failure

2021-01-27 Thread hai shi
hai shi added the comment: > It's already the case. Example Nice, interesting case. -- ___ Python tracker ___ ___ Python-bugs-list

[issue43038] ensurepip: tries to use setup.py/setup.cfg

2021-01-27 Thread Jan Christoph
New submission from Jan Christoph : Running python3 -Im ensurepip --upgrade --default-pip in a directory that contains a setup.cfg / setup.py combination, caused ensurepip to try and use these files, leading to distutils.errors.DistutilsOptionError: error in setup.cfg: command 'build' has n

[issue43039] tempfile.TemporaryDirectory() name string is incorrect

2021-01-27 Thread Eric Osborne
New submission from Eric Osborne : When I create a temporary directory, the name doesn't come back in a way the application expects it. I ran into this using gitPython and I'm not entirely clear whether it's a tmpfile issue or a gitpython issue, but I think it's tempfile. Repro: In [12]:

[issue43040] random.py randrange() is very slow if the range is a power of 2.

2021-01-27 Thread Donovan Baarda
New submission from Donovan Baarda : I encountered a very significant slowdown migrating some code from python2.7 to python3.9 that I tracked down to randrange() being slow. After digging I noticed that _randbelow_with_getrandbits() calls getrandbits() 2x as many times, and asks for one more

[issue43040] random.py randrange() is very slow if the range is a power of 2.

2021-01-27 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +mark.dickinson, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-27 Thread Tadek Kijkowski
Tadek Kijkowski added the comment: I went with Paul's suggestion and added nargs='**' instead of greedy, so at this moment this PR doesn't introduce any changes in any public signatures. I'm working on 'capture' actions, but I want that to be a separate PR and a separate issue because - firs

[issue43039] tempfile.TemporaryDirectory() name string is incorrect

2021-01-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is a bug in gitPython. As for adding a new feature, making TemporaryDirectory.__str__() returning just a name, I am not sure that it is needed, and it has drawbacks. If print() for TemporaryDirectory object will output just a directory name, it can crea

[issue43040] random.py randrange() is very slow if the range is a power of 2.

2021-01-27 Thread Mark Dickinson
Mark Dickinson added the comment: See also #37000. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue43037] Importlib reload by module name (String)

2021-01-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It works as documented. reload() argument must be a module. If you have only module name, sys.modules is a mapping of module names to modules. It is trivial to combine two things in one line. And why do you want to reload a module by name (without having a

[issue43039] tempfile.TemporaryDirectory() name string is incorrect

2021-01-27 Thread Eric V. Smith
Eric V. Smith added the comment: I agree with Serhiy: changing TemporaryDirectory.__str__() definitely has drawbacks. I assume gitPython is using str() where they might want to use os.fspath(). Maybe tempfile.TemporaryDirectory (and similar) could then support __fspath__. -- nosy: +

[issue43035] FileNotFoundError in distutils\file_util.py copy_tree

2021-01-27 Thread Karthik Nishanth
Karthik Nishanth added the comment: I made my version PEP440 (local version) compliant. Now I get an error in a different place and it makes more sense. [WinError 206] The filename or extension is too long: 'build\\bdist.win-amd64\\wheel\\...\\purelib\\pkg..-2.3.0+b0105812.1.preview-py3.9.eg

[issue43040] random.py randrange() is very slow if the range is a power of 2.

2021-01-27 Thread Donovan Baarda
Change by Donovan Baarda : -- keywords: +patch pull_requests: +23174 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24354 ___ Python tracker ___ _

[issue43040] random.py randrange() is very slow if the range is a power of 2.

2021-01-27 Thread Donovan Baarda
Donovan Baarda added the comment: Thanks @mark.dickinson for the heads up on that issue. Comments in the code hinted that people had tried to tackle this but IMHO they missed the real fix. I've submitted #24354 on github. It's missing an addition to the NEWS.d because I wasn't sure if someth

[issue43037] Importlib reload by module name (String)

2021-01-27 Thread Stefan Mosoi
Stefan Mosoi added the comment: The motivation behind my request is as follow: I have a dynamic set class (i don't "know" it) and calling __module__ for that class return a string, reload requires Module(and i don't think __module__ will be changed to module). The other functions (import, im

[issue43041] copying WeakValueDictionary is not iteration safe

2021-01-27 Thread Daniel Romberg
New submission from Daniel Romberg : The copy operation is not safe to use during iteration. The following test case raises a "RuntimeError: dictionary changed size during iteration": import weakref class Class: pass def TEST_weakValue(): d = weakref.WeakValueDictionary() a = Class()

[issue43040] random.py randrange() is very slow if the range is a power of 2.

2021-01-27 Thread Mark Dickinson
Mark Dickinson added the comment: @Donovan: Please get Raymond Hettinger's sign-off before merging anything. In #37000, the decision not to change things wasn't because we missed a fix, but rather because it was decided that it was better to leave things as they were. I don't think anything

[issue43037] Importlib reload by module name (String)

2021-01-27 Thread Stefan Mosoi
Stefan Mosoi added the comment: Also > without having a reference to module itself reload() just gets the name of the module try: name = module.__spec__.name except AttributeError: name = module.__name__ and then if sys.modules.get(name) is not module So it might

[issue42115] Caching infrastructure for the evaluation loop: specialised opcodes

2021-01-27 Thread Bis Matrimony
Bis Matrimony added the comment: I think it has something to do with the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag which came to python.org release: https://www.bismatrimony.com/ Implemented FR #72768 (Add ENABLE_VIRTUAL_TERMINAL_PROCESSING flag f -- nosy: +bismatrimony ___

[issue42115] Caching infrastructure for the evaluation loop: specialised opcodes

2021-01-27 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- Removed message: https://bugs.python.org/msg385782 ___ Python tracker ___ ___ Python-bugs-list

[issue43041] copying WeakValueDictionary is not iteration safe

2021-01-27 Thread Torben Paetz
Change by Torben Paetz : -- nosy: +tpaetz ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue35615] "RuntimeError: Dictionary changed size during iteration" when copying a WeakValueDictionary

2021-01-27 Thread Torben Paetz
Change by Torben Paetz : -- nosy: +tpaetz ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue43041] copying WeakValueDictionary is not iteration safe

2021-01-27 Thread Christian Heimes
Christian Heimes added the comment: Do you see a crash or an exception? We use the term "crash" to refer to a segfault or other fatal crashes of the interpreter. -- nosy: +christian.heimes versions: -Python 3.6, Python 3.7 ___ Python tracker

[issue43040] random.py randrange() is very slow if the range is a power of 2.

2021-01-27 Thread Donovan Baarda
Donovan Baarda added the comment: I first noticed the problem when migrating a program doing lots of randrange(2**32) calls from python2 (using pypy -O) to python3 (using pypy3 -O) on Debian. The time results were; pypy -O real    3m58.621s user    3m58.501s sys     0m0.085s pypy3 -O real  

[issue43041] copying WeakValueDictionary is not iteration safe

2021-01-27 Thread Daniel Romberg
Daniel Romberg added the comment: Sorry, I meant an exception. I changed the type to "behavior", thanks for the hint. -- type: crash -> behavior ___ Python tracker ___ __

[issue43038] ensurepip: tries to use setup.py/setup.cfg

2021-01-27 Thread Ned Deily
Ned Deily added the comment: Thanks for the report. This behavior has been reported in open issue issue42050. Feel free to add to the discussion there. -- nosy: +ned.deily resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> ensurepip fails if cwd conta

[issue42979] _zoneinfo: zoneinfomodule_exec() doesn't check for PyDateTime_IMPORT failure

2021-01-27 Thread Mark Shannon
Mark Shannon added the comment: New changeset c9b8e9c421b57acdcaf24fab0c93bc29b3ef7c67 by Victor Stinner in branch 'master': bpo-42979: Enhance abstract.c assertions checking slot result (GH-24352) https://github.com/python/cpython/commit/c9b8e9c421b57acdcaf24fab0c93bc29b3ef7c67 --

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Anthony Sottile
Anthony Sottile added the comment: I'm interested in it because the `tokenize` module is painfully slow -- ___ Python tracker ___ __

[issue42628] binascii doesn't work on some base64

2021-01-27 Thread Ammar Askar
Ammar Askar added the comment: It seems to me that your commands are just sequenced wrong, in Python you're performing (examples in parens): * base64 (ue==) -> decode to binary (0xB9) * binary (0xB9) -> encode to base64 (uQ==) whereas in your command line commands you're doing: * base64 (ue

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > I'm interested in it because the `tokenize` module is painfully slow I assumed, but I don't feel confortable exposing the built-in one. -- ___ Python tracker __

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > I assumed, but I don't feel confortable exposing the built-in one. As an example of the situation, I want to avoid: every time we change anything in the AST because of internal details we have many complains and pressure from tool authors because th

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Anthony Sottile
Anthony Sottile added the comment: you already have that right now because the `tokenize` module is exposed. (except that every change to the tokenization requires it to be implemented once in C and once in python) it's much more frustrating when the two differ as well I don't think all the

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: For reimplementing Lib/tokenize.py we don't need to publicly expose anything in the C-API. We can have a private _tokenize module with uses whatever you need and then you use that _tokenize module in the tokenize.py file to reimplement the exact Pytho

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Anthony Sottile
Anthony Sottile added the comment: private api sounds fine too -- I thought it was necessary to implement the module (as it needs external linkage) but if it isn't then even better -- ___ Python tracker

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > private api sounds fine too -- I thought it was necessary to implement the > module (as it needs external linkage) but if it isn't then even better We can make it builtin the same way we do for the _ast module, or we can have a new module under Modu

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Anthony Sottile
Anthony Sottile added the comment: Either works for me, would you be able to point me to the starting bits as to how `_ast` becomes builtin? -- ___ Python tracker ___

[issue43036] TOS-behaviour documentation is inconsistent

2021-01-27 Thread Xavier Morel
Change by Xavier Morel : -- title: TOS-behaviour documentation is -> TOS-behaviour documentation is inconsistent ___ Python tracker ___ ___

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > Either works for me, would you be able to point me to the starting bits as to > how `_ast` becomes builtin? https://github.com/python/cpython/blob/master/Python/Python-ast.c#L10075-L10079 and https://github.com/python/cpython/blob/63298930fb531b

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Anthony Sottile
Anthony Sottile added the comment: I haven't looked into or thought about that yet, it might not be possible It might also make sense to build new tokenize.py apis avoiding the `readline()` api -- I always found it painful to work with -- ___ Pyth

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > It might also make sense to build new tokenize.py apis avoiding the > `readline()` api -- I always found it painful to work with Then we would need to maintain the old Python APIs + the new ones using the module? What you are proposing seems more th

[issue43042] tutorial ambiguous about creation of local symbol table for recursive calls

2021-01-27 Thread Jesse Silverman
New submission from Jesse Silverman : In section 4.6 of the tutorial, we find: "When a function calls another function, a new local symbol table is created for that call." Now, perhaps because we were just looking at a function that people will often ask you to write both recursively and non

[issue22401] argparse: 'resolve' conflict handler damages the actions of the parent parser

2021-01-27 Thread Kuang-che Wu
Change by Kuang-che Wu : -- nosy: +kcwu ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.o

[issue2824] zipfile to handle duplicate files in archive

2021-01-27 Thread Jerry Heiselman
Jerry Heiselman added the comment: This just bit us too. I don't feel like a warning is enough. In our case, we want to prevent it from happening to begin with so that a developer who isn't expecting this doesn't have to know ahead of time to check for a file. Once a duplicate is in the zip

[issue2824] zipfile to handle duplicate files in archive

2021-01-27 Thread Jerry Heiselman
Jerry Heiselman added the comment: Further, some tools like zipgrep, seem to iterate over the toc in the zipfile and end up running the grep part once per entry leading to some duplication of data returned without it being obvious that there wasn't actually duplicate data in the zip archive.

[issue43037] Importlib reload by module name (String)

2021-01-27 Thread Brett Cannon
Brett Cannon added the comment: Thanks for the idea, Stefan, but I'm going to close this as something we don't want to do. `importlib.reload()` purposefully takes a module object as that's what is going to get mutated/changed and it must already exist. The other importlib functions take a st

[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-27 Thread Glenn Linderman
Glenn Linderman added the comment: Yes I think this is a useful enabling step toward enhanced functionality, as is. But I think the learning curve to achieve the enhanced functionality is a bit high for most people, as it requires too much knowledge of argparse internals, so I really look fo

[issue43037] Importlib reload by module name (String)

2021-01-27 Thread Stefan Mosoi
Stefan Mosoi added the comment: I understand. I was using to reload some classes that might have changed/added (updates and stuff) without having to reload the hole project. There might be some other ways (i found this, and didn't keep researching after). The documentation didn't warned / in

[issue38307] Provide Class' end line in pyclbr module

2021-01-27 Thread Aviral Srivastava
Aviral Srivastava added the comment: I have made the changes and tested, my builds were successful. Please review it? CC @brandtbucher, @steven.daprano -- ___ Python tracker __

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I have built a draft of how the changes required to make what you describe, in case you want to finish them: https://github.com/pablogsal/cpython/tree/tokenizer_mod -- ___ Python tracker

[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-27 Thread paul j3
paul j3 added the comment: So in the big picture, the purpose of this change is to treat the inputs like a kind of state-machine. In the bigger example, the `**` positional values are processed one by one, using the interspersed optionals to set state parameters. `args.sources` then ends up

[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-27 Thread paul j3
paul j3 added the comment: Sometimes patches have unforeseen benefits. My earlier patch for this issue, parse_intermixed_args, has been useful beyond the OP's case. https://stackoverflow.com/questions/50916124/allow-positional-command-line-arguments-with-nargs-to-be-seperated-by-a-flag http

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Problems that you are going to find: * The c tokenizer throws syntax errors while the tokenizer module does not. For example: ❯ python -c "1_" File "", line 1 1_ ^ SyntaxError: invalid decimal literal ❯ python -m tokenize <<< "1_" 1,0-1,1:

[issue41282] Deprecate and remove distutils

2021-01-27 Thread Steve Dower
Change by Steve Dower : -- pull_requests: +23178 pull_request: https://github.com/python/cpython/pull/24355 ___ Python tracker ___ _

[issue41282] Deprecate and remove distutils

2021-01-27 Thread Steve Dower
Steve Dower added the comment: That PR is just to add the import warning and update docs. I want to make sure that's in asap so we don't miss the release. Is there anywhere else in the docs that needs a note? Distutils has been marked as deprecated for years already, so it's really just emph

[issue43043] Python tutorial could make rules for default argument definition clearer

2021-01-27 Thread Jesse Silverman
New submission from Jesse Silverman : I love the tutorial, but have been pointing out things I only knew from brutal experience, other tutorials, reasoning from other languages I know better, or looking things up. I only mention them if they seem in scope and at the same level of the materia

[issue38307] Add .end_lineno attribute to pyclbr _Objects

2021-01-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: The answer, Aviral discovered, is that current ast nodes have end_lineno attributes, so the patch amounts to consistently copying them. I don't understand Aviral's use case either, but an item on my IDLE wish list is to be able to move class and function de

[issue43040] random.py randrange() is very slow if the range is a power of 2.

2021-01-27 Thread Donovan Baarda
Donovan Baarda added the comment: FTR, more articles about the slowness of generating random integers in Python; https://lemire.me/blog/2016/03/21/ranged-random-number-generation-is-slow-in-python/ https://www.reddit.com/r/Python/comments/jn0bb/randomrandint_vs_randomrandom_why_is_one_15x/ -

[issue38307] Add .end_lineno attribute to pyclbr _Objects

2021-01-27 Thread Aviral Srivastava
Aviral Srivastava added the comment: Hey Terry, thanks for commenting. I have a few questions to ask you, please pardon my lack of awareness. >This requieres end lines and having it be an attribute is easier and more >accurate than recalculating it. How do you recalculate the end_lineno?

[issue42955] Add sys.stdlib_module_names: list of stdlib module names (Python and extension modules)

2021-01-27 Thread STINNER Victor
STINNER Victor added the comment: New changeset 64fc105b2d2faaeadd1026d2417b83915af6622f by Victor Stinner in branch 'master': bpo-42955: Remove sub-packages from sys.stdlib_module_names (GH-24353) https://github.com/python/cpython/commit/64fc105b2d2faaeadd1026d2417b83915af6622f --

[issue36379] nb_inplace_pow is always called with an invalid argument

2021-01-27 Thread Gregory P. Smith
Gregory P. Smith added the comment: I'm pretty sure this is fixed for 3.8+. whether or not it should be considered a bugfix and backported to 3.7.x is probably too late at this point in release lifecycles anyways. thanks for raising this and the fixing PR! -- nosy: +gregory.p.smith

[issue38307] Add .end_lineno attribute to pyclbr _Objects

2021-01-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: If IDLE were to recalculate the end from start, it would have to more or less parse forward to find the end of the statement. This is why I considered it a speculative wish. > would `end_lineno=None` make any sense? Only as a kludge if a default were requ

[issue43040] random.py randrange() is very slow if the range is a power of 2.

2021-01-27 Thread Donovan Baarda
Donovan Baarda added the comment: I had a look at the C implementation of getrandbits() and spotted this; https://github.com/python/cpython/blob/64fc105b2d2faaeadd1026d2417b83915af6622f/Modules/_randommodule.c#L487 In my case I was also being hit by randrange(2**32) calling getrandbits(33) j

[issue43044] Python 2.7 documentation links to 404 pages when the library was moved or renamed

2021-01-27 Thread Борис Верховский
New submission from Борис Верховский : 1. go to https://docs.python.org/2/library/stringio.html (note the "/2/") 2. click on "You should upgrade and read the Python documentation for the current stable release." at the top I expect to be sent to the Python 3 documentation for StringIO (or at le

[issue43044] Python 2.7 documentation links to 404 pages when the library was moved or renamed

2021-01-27 Thread STINNER Victor
STINNER Victor added the comment: The Python 2.7 branch has been removed: https://github.com/python/cpython/pull/24195#issuecomment-768474389 I close the issue. Please use the Python 3 documentation. -- nosy: +vstinner resolution: -> out of date stage: -> resolved status: open -> c

[issue43045] Instructions for installing pip on Ubuntu/WSL2 is incomplete

2021-01-27 Thread Lennart Borgman
New submission from Lennart Borgman : Please see here for details: https://stackoverflow.com/questions/65928875/no-module-named-pip-python-3-9/65929009#65929009 -- messages: 385823 nosy: lennart.borgman priority: normal severity: normal status: open title: Instructions for installing p

[issue43046] argparse: capturing actions

2021-01-27 Thread Tadek Kijkowski
New submission from Tadek Kijkowski : This is spinoff from issue42973. The purpose of this issue is to provide set of additional action classes for argparse, that could capture mutual relationship between command line arguments for more advanced parsers, where order of command line arguments

[issue43046] argparse: capturing actions

2021-01-27 Thread Tadek Kijkowski
Change by Tadek Kijkowski : -- nosy: +paul.j3, r.david.murray, rhettinger, v+python ___ Python tracker ___ ___ Python-bugs-list mail

[issue42979] _zoneinfo: zoneinfomodule_exec() doesn't check for PyDateTime_IMPORT failure

2021-01-27 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23180 pull_request: https://github.com/python/cpython/pull/24356 ___ Python tracker ___ __

[issue43046] argparse: capturing actions

2021-01-27 Thread Tadek Kijkowski
Change by Tadek Kijkowski : -- keywords: +patch pull_requests: +23181 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24357 ___ Python tracker ___

[issue43047] logging.config formatters documentation is out of sync with code

2021-01-27 Thread Ian Wienand
New submission from Ian Wienand : The dict based configuration does not mention the "class" option, and neither the ini-file or dict sections mention the style tag. -- components: Library (Lib) messages: 385825 nosy: iwienand priority: normal severity: normal status: open title: loggin

[issue43047] logging.config formatters documentation is out of sync with code

2021-01-27 Thread Ian Wienand
Change by Ian Wienand : -- keywords: +patch pull_requests: +23182 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24358 ___ Python tracker ___

[issue43046] argparse: capturing actions

2021-01-27 Thread Glenn Linderman
Glenn Linderman added the comment: I'm a little confused by the mention of the "key" keyword argument. I suspect that is an internal concept to argparse, possibly passed that way to internal methods, but on the add_argument interface, it doesn't exist... instead there is "name or flags" posi

[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-27 Thread Glenn Linderman
Glenn Linderman added the comment: paul j3 said: Given how different this is from the normal argparse parsing (and the POSIX parsing argparse seeks to emulate), I question the wisdom of adding this, in part or whole, to the stock distribution. It could certainly be published as a pypi. Th

[issue43048] Printing RecursionError results in RecursionError

2021-01-27 Thread Vladimir Feinberg
New submission from Vladimir Feinberg : Python's standard logger provides an exception() method, which is to be called from except blocks to log out exception traces by pulling from sys.exc_info(). Per https://github.com/python/cpython/blob/3.9/Lib/logging/__init__.py#L617 , logger.exception(

[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-27 Thread Tadek Kijkowski
Tadek Kijkowski added the comment: > So in the big picture, the purpose of this change is to treat the inputs like > a kind of state-machine. Not necessarily that. Simple parsers should be easy to write, complicated parsers should be _possible_ to write. Users should be able to do whatever t

[issue43049] Use io.IncrementalNewlineDecoder for doctest newline conversion

2021-01-27 Thread Peter Donis
New submission from Peter Donis : This is a follow-up to issue 1812: https://bugs.python.org/issue1812 It was suggested in the discussion on that issue that the newline conversion in doctest that was corrected in that issue could be done using already defined resources in the io module inste

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2021-01-27 Thread Peter Donis
Change by Peter Donis : -- pull_requests: +23184 pull_request: https://github.com/python/cpython/pull/24359 ___ Python tracker ___ __

  1   2   >