[issue41860] random.choices() raises "int too large" error while random.randint does not

2020-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is virtually a duplicate of issue40388. -- nosy: +mark.dickinson, rhettinger, serhiy.storchaka ___ Python tracker ___

[issue41859] Uncaught ValueError

2020-09-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: I presume that at some point you got a completion box. It disappeared with this traceback and when >>> appeared, you continued. What python binary? 3.8.5? 3.8.6? My diagnosis so far. __call__ is a method in CallWrapper. The wrapped func is multicall.hand

[issue41860] random.choices() raises "int too large" error while random.randint does not

2020-09-24 Thread Heng Sun
New submission from Heng Sun : If I run this one line of code: random.choices(range(2**100), k=5) I would get error: OverflowError: Python int too large to convert to C ssize_t But I can run equivalent line to achieve this without error: [random.randint(0, 2**100-1) for j in range(5)] With

[issue41859] Uncaught ValueError

2020-09-24 Thread Raymond Hettinger
New submission from Raymond Hettinger : I found this in today's long running shell session. The trigger event isn't known. Exception in Tkinter callback Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 1885

[issue41774] While removing element from list using for and remove(), which has same items output is not right

2020-09-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: Timings depend on multiple factors, including implementation (cpython versus pypy versus cython, etc) and complexity of the keep/discard decision. I said in the proposed text that a listcomp may be faster. I think that sufficient; anyone who cares can test

[issue41774] While removing element from list using for and remove(), which has same items output is not right

2020-09-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: Try running some timings. I suspect the genexp/iterator versions run more slowly. The speed of the slice replacement relies on knowing the size of the input. -- ___ Python tracker

[issue39107] Upgrade tcl/tk to 8.6.10 (Windows and maxOS)

2020-09-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: On Windows, tk Scale['from'] is no longer rounded, matching ttk.Scale. More details and conditional fix on the PR. -- versions: +Python 3.10 -Python 3.9 ___ Python tracker ___

[issue41850] inspect.py: access block stack

2020-09-24 Thread Dennis Sweeney
Dennis Sweeney added the comment: I believe the block stack is only for catching exceptions. Loops do not interact with the block stack. Only SETUP_FINALLY adds to the block stack: https://docs.python.org/3/library/dis.html#opcode-SETUP_FINALLY Meanwhile, loops and conditionals and the like

[issue41858] Fix incomplete line on optparse documentation

2020-09-24 Thread Emmanuel Arias
Change by Emmanuel Arias : -- keywords: +patch pull_requests: +21447 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22407 ___ Python tracker ___ _

[issue41858] Fix incomplete line on optparse documentation

2020-09-24 Thread Emmanuel Arias
New submission from Emmanuel Arias : This line seems to be incomplete. This fix come from the translation to spanish of @fjsevilla-dev on https://github.com/python/python-docs-es/pull/758/file. reading the proposal for the translate has sense add `the next lines`. -- assignee: docs@pyt

[issue41857] Document timeout arguments to poll() in select module

2020-09-24 Thread Zane Bitter
Change by Zane Bitter : -- keywords: +patch pull_requests: +21446 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22406 ___ Python tracker ___

[issue41857] Document timeout arguments to poll() in select module

2020-09-24 Thread Zane Bitter
New submission from Zane Bitter : The select.poll.poll() and select.devpoll.poll() methods don't have their timeout arguments documented in their docstrings. In both cases the argument is in milliseconds, whereas the timeout arguments to select.kqueue.control() and select.epoll.poll() are in

[issue39107] Upgrade tcl/tk to 8.6.10 (Windows and maxOS)

2020-09-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: The existing patch mostly changes '9' to '10', which cannot in itself cause the test failure. There must be a change in widget behavior. Either Serhiy or Mark Rosemen might do better at diagnosing the discrepancy and whether _tkinter.c, tkinter.__init__, o

[issue41774] While removing element from list using for and remove(), which has same items output is not right

2020-09-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: You are right; the replacement index I called 'j' is better buried as a C index or pointer within a slice replacement. In fact, a generator expression, if one has a keep expression, or a filter call, if one has filter function, work, without the intermediate

[issue41856] argparse: auto-generated synopsis omits REMAINDER argument

2020-09-24 Thread Reuben Thomas
Reuben Thomas added the comment: A workaround to help users for now is: >>> parser.add_argument('args', metavar='...', nargs=argparse.REMAINDER) as then at least the help entry corresponds to the synopsis: positional arguments: command ... And with a `help` string, this can be clarified

[issue41856] argparse: auto-generated synopsis omits REMAINDER argument

