[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-20 Thread Steven D'Aprano
Steven D'Aprano added the comment: By the way, it is almost always wrong to write "k for k in iterable" when you can just write "iterable" or "list(iterable)". Here are some micro-benchmarks: [steve ~]$ python3.9 -m timeit -s "from string import ascii_letters" "''.join(k for k in

[issue42691] macOS 11.1 + Homebrew 2.6.2 + Python 3.9.1 = "IDLE" crash

2020-12-20 Thread Пётр Сиренко
Пётр Сиренко added the comment: petr@air-anastasia ~ % python3 -c "import tkinter; tkinter.Tk()" macOS 11 or later required ! zsh: abort python3 -c "import tkinter; tkinter.Tk()" >>> tkinter.TclVersion 8.5 >>> tkinter.TkVersion 8.5 petr@air-anastasia ~ % brew install tcl-tk Updating

[issue15872] shutil.rmtree(..., ignore_errors=True) doesn't ignore all errors

2020-12-20 Thread miss-islington
miss-islington added the comment: New changeset 37a6d5f8027f969418fe53d0a73a21003a8e370d by Daniel Hahler in branch 'master': [WIP/RFC] bpo-15872: tests: remove oddity from test_rmtree_errors (GH-22967) https://github.com/python/cpython/commit/37a6d5f8027f969418fe53d0a73a21003a8e370d

[issue42698] Deadlock in pysqlite_connection_dealloc()

2020-12-20 Thread hydroflask
hydroflask added the comment: Another comment: if calling sqlite3_close() outside of GIL, then the associated SQL function destructors must take the GIL before calling Py_DECREF -- ___ Python tracker

[issue42691] macOS 11.1 + Homebrew 2.6.2 + Python 3.9.1 = "IDLE" crash

2020-12-20 Thread Ned Deily
Ned Deily added the comment: This is the same sort of crash of a Homebrew Python as reported in Issue42480 and the root cause is the same: the Homebrew recipe is allowing building and linking with the known faulty and deprecated Apple-provided system Tcl and Tk 8.5.9 frameworks. It needs to

[issue42480] Python Tkinter crashes on macOS 11.1 beta

2020-12-20 Thread Ned Deily
Ned Deily added the comment: @fxcoudert: If you are trying to link with the Apple-provided system Tcl and Tk frameworks, don't. They have been seriously broken since macOS 10.7 and stuck at Tk 8.5.9. The only visible Apple action has been to deprecate them. Any Python on macOS that claims

[issue42696] Duplicated unused bytecodes at end of function

2020-12-20 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sorry Samuel, but this would be a performance degradation. The reason is that the algorithm of str.join makes two passes over the input, so it runs faster when the input is already a list; otherwise, it would have to do the additional work of creating a

[issue42697] 3.8.7rc1 regression: 'free(): invalid pointer' after running backports-zoneinfo test suite

2020-12-20 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- assignee: -> pablogsal priority: release blocker -> resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-20 Thread Ken Jin
Ken Jin added the comment: Sorry for intruding, but I thought I'd offer some rudimentary, non-scientific benchmarks for this: [MSC v.1928 32 bit (Intel)] on win32 # a debug build of python, no compiler optimizations import timeit # gen comp timeit.timeit("''.join(str(_) for _ in

Re: list() strange behaviour

2020-12-20 Thread Cameron Simpson
On 21Dec2020 08:09, Cameron Simpson wrote: >>b = ((x[0] for x in a)) > >This is a generator comprehension, and _not_ a list. I should amend this: a "generator _expression_", not comprehension. A "generator comprehension" is not a thing. Apologies, Cameron Simpson --

[issue42697] 3.8.7rc1 regression: 'free(): invalid pointer' after running backports-zoneinfo test suite

2020-12-20 Thread Brandt Bucher
Brandt Bucher added the comment: Almost certain. The number one is offset 192 bytes in small_ints on 3.8, which matches both of your backtraces: >>> id(1) - id(-5) >>>

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread 2QdxY4RzWzUUiLuE
On 2020-12-20 at 21:46:48 -0500, Avi Gross via Python-list wrote: [...] > I would say it is a more laudable goal for each function to publish > what interrupts they do NOT handle that might come through and perhaps > why ... I'm not disagreeing. Documenting important decisions and the reasons

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: This is a pessimization given the current implementation of str.join; it calls PySequence_Fast as the very first step, which is effectively free for a tuple or list input (just reference count manipulation), but must convert a generator expression to a list

RE: How do you find what exceptions a class can throw?

2020-12-20 Thread Avi Gross via Python-list
The original question sounded like someone was asking what errors might be thrown for a routine they wrote that used other components that might directly throw exceptions or called yet others, ad nauseum. Some have questioned the purpose. I can well imagine that if such info was available, you

[issue42700] xml.parsers.expat.errors description of codes/messages is flipped

2020-12-20 Thread Michael Wayne Goodman
Change by Michael Wayne Goodman : -- keywords: +patch pull_requests: +22738 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23876 ___ Python tracker

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Chris Angelico
On Mon, Dec 21, 2020 at 1:11 PM Julio Di Egidio wrote: > > Gathering evidence is indeed part of science, and computer science is > > indeed mathematics, but alas programmering is just a craft and software > > engineering often ... isn't. > > Programming is a *discipline* It's a discipline, a

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Ethan Furman
On 12/20/20 6:06 PM, Julio Di Egidio wrote: You could have taken the chance to pay attention Programming is a *discipline*, while you keep echoing cheap and vile marketing nonsense. I am sure you do, rigour mortis eventually... Mean-spirited and hostile messages are not welcome on this

[issue42698] Deadlock in pysqlite_connection_dealloc()

2020-12-20 Thread hydroflask
hydroflask added the comment: Nevermind it seems that it's legal to call Py_BEGIN_ALLOW_THREADS in tp_dealloc. The fix is then to allow threads around sqlite3_close(). -- ___ Python tracker

[issue42700] xml.parsers.expat.errors description of codes/messages is flipped

2020-12-20 Thread Michael Wayne Goodman
New submission from Michael Wayne Goodman : The documentation for xml.parsers.expat.errors.codes says: A dictionary mapping numeric error codes to their string descriptions. But this is backwards. It should say it maps the string descriptions to the error codes. Likewise, the docs for

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Julio Di Egidio
On Sunday, 20 December 2020 at 23:16:10 UTC+1, cameron...@gmail.com wrote: > On 20Dec2020 20:34, Karsten Hilbert wrote: > >> Trust me: it takes 100x getting anything done plus keep up with your > >> prayers, and it takes 100^100x learning anything solid, as in just forget > >> about it.

[issue42697] 3.8.7rc1 regression: 'free(): invalid pointer' after running backports-zoneinfo test suite

2020-12-20 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I am quite sure that is the problem. I opened https://github.com/pganssle/zoneinfo/pull/97 to correct this in the backport. The standard library versions are ok. Brandt, if you agree that this is indeed the problem, let's close this as "not a bug".

[issue42697] 3.8.7rc1 regression: 'free(): invalid pointer' after running backports-zoneinfo test suite

2020-12-20 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +p-ganssle ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42697] 3.8.7rc1 regression: 'free(): invalid pointer' after running backports-zoneinfo test suite

