[issue43048] Printing RecursionError results in RecursionError

2021-01-27 Thread Irit Katriel
Irit Katriel added the comment: This looks like a duplicate of issue 42848 which was fixed in 3.10. -- nosy: +iritkatriel ___ 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: Some points to note; I first noticed this as an apparently 5x performance regression for randrange() between pypy and pypy3. This seemed pretty significant, but admittedly the difference is largely masked by other python overheads when comparing python2

[issue43052] _dyld_shared_cache_contains_path needs SYSTEM_VERSION_COMPAT=0

2021-01-27 Thread Isuru Fernando
New submission from Isuru Fernando : In macOS Big Sur, if the executable was compiled with MACOSX_DEPLOYMENT_TARGET=10.15 or below, then SYSTEM_VERSION_COMPAT=1 is the default which means that Big Sur reports itself as 10.16 which in turn means that __builtin_available(macOS 11.0) will not be

[issue43025] Use normal 'i' character to denote imaginary part of complex numbers

2021-01-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: Unfortunately, this ship sailed a long time ago. Changing it now would create more problems that it solves. > I doubt that that will be enough to silence the repeated requests: > people are still going to complain that the value that was entered > as

[issue43046] argparse: capturing actions

2021-01-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Sounds like another wet blanket argpment Please watch your tone. It borders on being abusive. It is entirely appropriate to set limits on the scope of what a module is trying to achieve. It is appropriate to consider module learnability. It is

[issue36086] Split IDLE into separate feature in Windows installer

2021-01-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with the other commenters that this isn't worth it. Installing Tcl/Tk without IDLE saves almost nothing. Thank you for the suggestion, but I'm going to mark it as rejected. -- nosy: +rhettinger resolution: -> rejected stage: patch

[issue43034] Python tutorial misleads users about floor division behavior

2021-01-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: The first section of the tutorial isn't the right place to go into these details. The point of the section is to have a basic introduction to the interactive prompt. It is intensionally gentle and lightweight. It isn't the purpose of the tutorial to

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

2021-01-27 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2021-01-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: Donovan, if the speed of the power of two case is important to you, I recommend using getrandbits() instead. It is ten times faster. $ python3.9 -m timeit -r 11 -s 'from random import randrange, getrandbits' 'randrange(2**32)' 100 loops, best of

[issue43051] Pip Permissions Error overwriting pip directory

2021-01-27 Thread Charley Riley
New submission from Charley Riley : After installing Python 3.9.1 on Windows 10 system-wide to "C:\Program Files\Python39", I tried to pip install the package 'dirsearch'. pip refused with the error: "Defaulting to user installation because normal site-packages is not writeable", and

[issue43046] argparse: capturing actions

2021-01-27 Thread Glenn Linderman
Glenn Linderman added the comment: Raymond said: ISTM the scope of argparse was never intended to capture all possible patterns for command line argument parsing. Instead, it aimed at to address the common cases. I say: Sounds like another wet blanket argpment. Refer to the section "Why

[issue43046] argparse: capturing actions

2021-01-27 Thread Glenn Linderman
Glenn Linderman added the comment: So the missing signature is why I didn't understand, probably. At least, it seems reasonable to blame that :) You didn't include [version] in the signature, but that isn't your fault: it isn't in the original and should be (see action "version"). So key

[issue43046] argparse: capturing actions

2021-01-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: > capture mutual relationship between command line arguments for more > advanced parsers, where order of command line arguments is meaningful I don't think this is a pattern we should encourage. It doesn't seem to arise often and it makes the API much

[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-01-27 Thread Martin Panter
Change by Martin Panter : -- keywords: +3.7regression ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43050] threading timer memory leak

2021-01-27 Thread fengjiang
fengjiang added the comment: yes, I find similar issues,the use the patch(https://github.com/python/cpython/pull/15228/files) to fix the bug -- ___ Python tracker ___

[issue43050] threading timer memory leak

2021-01-27 Thread Martin Panter
Martin Panter added the comment: Perhaps this is caused by Issue 37788. Python 3.7.4 introduced a leak for any thread that doesn't get its "join" method called. Timer is a subclass of Thread, so to confirm, see if calling "timer.join()" after "cancel" will make the leak go away. --

[issue43049] Use io.IncrementalNewlineDecoder for doctest newline conversion

2021-01-27 Thread Zachary Ware
Change by Zachary Ware : -- nosy: +eric.araujo, zach.ware ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43046] argparse: capturing actions

2021-01-27 Thread Tadek Kijkowski
Tadek Kijkowski 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

[issue43050] threading timer memory leak

2021-01-27 Thread fengjiang
New submission from fengjiang : Hi,we are transfering code from python2.7 to 3.7 and find that using threading.timer will cause memory leak. It works fine in python2.7 but not 3.7. To repreduce the problem, you can simply run the code below. While True: timer = threading.Timer(5, None)

[issue43049] Use io.IncrementalNewlineDecoder for doctest newline conversion

2021-01-27 Thread Peter Donis
Change by Peter Donis : -- keywords: +patch pull_requests: +23183 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24359 ___ Python tracker ___

[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 ___

[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

[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

[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 ,

[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.

[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"

[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 ___

[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:

[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 ___

[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 : -- nosy: +paul.j3, r.david.murray, rhettinger, v+python ___ Python tracker ___ ___ Python-bugs-list

[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

[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

[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 ->

[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

[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)

[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

[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

[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 --

[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?

[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 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

[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

[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

[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 ___

[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:

[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

[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

[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

[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

[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 /

[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

[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

[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

[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

[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:

[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

[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

[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 -- ___

[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

[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 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 ___

[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

[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: 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

[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

[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

[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

[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

[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 ___

[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 --

[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

[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 ___

[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 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

[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:

[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:

[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

[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

[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

[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

[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()

[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,

[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

[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 ___

[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:

[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:

[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

[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:

[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

[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 -

[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

[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

[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

[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

[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 ___ ___

[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

[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

[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

[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 ___

  1   2   >