2020-09-24 Thread Reuben Thomas
New submission from Reuben Thomas : Consider the following example from the Python documentation: >>> parser = argparse.ArgumentParser(prog='PROG') >>> parser.add_argument('--foo') >>> parser.add_argument('command') >>> parser.add_argument('args', nargs=argparse.REMAINDER) Now show the help:

[issue24757] Installing Py on Windows: Need to restart or logout for path to be added

2020-09-24 Thread Eryk Sun
Eryk Sun added the comment: > We already update the current shell, so if you start a new > terminal/Powershell/cmd/etc. instance it should have the > updated variable. The installer broadcasts an "Environment" message to top-level windows. In practice, only Explorer listens for and reloads

[issue40813] Output SyntaxError is not defective

2020-09-24 Thread Irit Katriel
Irit Katriel added the comment: I don't think it's true that the lineno is correct when compiling a string (Remi's string is just too short): >>> try: ... compile('if __name__ == "__main__":\n print("hello world"\n x=5\n', '', 'exec') ... except SyntaxError as e: ... print("e.lin

[issue39107] Upgrade tcl/tk to 8.6.10 (Windows and maxOS)

2020-09-24 Thread Steve Dower
Steve Dower added the comment: (My PR is from a branch in the main repo, so if you want to just go in and fix it, feel free.) -- ___ Python tracker ___ __

[issue39107] Upgrade tcl/tk to 8.6.10 (Windows and maxOS)

2020-09-24 Thread Steve Dower
Steve Dower added the comment: I did a build for Windows and put up the PR taking it in and there seems to be one (related) test failure: == FAIL: test_from (tkinter.test.test_tkinter.test_widgets.ScaleTest) -

[issue41774] While removing element from list using for and remove(), which has same items output is not right

2020-09-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: > The usually recommended alternative is to make a new list of > things not deleted. But one can do this in-place by writing > the new list on top of the old by using a explicit second > index to move items just once. I don't think we should send users d

[issue39107] Upgrade tcl/tk to 8.6.10 (Windows and maxOS)

2020-09-24 Thread Steve Dower
Change by Steve Dower : -- pull_requests: +21445 pull_request: https://github.com/python/cpython/pull/22405 ___ Python tracker ___ _

[issue41849] Support reading long lines with io._WindowsConsoleIO

2020-09-24 Thread Eryk Sun
Eryk Sun added the comment: > The biggest risk here is that we have to emulate GNU readline for > compatibility, which severely limits the data that can be passed > through, and also forces multiple encoding/decoding passes. I'm not suggesting to disable the console's line-input and echo-in

[issue41855] FastPath.zip_children can give duplicate results on Python 3.8

2020-09-24 Thread Jason R. Coombs
Change by Jason R. Coombs : -- pull_requests: +21444 pull_request: https://github.com/python/cpython/pull/22404 ___ Python tracker ___ _

[issue41855] FastPath.zip_children can give duplicate results on Python 3.8

2020-09-24 Thread Jason R. Coombs
Change by Jason R. Coombs : -- keywords: +patch pull_requests: +21443 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22403 ___ Python tracker ___

[issue41492] Fix signing description for Windows release builds

2020-09-24 Thread Steve Dower
Change by Steve Dower : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue40458] test_bad_getattr crashes on APPX test

2020-09-24 Thread Steve Dower
Change by Steve Dower : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue39041] Support GitHub Actions in CI

2020-09-24 Thread Steve Dower
Change by Steve Dower : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue41855] FastPath.zip_children can give duplicate results on Python 3.8