2020-12-20 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Oh, wait. This looks incorrect: https://github.com/pganssle/zoneinfo/blob/07ec80ad5dc7e7e4b4f861ddbb61a9b71e9f27c7/lib/zoneinfo_module.c#L619-L621 That #ifndef ATLEAST_37 should be #ifdef ATLEAST_37 --

[issue42697] 3.8.7rc1 regression: 'free(): invalid pointer' after running backports-zoneinfo test suite

2020-12-20 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: The version in 3.9 is also different but also uses _PyLong_One: https://github.com/python/cpython/blob/3.9/Modules/_zoneinfo.c#L571-L590 Although that is passed directly to PyDict_SetItemString so the refcount should be correct. --

[issue42697] 3.8.7rc1 regression: 'free(): invalid pointer' after running backports-zoneinfo test suite

2020-12-20 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Indeed. The module in the std lib is actually different: https://github.com/python/cpython/blob/master/Modules/_zoneinfo.c#L570-L589 and uses _PyLong_GetOne() instead of _PyLong_One -- ___ Python tracker

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-20 Thread Samuel Marks
Samuel Marks added the comment: @eric.smith No benchmarks offhand, but I'd expect it to be a very minor improvement (if detectable). If this gets accepted I'll probably do a bunch of little changes like this, to improve things, e.g., replace '%' with '.format' (or f-strings, whatever you

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-20 Thread Eric V. Smith
Eric V. Smith added the comment: Do you have any benchmarks to show this is an actual improvement? Often times it is not. -- nosy: +eric.smith ___ Python tracker ___

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-20 Thread Samuel Marks
New submission from Samuel Marks : This is an extremely minor improvement. Rather than create a `list`—using a comprehension—then have it consumed by `.join`, one can skip the list construction entirely. (I remember this working from at least Python 2.7… probably earlier also) --

[issue42697] 3.8.7rc1 regression: 'free(): invalid pointer' after running backports-zoneinfo test suite

2020-12-20 Thread Brandt Bucher
Brandt Bucher added the comment: On my phone right now, but this looks a tad suspicious: https://github.com/pganssle/zoneinfo/blob/07ec80ad5dc7e7e4b4f861ddbb61a9b71e9f27c7/lib/zoneinfo_module.c#L596-L600 -- ___ Python tracker

[issue42698] Deadlock in pysqlite_connection_dealloc()

2020-12-20 Thread hydroflask
hydroflask added the comment: This is also a problem in pysqlite_connection_close() as currently implemented. -- ___ Python tracker ___

[issue42698] Deadlock in pysqlite_connection_dealloc()

2020-12-20 Thread hydroflask
Change by hydroflask : -- components: +Extension Modules ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42698] Deadlock in pysqlite_connection_dealloc()