2020-09-24 Thread Jason R. Coombs
Jason R. Coombs added the comment: The relevant commit is already present in importlib_metadata as [079ca1cb701a5f4aab0a9cb00b0782c7ea8fb70b](https://gitlab.com/python-devs/importlib_metadata/-/commit/079ca1cb701a5f4aab0a9cb00b0782c7ea8fb70b). -- components: +Library (Lib) __

[issue41855] FastPath.zip_children can give duplicate results on Python 3.8

2020-09-24 Thread Jason R. Coombs
New submission from Jason R. Coombs : Scott J. reports in an e-mail: When upgrading to Python 3.8.2, we noticed two issues in importlib.metadata which are not present in importlib_metadata. 1. FastPath.zip_children() is very slow for large zips. Python 3.8.3 > already has a fix for this

[issue41854] argparse.add_mutually_exclusive_group fails for optional positional arguments

2020-09-24 Thread Reuben Thomas
New submission from Reuben Thomas : The following code: group = parser.add_mutually_exclusive_group() group.add_argument('--install-only', action='store_true', help='just install the program, do not run it') group.add_argument('args', metavar='ARGUMENT', nargs='*', default=N

[issue41774] While removing element from list using for and remove(), which has same items output is not right

2020-09-24 Thread Terry J. Reedy
Change by Terry J. Reedy : -- keywords: +patch pull_requests: +21442 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/22402 ___ Python tracker __

[issue41775] IDLE: change Shell window title

2020-09-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: In the last few months, there has been an increase in bpo issues mis-tagged IDLE. Today's example: #41774 -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue41775] IDLE: change Shell window title

2020-09-24 Thread miss-islington
miss-islington added the comment: New changeset 18e59f587b86297d4fc99765be10d92a717d4775 by Miss Islington (bot) in branch '3.8': bpo-41775: Make 'IDLE Shell' the shell title (GH-22399) https://github.com/python/cpython/commit/18e59f587b86297d4fc99765be10d92a717d4775 -- __

[issue41775] IDLE: change Shell window title

2020-09-24 Thread miss-islington
miss-islington added the comment: New changeset 4080f12b17cee36732758912dc4346ec9361 by Miss Islington (bot) in branch '3.9': bpo-41775: Make 'IDLE Shell' the shell title (GH-22399) https://github.com/python/cpython/commit/4080f12b17cee36732758912dc4346ec9361 -- __

[issue41774] While removing element from list using for and remove(), which has same items output is not right

2020-09-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: I modeled the new entry on the previous one. The code and its test. def fr(n, remove): mylist = list(range(n)) for i in range(len(mylist)-1, -1, -1): if remove(mylist[i]): del mylist[i] return mylist def ff(n, keep): mylist

[issue41775] IDLE: change Shell window title

2020-09-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 05cc881cbcf5d73a312568c78c7149eae3195072 by Terry Jan Reedy in branch 'master': bpo-41775: Make 'IDLE Shell' the shell title (#22399) https://github.com/python/cpython/commit/05cc881cbcf5d73a312568c78c7149eae3195072 -- __

[issue41775] IDLE: change Shell window title

2020-09-24 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +21440 pull_request: https://github.com/python/cpython/pull/22400 ___ Python tracker _

[issue41775] IDLE: change Shell window title

2020-09-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +21441 pull_request: https://github.com/python/cpython/pull/22401 ___ Python tracker ___ __

[issue41775] IDLE: change Shell window title

2020-09-24 Thread Terry J. Reedy
Change by Terry J. Reedy : -- keywords: +patch pull_requests: +21439 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/22399 ___ Python tracker __

[issue41853] Windows docs for command line install don't mention /log option

2020-09-24 Thread Steve Dower
Steve Dower added the comment: Sounds good to me. Pull requests welcome :) -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue24757] Installing Py on Windows: Need to restart or logout for path to be added

2020-09-24 Thread Steve Dower
Steve Dower added the comment: Sorry, but we don't have any way to update the current terminal process. We already update the current shell, so if you start a new terminal/Powershell/cmd/etc. instance it should have the updated variable. The workaround you posted is fine. Directly adding th

[issue41852] Inconsistent errors for JSON-encoding NaNs with allow_nan=False

2020-09-24 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue41853] Windows docs for command line install don't mention /log option

2020-09-24 Thread Forrest Shields
New submission from Forrest Shields : Section "3.1.3. Installing Without UI" of the Windows documentation at https://docs.python.org/3/using/windows.html#installing-without-ui does not mention the existence of the `/log` option. However, this option is detailed when the Windows installer is e

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-24 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset ae462297c08515f2c0dacf77b04816504142ba3e by Thomas Grainger in branch '3.8': [3.8] bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module (GH-21956) (#22398) https://github.com/python/cpython/commit/ae462297c08515f2c0dacf77b

[issue41852] Inconsistent errors for JSON-encoding NaNs with allow_nan=False

2020-09-24 Thread Ben Kurtovic
New submission from Ben Kurtovic : json.dump vs. json.dumps have inconsistent error messages when encoding NaN with allow_nan=False: >>> json.dumps(float('nan'), allow_nan=False) ValueError: Out of range float values are not JSON compliant >>> json.dump(float('nan'), sys.stdout, allow_nan=Fals

[issue24757] Installing Py on Windows: Need to restart or logout for path to be added

2020-09-24 Thread Forrest Shields
Forrest Shields added the comment: As of 3.8.5 the current shell's PATH is outdated after a commandline system-wide installation. This makes it very difficult to do a scripted install of Python followed by the `python` or `pip` commands, as they will not be found. In addition to modifying t

[issue41849] Support reading long lines with io._WindowsConsoleIO

2020-09-24 Thread Steve Dower
Steve Dower added the comment: I'm in favour of this change in principle, but would want to look at the PR closely. The biggest risk here is that we have to emulate GNU readline for compatibility, which severely limits the data that can be passed through, and also forces multiple encoding/d

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-24 Thread Thomas Grainger
Change by Thomas Grainger : -- pull_requests: +21438 pull_request: https://github.com/python/cpython/pull/22398 ___ Python tracker ___ _

[issue41838] Value error is showing in docset python (class)

2020-09-24 Thread Eric V. Smith
Change by Eric V. Smith : -- status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue41739] test_logging: threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 2)

2020-09-24 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-24 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset ca8d46dd422e5aa10f444796d93faec5a8cbc1e0 by Łukasz Langa in branch '3.9': [3.9] bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module (GH-21956) (#22397) https://github.com/python/cpython/commit/ca8d46dd422e5aa10f444796d93f

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-24 Thread Łukasz Langa
Change by Łukasz Langa : -- nosy: +lukasz.langa nosy_count: 5.0 -> 6.0 pull_requests: +21437 pull_request: https://github.com/python/cpython/pull/22397 ___ Python tracker ___ __

[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-09-24 Thread Łukasz Langa
Change by Łukasz Langa : -- versions: +Python 3.10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue41851] tkinter: add font neg and equal methods

2020-09-24 Thread E. Paine
New submission from E. Paine : I think it would be helpful to add these methods to the tkinter font class. Starting with the equal method, I have found it very useful to be able to compare tkinter fonts based on their value rather than just name. I used this, for example, in #28694 to ensure

[issue41851] tkinter: add font neg and equal methods

2020-09-24 Thread E. Paine
Change by E. Paine : -- keywords: +patch pull_requests: +21436 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22396 ___ Python tracker ___ ___

[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2020-09-24 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +21435 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22395 ___ Python tracker ___ ___

[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2020-09-24 Thread Irit Katriel
Irit Katriel added the comment: On windows 10, master: > python.bat --version Running Release|Win32 interpreter... Python 3.10.0a0 >python.bat x.py Running Release|Win32 interpreter... SyntaxError: too many statically nested blocks That's when x.py has the nested for loops without else. The

[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2020-09-24 Thread Mark Shannon
Mark Shannon added the comment: iritkatriel What error do you see and on what version? -- ___ Python tracker ___ ___ Python-bugs-l

[issue28694] tkinter interface to fontchooser

2020-09-24 Thread E. Paine
E. Paine added the comment: I have started looking at Mark's wrapper (though I have not been able to ​spend as much time on it as I would like). It's mostly small changes ​that I have made (in no particular order): - TkFontchooserFontChanged event calls 'command' (to be behave like an 'apply' bu

[issue41849] Support reading long lines with io._WindowsConsoleIO

2020-09-24 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue41850] inspect.py: access block stack

2020-09-24 Thread Gregoire Chalony
New submission from Gregoire Chalony : The inspect module doesn't currently expose any way to access the block stack at runtime. Would that be possible? Aked on StackOverflow here: https://stackoverflow.com/questions/63187845/cpython-access-loop-depth-level-block-stack. -- messages:

[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2020-09-24 Thread Irit Katriel
Irit Katriel added the comment: Another oddity: This gives the error: for x in '1': for x in '2': for x in '3': for x in '4': for x in '5': for x in '6': for x in '8': for x in '9': for x in '10': for x in '11': for x in '12': f

[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2020-09-24 Thread Irit Katriel
Irit Katriel added the comment: Unlike the 22 nested while, if 1: if 2: ... if 22: pass doesn't error. Is that correct? -- ___ Python tracker ___ _

[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2020-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Humm, my supposition was not absolutely correct. The cause is that the compiler and the interpreter use the stack of size CO_MAXBLOCKS for different things. The interpreter pushes a thing for the "except" clause, while the compiler does not do it. ---

[issue40608] PY3.8 GC segfault (Py_TRASHCAN_SAFE_BEGIN/END are not backwards compatible)

2020-09-24 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I think that we should try to land PR 12607 first. -- ___ Python tracker ___ ___ Python-bu

[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2020-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is a bug. Compiler explicitly checks if the number of nested "try" blocks does not exceed the limit of CO_MAXBLOCKS, but it does not count implicit "try" blocks inserted when your assign an exception in the "except" clause. try: ... exce