2020-12-20 Thread hydroflask
New submission from hydroflask : pysqlite_connection_dealloc() calls sqlite3_close{,_v2}(). This can cause a deadlock if sqlite3_close() tries to acquire a lock that another thread holds, due to a deadlock between the GIL and an internal sqlite3 lock. This is especially common with

[issue42697] 3.8.7rc1 regression: 'free(): invalid pointer' after running backports-zoneinfo test suite

2020-12-20 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: The symptom is that we are now trying to free something in the small integer cache that we shouldn't. Running this under the address sanitizer shows a bit more of the problem: ==190303==ERROR: AddressSanitizer: attempting free on address which was

[issue42697] 3.8.7rc1 regression: 'free(): invalid pointer' after running backports-zoneinfo test suite

2020-12-20 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Raising this to a release blocker -- priority: normal -> release blocker versions: +Python 3.10, Python 3.9 ___ Python tracker ___

[issue42697] 3.8.7rc1 regression: 'free(): invalid pointer' after running backports-zoneinfo test suite

2020-12-20 Thread Arfrever Frehtes Taifersar Arahesis
Change by Arfrever Frehtes Taifersar Arahesis : -- nosy: +brandtbucher, nascheme, pablogsal, tim.peters ___ Python tracker ___ ___

[issue42584] Upgrade macOS and Windows installers to use SQLite 3.34.0

2020-12-20 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: See attached proof-of-concept CI check. This GitHub Workflow extracts the SQLite version information, downloads the amalgamation source code, and does a simple `cmp` on each file. Example run:

[issue16535] json encoder unable to handle decimal

2020-12-20 Thread mike bayer
Change by mike bayer : -- nosy: +zzzeek ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31904] Python should support VxWorks RTOS

2020-12-20 Thread STINNER Victor
STINNER Victor added the comment: New changeset ab74c014ae514fde7487542ec96ef45235aa86b0 by pxinwr in branch 'master': bpo-31904: Fix site and sysconfig modules for VxWorks RTOS (GH-21821) https://github.com/python/cpython/commit/ab74c014ae514fde7487542ec96ef45235aa86b0 --

[issue42697] 3.8.7rc1 regression: 'free(): invalid pointer' after running backports-zoneinfo test suite

2020-12-20 Thread Michał Górny
Michał Górny added the comment: A more complete backtrace: #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49 #1 0x7fa633b20536 in __GI_abort () at abort.c:79 #2 0x7fa633b79bf7 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7fa633c8c3b5

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Cameron Simpson
On 20Dec2020 20:34, Karsten Hilbert wrote: >> Trust me: it takes 100x getting anything done plus keep up with your >> prayers, and it takes 100^100x learning anything solid, as in just forget >> about it. Indeed, consider that we are rather going to the formal >> verification of programs,

[issue42697] 3.8.7rc1 regression: 'free(): invalid pointer' after running backports-zoneinfo test suite

2020-12-20 Thread Michał Górny
Michał Górny added the comment: aeb66c1abbf4ec214e2e80eb972546996d1a1571 is the first bad commit commit aeb66c1abbf4ec214e2e80eb972546996d1a1571 Author: Miss Skeleton (bot) <31488909+miss-isling...@users.noreply.github.com> Date: Thu Oct 15 08:51:48 2020 -0700 bpo-41984: GC track all

[issue42697] 3.8.7rc1 regression: 'free(): invalid pointer' after running backports-zoneinfo test suite

2020-12-20 Thread Arfrever Frehtes Taifersar Arahesis
Change by Arfrever Frehtes Taifersar Arahesis : -- nosy: +lukasz.langa ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue42697] 3.8.7rc1 regression: 'free(): invalid pointer' after running backports-zoneinfo test suite

2020-12-20 Thread Michał Górny
New submission from Michał Górny : I'm still investigating the problem and I will include more information shortly. However, I'm filing the bug early, as I'd like to prevent this regression from hitting 3.8.7 release. When running backports-zoneinfo-0.2.1 test suite using cpython 3.8.7rc1,

[issue42695] tkinter keysym_num value is incorrect

2020-12-20 Thread Justin
Justin added the comment: TK bug ticket has been created at https://core.tcl-lang.org/tk/tktview/ffe6925b916caac02acae53f745e95dd1c557019 -- ___ Python tracker ___

[issue42680] unicode identifiers not accessible or assignable through globals()

2020-12-20 Thread Eric V. Smith
Eric V. Smith added the comment: I think documenting this with globals() and locals() is a good idea. That's the place this is most likely to trip someone up. -- nosy: +eric.smith ___ Python tracker

[issue42681] mistake in curses documentation

2020-12-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +22736 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23874 ___ Python tracker

[issue42695] tkinter keysym_num value is incorrect

2020-12-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Tkinter is just a wrapper around Tcl/Tk. Please report a bug in Tk on the corresponding bug tracker. https://wiki.tcl-lang.org/page/How+do+I+report+a+bug+in+Tcl%2C+Tk%2C+... -- nosy: +serhiy.storchaka resolution: -> third party stage: ->

[issue42696] Duplicated unused bytecodes at end of function

2020-12-20 Thread Ned Batchelder
New submission from Ned Batchelder : (Using CPython commit c95f8bc270.) This program has extra bytecodes: def f(): for i in range(10): break return 17 The dis output is: 1 0 LOAD_CONST 0 () 2 LOAD_CONST

[issue42693] "if 0:" lines are traced; they didn't use to be

2020-12-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: Confirmed. There is bogus NOP in the code. === Python 3.10.0a3+ (heads/master:17ef4319a3, Dec 18 2020, 09:35:26) [Clang 12.0.0 (clang-1200.0.32.28)] on darwin Type "help", "copyright",

[issue42695] tkinter keysym_num value is incorrect

2020-12-20 Thread Justin
New submission from Justin : Hi there. On my MacOS 10.14.16 laptop with a qwerty keyboard I was testing tkinter keyboard listening for an azerty keyboard layout by switching the layout to `French - PC` When I press qwerty keys Shift + \ I expect to see 'μ' printed. When looking at the tkinter

[issue42669] "except" documentation still suggests nested tuples are allowed

2020-12-20 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue42669] "except" documentation still suggests nested tuples are allowed

2020-12-20 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 81f706d2db0f57c4fdd747df6e0a4cffcbc54704 by Miss Islington (bot) in branch '3.8': bpo-42669: Document that `except` rejects nested tuples (GH-23822) (GH-23871) https://github.com/python/cpython/commit/81f706d2db0f57c4fdd747df6e0a4cffcbc54704

[issue42669] "except" documentation still suggests nested tuples are allowed

2020-12-20 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 409ce4a09e4f96ca9b251c19f5819205aae9ae34 by Miss Islington (bot) in branch '3.9': bpo-42669: Document that `except` rejects nested tuples (GH-23822) (GH-23870) https://github.com/python/cpython/commit/409ce4a09e4f96ca9b251c19f5819205aae9ae34

[issue42691] macOS 11.1 + Homebrew 2.6.2 + python 3.9.1 = idle crash

2020-12-20 Thread Пётр Сиренко
New submission from Пётр Сиренко : Process: Python [3355] Path: /usr/local/Cellar/python@3.9/3.9.1_1/IDLE 3.app/Contents/MacOS/Python Identifier:org.python.IDLE Version: 3.9.1 (3.9.1) Code Type: X86-64 (Native) Parent Process:

Re: list() strange behaviour

2020-12-20 Thread Cameron Simpson
On 20Dec2020 21:00, danilob wrote: >I'm an absolute beginner in Python (and in English too ;-) Well your English is far better than my very poor second language. >Running this code: >-- ># Python 3.9.0 > >a = [[1, 2, 0, 3, 0], > [0, 4, 5, 0, 6], > [7, 0, 8, 0, 9], > [2,

[issue42693] "if 0:" lines are traced; they didn't use to be

2020-12-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: All NOP bytecodes should be removed. If any is left it is a regression. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-12-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: These changes introduced a regression in test_curses (see issue42694). And I afraid then introduced regressions in other modules for which there were not purposed tests. -- ___ Python tracker

[issue42694] Failed test_new_curses_panel in test_curses

2020-12-20 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : == FAIL: test_new_curses_panel (test.test_curses.TestCurses) -- Traceback (most recent call last): File

[issue42693] "if 0:" lines are traced; they didn't use to be

2020-12-20 Thread Ned Batchelder
New submission from Ned Batchelder : (Using CPython commit c95f8bc270.) This program has an "if 0:" line that becomes a NOP bytecode. It didn't used to in Python 3.9 print(1) if 0: # line 2 print(3) print(4) Using a simple trace program

Re: list() strange behaviour

2020-12-20 Thread Tim Chase
On 2020-12-20 21:00, danilob wrote: > b = ((x[0] for x in a)) here you create a generator > print(list(b)) > [1, 0, 7, 2, 0] and then you consume all the things it generates here which means that when you go to do this a second time > print(list(b)) the generator is already empty/exhausted so

[issue42691] macOS 11.1 + Homebrew 2.6.2 + Python 3.9.1 = "IDLE" crash

2020-12-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: This is a 'ancient, buggy tcl/tk 8.5.9 on OS11' issue, not an IDLE issue. Only 8.6.10 has a chance with OS11, and even that is a bit flakey. But I have no issues so far running 3.9.1 and IDLE with the Universal2 OS11 build from python.org on Mohave. What

[issue25478] Consider adding a normalize() method to collections.Counter()

2020-12-20 Thread Allen Downey
Allen Downey added the comment: This API would work well for my use cases. And looking back at previous comments in this thread, I think this proposal avoids the most objectionable pitfalls. -- nosy: +AllenDowney ___ Python tracker

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread 2QdxY4RzWzUUiLuE
On 2020-12-20 at 18:25:40 -, Grant Edwards wrote: > On 2020-12-20, 2qdxy4rzwzuui...@potatochowder.com > <2qdxy4rzwzuui...@potatochowder.com> wrote: > > Chris Green wrote: > > > >>> Ultimately, it is not possible to tell what exceptions > >>> a call might throw. > > While it may not

[issue42634] Incorrect line number in bytecode for try-except-finally

2020-12-20 Thread Ned Batchelder
Ned Batchelder added the comment: (Rather: line 8 isn't executed, and so should not be traced.) -- ___ Python tracker ___ ___

[issue42634] Incorrect line number in bytecode for try-except-finally

2020-12-20 Thread Ned Batchelder
Ned Batchelder added the comment: I checked on this with CPython commit c95f8bc270. The code above is fixed, but this code has a similar problem: a, b, c = 1, 1, 1 try: try: a = 4/0 # ZeroDivisionError except ValueError: b = 6 except IndexError: a

[issue25478] Consider adding a normalize() method to collections.Counter()

2020-12-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: Here's what I propose to add: def total(self): return sum(self.values()) def scaled_by(self, factor): return Counter({elem : count * factor for elem, count in self.items()}) def scaled_to(self, target_total=1.0): ratio

[issue42688] ctypes memory error on Apple Silicon with external libffi

2020-12-20 Thread Eli Rykoff
Eli Rykoff added the comment: Thanks for your quick feedback! I signed the CLA after submitting the PR, but I think it takes a bit of time to percolate through the system. As for the "why", until 3.9.1 conda-forge had been successfully using an external ffi (with 3.9.0 + osx-arm64 patches)

[issue18163] Add a 'key' attribute to KeyError

2020-12-20 Thread Stéphane Blondon
Stéphane Blondon added the comment: Orian: your patch formats the error message but the original suggested solution is to store the missing key in a new attribute. I don't know if you go in the good direction. Adding an attribute is also suggested by issue #614557. -- nosy:

list() strange behaviour

2020-12-20 Thread danilob
Hi, I'm an absolute beginner in Python (and in English too ;-) Running this code: -- # Python 3.9.0 a = [[1, 2, 0, 3, 0], [0, 4, 5, 0, 6], [7, 0, 8, 0, 9], [2, 3, 0, 0, 1], [0, 0, 1, 8, 0]] b = ((x[0] for x in a)) print(list(b)) print(list(b)) ---

[issue3722] print followed by exception eats print with doctest

2020-12-20 Thread Chris Withers
Change by Chris Withers : -- keywords: -easy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue3722] print followed by exception eats print with doctest

2020-12-20 Thread Chris Withers
Chris Withers added the comment: @iritkatriel - if Tim thinks this is hard, it probably is hard ;-) -- ___ Python tracker ___ ___

[issue39158] ast.literal_eval() doesn't support empty sets

2020-12-20 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker ___

[issue42640] tkinter throws exception when key is pressed

2020-12-20 Thread Justin
Justin added the comment: Thank you very much. I understand and just wanted to let you know. In brew I opened up this ticket(https://github.com/Homebrew/homebrew-core/issues/67327) with that team. -- ___ Python tracker

Aw: Re: Re: Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Karsten Hilbert
> Trust me: it takes 100x getting anything done plus keep up with your prayers, > and it takes 100^100x learning anything solid, as in just forget about it. > Indeed, consider that we are rather going to the formal verification of > programs, software, and even hardware... I sincerly wish you

[issue42650] Can people use dest=argparse.SUPPRESS in custom Action classes?

2020-12-20 Thread paul j3
paul j3 added the comment: I'd have to study the code (and docs), but I'm not sure setting the `dest` to 'SUPPRESS' does anything meaningful. default=argparse.SUPPRESS is useful, keeping the default out of the namespace. That argument appears only if the user has used the option. But

Re: Re: Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Julio Di Egidio
On Sunday, 20 December 2020 at 19:54:08 UTC+1, Karsten Hilbert wrote: > > > So what you are looking for is the form of a potential > > > "timeout exception" (say, exception name) ? > > > > > > Provoke one and have a look. > > > > > > Then catch what you saw. > > > >

[issue31861] add aiter() and anext() functions

2020-12-20 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: I don't have anything to add to this beside the name choice is safe and won't clash with anything (but honestly I would prefer it to be discussed on the ML before implementing something after 3 years). I checked a limited dataset to search for aiter and

[issue42640] tkinter throws exception when key is pressed

2020-12-20 Thread Ned Deily
Ned Deily added the comment: As explained above, this crash will happen with any Python that links to the deprecated Apple-supplied system Tk framework in macOS versions from macOS 10.7 to 11 Big Sur. If you want to use tkinter, you need to use a Python that links to a newer version of Tk.

[issue42572] Better path handling with argparse

2020-12-20 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue42572] Better path handling with argparse

2020-12-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 40b4c405f98f2d35835ef5d183f0327c0c55da6f by Miss Islington (bot) in branch '3.9': bpo-42572: Improve argparse docs for the type parameter. (GH-23849) (GH-23869)

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Grant Edwards
On 2020-12-20, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: > Chris Green wrote: > >>> Ultimately, it is not possible to tell what exceptions >>> a call might throw. While it may not be "ultimately possible", in practice it usually is. Most libarary

Aw: Re: Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Karsten Hilbert
> > So what you are looking for is the form of a potential > > "timeout exception" (say, exception name) ? > > > > Provoke one and have a look. > > > > Then catch what you saw. > > > > Programmers don't guess... I did not suggest

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Chris Green
Stefan Ram wrote: > Chris Green writes: > >So that, as is always advised, I can catch the specific exception > >being thrown! > > It usually is advisable to be more specific when catching > exceptions. The worst thing to do is surely a bare "except:" > which then ignores the exception. >

Re: Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Julio Di Egidio
On Sunday, 20 December 2020 at 19:35:21 UTC+1, Karsten Hilbert wrote: > > If it's a timeout exception I'm going to delay a little while and then > > try again. The timeout is probably because the server is busy. > > So what you are looking for is the form of a potential > "timeout exception"

Aw: Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Karsten Hilbert
> > Remember, you get reporting (a traceback) and program cleanup and exit > > for free. What will catching an exception *add* to the user experience? > > If it's a timeout exception I'm going to delay a little while and then > try again. The timeout is probably because the server is busy. So

[issue42692] Build fails on macOS when compiler doesn't define __has_builtin

2020-12-20 Thread Joshua Root
Change by Joshua Root : -- keywords: +patch pull_requests: +22735 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23873 ___ Python tracker ___

[issue42640] tkinter throws exception when key is pressed

2020-12-20 Thread Justin
Justin added the comment: FYI, I just brew installed python and with: ``` Python 3.9.1 (default, Dec 17 2020, 03:56:09) [Clang 11.0.0 (clang-1100.0.33.17)] on darwin ``` This issue still happens -- ___ Python tracker

[issue42589] doc: Wrong "from" keyword link in Exceptions doc

2020-12-20 Thread Stéphane Blondon
Change by Stéphane Blondon : -- keywords: +patch nosy: +sblondon nosy_count: 2.0 -> 3.0 pull_requests: +22734 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23872 ___ Python tracker

[issue42692] Build fails on macOS when compiler doesn't define __has_builtin

2020-12-20 Thread Joshua Root
New submission from Joshua Root : The line in posixmodule.c that checks for __builtin_available is rejected by compilers that don't have __has_builtin. The second check needs to be in a nested #if. -- components: Build, macOS messages: 383437 nosy: jmr, ned.deily, ronaldoussoren

[issue42691] macOS 11.1 + Homebrew 2.6.2 + Python 3.9.1 = "IDLE" crash

2020-12-20 Thread Пётр Сиренко
Change by Пётр Сиренко : -- title: macOS 11.1 + Homebrew 2.6.2 + python 3.9.1 = idle crash -> macOS 11.1 + Homebrew 2.6.2 + Python 3.9.1 = "IDLE" crash ___ Python tracker ___

[issue42669] "except" documentation still suggests nested tuples are allowed

2020-12-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +22733 pull_request: https://github.com/python/cpython/pull/23871 ___ Python tracker ___

[issue42669] "except" documentation still suggests nested tuples are allowed

2020-12-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +22732 pull_request: https://github.com/python/cpython/pull/23870 ___ Python tracker ___

[issue42669] "except" documentation still suggests nested tuples are allowed

2020-12-20 Thread miss-islington
miss-islington added the comment: New changeset c95f8bc2700b42f4568886505a819816c9b0ba28 by Colin Watson in branch 'master': bpo-42669: Document that `except` rejects nested tuples (GH-23822) https://github.com/python/cpython/commit/c95f8bc2700b42f4568886505a819816c9b0ba28 -- nosy:

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Chris Green
2qdxy4rzwzuui...@potatochowder.com wrote: > On 2020-12-20 at 16:02:53 +, > Regarding "Re: How do you find what exceptions a class can throw?," > Chris Green wrote: > > > Stefan Ram wrote: > > > Chris Green writes: > > > >I am using poplib.POP3_SSL() and I want to know what exceptions can

[issue42572] Better path handling with argparse

2020-12-20 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +22731 pull_request: https://github.com/python/cpython/pull/23869 ___ Python tracker

[issue42572] Better path handling with argparse

2020-12-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset b0398a4b7fb5743f6dbb72ac6b2926e0a0c11498 by Raymond Hettinger in branch 'master': bpo-42572: Improve argparse docs for the type parameter. (GH-23849) https://github.com/python/cpython/commit/b0398a4b7fb5743f6dbb72ac6b2926e0a0c11498

[issue42689] Installation

2020-12-20 Thread Josh Rosenberg
Change by Josh Rosenberg : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Julio Di Egidio
On Sunday, 20 December 2020 at 18:18:26 UTC+1, Chris Green wrote: > If I ignore the exception then the > program just exits, if I want the program to do something useful about > it (like try again) then I have to catch the specific exception as I > don't want to try again with other

[issue24792] zipimporter masks import errors

2020-12-20 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> fixed versions: -Python 3.8, Python 3.9 ___ Python tracker ___ ___ Python-bugs-list

  1   2   >