[issue39154] "utf8" not always a synonym for "utf-8" in lib2to3

2019-12-29 Thread Peter Ludemann
Peter Ludemann added the comment: To clarify and fix a typo ... lib2to3.pgen2.tokenize.detect_encoding checks for 'utf-8'(and 'utf_8') but not 'utf8' in various places. Similarly for 'latin-1' and 'latin1'. (The codecs documentation page allows 'utf8' and 'latin1' as codecs.) ['UTF-8' is

[issue39160] ./configure --help has inconsistencies in style

2019-12-29 Thread Ned Deily
Change by Ned Deily : -- nosy: +ned.deily ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22593] Automate update of doc references to UCD version when it changes.

2019-12-29 Thread Ned Deily
Change by Ned Deily : -- assignee: -> docs@python components: +Documentation nosy: +docs@python, mdk versions: +Python 3.9 -Python 3.5 ___ Python tracker ___

[issue39154] "utf8" not always a synonym for "utf-8" in lib2to3

2019-12-29 Thread Ned Deily
Change by Ned Deily : -- Removed message: https://bugs.python.org/msg358997 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue39154] "utf8" not always a synonym for "utf-8" in lib2to3

2019-12-29 Thread Ned Deily
Change by Ned Deily : -- Removed message: https://bugs.python.org/msg358994 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue38588] Use-after-free in dict/list

2019-12-29 Thread Inada Naoki
Inada Naoki added the comment: Would you benchmark the performance? How about calling Py_INCREF and Py_DECREF in PyObject_RichCompare or do_richcompare? It is safer than checking all caller of the PyObject_RichCompare and PyObject_RichCompareBool. And it would be faster when

[issue39141] IDLE Clear function returns 256 on Mac OS Catalina

2019-12-29 Thread Ned Deily
Change by Ned Deily : -- assignee: -> terry.reedy components: +IDLE ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39141] IDLE Clear function returns 256 on Mac OS Catalina

2019-12-29 Thread Ned Deily
Ned Deily added the comment: Unfortunately, this is not going to work as you expect because you are mixing commands for different windowing systems. The OS-level 'clear' command is used to clear a normal terminal window by issuing special character sequences to standard output that are

[issue39037] Fix the trial order of the __exit__ and __enter__ methods in the with statement documentation

2019-12-29 Thread miss-islington
miss-islington added the comment: New changeset cbfafa3e3625dae96ce392c88c793f8af55167bf by Miss Islington (bot) in branch '3.8': bpo-39037: Fix lookup order of magic methods in with statement documentation (GH-17608)

[issue39037] Fix the trial order of the __exit__ and __enter__ methods in the with statement documentation

2019-12-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +17187 pull_request: https://github.com/python/cpython/pull/17749 ___ Python tracker ___

[issue39037] Fix the trial order of the __exit__ and __enter__ methods in the with statement documentation

2019-12-29 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 226e6e7d4326cf91ef37e13528eb1f62de1bb832 by Nick Coghlan (Géry Ogam) in branch 'master': bpo-39037: Fix lookup order of magic methods in with statement documentation (GH-17608)

[issue39161] Py_NewInterpreter docs need updating for multi-phase initialization

2019-12-29 Thread Nick Coghlan
New submission from Nick Coghlan : The Py_NewInterpreter docs only cover the behaviour of extension modules that use single-phase initialization: https://docs.python.org/3/c-api/init.html#c.Py_NewInterpreter Multi-phase initialization allows each subinterpreter to get its own copy of

[issue39153] Clarify refcounting semantics of PyDict_SetItem[String]

2019-12-29 Thread Nick Coghlan
Nick Coghlan added the comment: Right, that's why I don't think the other "*SetItem*" operations should get a Sphinx note - just a sentence, as was already done for PySequence_SetItem. If it weren't for PyList_SetItem being different, none of the others would need the clarification at all.

[issue39160] ./configure --help has inconsistencies in style

2019-12-29 Thread anthony shaw
Change by anthony shaw : -- nosy: +twouters ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39160] ./configure --help has inconsistencies in style

2019-12-29 Thread anthony shaw
Change by anthony shaw : -- nosy: +anthonypjshaw ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22593] Automate update of doc references to UCD version when it changes.

2019-12-29 Thread Noah Massman-Hall
Noah Massman-Hall added the comment: I ended up doing exactly what I said would probably be needed, and wrote a small sphinx extension that handles this. I kept the same reST substitution syntax, but I'm parsing for '|ucd_version|' as the source files are read in and just replacing it with

[issue22593] Automate update of doc references to UCD version when it changes.

2019-12-29 Thread Noah Massman-Hall
Change by Noah Massman-Hall : -- pull_requests: +17186 pull_request: https://github.com/python/cpython/pull/17748 ___ Python tracker ___

[issue39160] ./configure --help has inconsistencies in style

2019-12-29 Thread anthony shaw
Change by anthony shaw : -- keywords: +patch pull_requests: +17185 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17747 ___ Python tracker ___

[issue39160] ./configure --help has inconsistencies in style

2019-12-29 Thread anthony shaw
anthony shaw added the comment: Updated version based on principles: - Should not specify --with(out) in help string - Sentences should start with lowercase (as autoconf generates the builtin string with lower case) - --with-xyx=VALUE will be described as "overriding" - --with-xyz will be

[issue39160] ./configure --help has inconsistencies in style

2019-12-29 Thread anthony shaw
anthony shaw added the comment: Current Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes]

[issue39160] ./configure --help has inconsistencies in style

2019-12-29 Thread anthony shaw
New submission from anthony shaw : I've noticed that ./configure --help is inconsistent. - The way default values are shared - The way enumerated - The verbs used (e.g. enable, set) - Some --with-xyx and some --with(out-xyz) - Some start with capitals, others don't Also, many of the flags

[issue39156] Break up COMPARE_OP into logically distinct operations.

2019-12-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Introducing new opcodes will complicate the compiler. And it will complicate opcode.py and peephole.c and anything else that touches the word codes. -- ___ Python tracker

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

2019-12-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: > set() is neither literal nor container display. Yes, that is obvious. However, we do support sets and set() is how make an empty set. It is weird to support sets but not empty sets, especially when it is so easy to do so safely. --

[issue39159] Ideas for making ast.literal_eval() usable

2019-12-29 Thread Raymond Hettinger
New submission from Raymond Hettinger : A primary goal for ast.literal_eval() is to "Safely evaluate an expression node or a string". In the context of a real application, we need to do several things to make it possible to fulfill its design goal: 1) We should document possible exceptions

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

2019-12-29 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +pablogsal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2019-12-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: set() is neither literal nor container display. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue39156] Break up COMPARE_OP into logically distinct operations.

2019-12-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Few years ago I experimented with a special opcode for exception matching. It could make the bytecode a tiny bit smaller and faster, but since catching an exception in Python is relatively expensive, it would not have significant performance benefit. As

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

2019-12-29 Thread Batuhan
Change by Batuhan : -- nosy: +BTaskaya type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2019-12-29 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch pull_requests: +17184 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17742 ___ Python tracker

[issue39153] Clarify refcounting semantics of PyDict_SetItem[String]

2019-12-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The documentation for PyList_SetItem is explicit because its behavior is an exception from common rule and differs from PyList_SET_ITEM, so both should be documented explicitly. -- nosy: +serhiy.storchaka ___

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

2019-12-29 Thread Raymond Hettinger
New submission from Raymond Hettinger : We already support sets but not empty sets. After the PR, this now works: >>> from ast import literal_eval >>> literal_eval('set()') set() If we wanted, it would be a simple matter to extend it frozensets: >>>

[issue39157] test_pidfd_send_signal can fail on some systems with PermissionError: [Errno 1] Operation not permitted

2019-12-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 8f0703ff92ed2d9ccd52d7e083c7bc26e732a428 by Pablo Galindo in branch 'master': bpo-39157: Skip test_pidfd_send_signal if the system does not have enough privileges to use pidfd (GH-17740)

[issue39156] Break up COMPARE_OP into logically distinct operations.

2019-12-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: When COMPARE_OP occurs in a loop, the dispatch tends to be branch predictable. So there may not be real-world performance benefit to splitting the opcodes. -- nosy: +rhettinger ___ Python tracker

[issue39157] test_pidfd_send_signal can fail on some systems with PermissionError: [Errno 1] Operation not permitted

2019-12-29 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +17183 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17740 ___ Python tracker

[issue39157] test_pidfd_send_signal can fail on some systems with PermissionError: [Errno 1] Operation not permitted

2019-12-29 Thread Pablo Galindo Salgado
New submission from Pablo Galindo Salgado : == FAIL: test_pidfd_send_signal (test.test_signal.PidfdSignalTest) -- Traceback (most recent call last): File

[issue39156] Break up COMPARE_OP into logically distinct operations.

2019-12-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I think is a good idea, being the only problem that I see that as the opcode targets are limited we would be burning 3 more. I specially like the proposal for JUMP_IF_NOT_EXC_MATCH as PyCmp_EXC_MATCH is only used in the code for the try-except and is

[issue39156] Break up COMPARE_OP into logically distinct operations.

2019-12-29 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +pablogsal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38870] Expose ast.unparse in the ast module

2019-12-29 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +17182 pull_request: https://github.com/python/cpython/pull/17739 ___ Python tracker ___

[issue39156] Break up COMPARE_OP into logically distinct operations.

2019-12-29 Thread Mark Shannon
New submission from Mark Shannon : Currently the COMPARE_OP instruction performs one of four different tasks. We should break it up into four different instructions, that each performs only one of those tasks. The four tasks are: Rich comparison (>, <, ==, !=, >=, <=) Identity comparison

[issue38870] Expose ast.unparse in the ast module

2019-12-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 23a226bf3ae7b462084e899d007d12d9fe398ac5 by Pablo Galindo in branch 'master': bpo-38870: Run always tests that heavily use grammar features in test_unparse (GH-17738)

[issue39114] Python 3.9.0a2 changed how finally/return is traced

2019-12-29 Thread Mark Shannon
Mark Shannon added the comment: With PR 17737 the bytecode is: 2 0 SETUP_FINALLY 16 (to 18) 3 2 POP_BLOCK 5 4 LOAD_GLOBAL 0 (a) 6 LOAD_METHOD 1 (append) 8 LOAD_CONST 1 (16)

[issue38870] Expose ast.unparse in the ast module

2019-12-29 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +17181 pull_request: https://github.com/python/cpython/pull/17738 ___ Python tracker ___

[issue39114] Python 3.9.0a2 changed how finally/return is traced

2019-12-29 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +17180 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17737 ___ Python tracker ___

[issue5851] Add a stream parameter to gc.set_debug

2019-12-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I am going to close this for now as per my last comment (I think gc callbacks are best suited for custom statistics and custom behaviour when emitting the statistics - and more importantly, safer -) but feel free to re-open if you still think we

[issue39114] Python 3.9.0a2 changed how finally/return is traced

2019-12-29 Thread Mark Shannon
Mark Shannon added the comment: Exammining the bytecode for: def finally_return(): try: return 14 finally: a.append(16) We have: 2 0 SETUP_FINALLY 16 (to 18) 3 2 POP_BLOCK 5 4 LOAD_GLOBAL 0 (a)

[issue39154] "utf8" not always a synonym for "utf-8" in lib2to3

2019-12-29 Thread Peter Ludemann
Peter Ludemann added the comment: (oops -- updated this bug instead of submitting a new one) See also https://bugs.python.org/issue39155 -- ___ Python tracker ___

[issue39155] "utf8-sig" missing from codecs (inconsistency)

2019-12-29 Thread Peter Ludemann
New submission from Peter Ludemann : In general, 'utf8' and 'utf-8' are interchangeable in the codecs (and in many parts of the Python library). However, 'utf8-sig' is missing ... and it happens to also be generated by lib2to3.tokenize.detect_encoding. >>> import codecs >>>

[issue39154] "utf8" not always a synonym for "utf-8" in lib2to3

2019-12-29 Thread Peter Ludemann
Peter Ludemann added the comment: lib2to3.tokenize should allow 'utf8' and 'utf-8' interchangeably, to be consistent with the rest of the Python library (I looked through the library source, and there seems to be no consistent preference, and also many (but not all) checks for 'utf-8' also

[issue39154] "utf8-sig" missing from codecs (inconsistency)

2019-12-29 Thread Peter Ludemann
New submission from Peter Ludemann : In general, 'utf8' and 'utf-8' are interchangeable in the codecs (and in many parts of the Python library). However, 'utf8-sig' is missing ... and it happens to also be generated by lib2to3.tokenize.detect_encoding. >>> import codecs >>>

[issue24174] Python crash on exit

2019-12-29 Thread SilentGhost
SilentGhost added the comment: Currently lollypop seems to be residing at https://gitlab.gnome.org/World/lollypop However, this issue is filled against a no longer supported version which along with many changes in the C code warrants out-of-date closure, I think. Cédric, please re-open this

[issue5851] Add a stream parameter to gc.set_debug

2019-12-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I am not convinced about this. One of the problems I dislike is that the gc will take permanent ownership of the file descriptor (so is basically leaked). Is also not clear how this will behave during the delicate stages of finalization (the stream

[issue39151] Simplify the deep-first-search of the assembler

2019-12-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > The code that orders blocks for output should not make assumptions about the > shape of the CFG, IMO. I very much agree with this but notice that technically this function is doing it already if I am not mistaken. Following the b_next pointers in

[issue24174] Python crash on exit

2019-12-29 Thread Batuhan
Batuhan added the comment: The link you gave is broken, can you give a simple code to reproduce the issue? -- nosy: +BTaskaya ___ Python tracker ___

[issue39151] Simplify the deep-first-search of the assembler

2019-12-29 Thread Mark Shannon
Mark Shannon added the comment: This seems correct, but your change assumes that there is no optimisation pass that reorders the blocks. While the is currently true, it might not be in future. The code that orders blocks for output should not make assumptions about the shape of the CFG,

[issue39153] Clarify refcounting semantics of PyDict_SetItem[String]

2019-12-29 Thread Nick Coghlan
Change by Nick Coghlan : -- assignee: -> docs@python components: +Documentation nosy: +docs@python stage: -> needs patch type: -> enhancement versions: +Python 3.8, Python 3.9 ___ Python tracker

[issue39153] Clarify refcounting semantics of PyDict_SetItem[String]

2019-12-29 Thread Nick Coghlan
New submission from Nick Coghlan : The documentation for PyList_SetItem is explicit that it steals a reference to the passed in value, and drops the reference for any existing entry: https://docs.python.org/3.3/c-api/list.html?highlight=m#PyList_SetItem The documentation for PyDict_SetItem

[issue39152] Faulty override of tkinter.Misc.configure in tkinter.ttk.Scale.configure

2019-12-29 Thread Giovanni Lombardo
New submission from Giovanni Lombardo : The issue arises by simply calling configure on the Scale widget of the themed tk (ttk) widgets set: ``` cursor = scale.configure('cursor')[-1] ``` The above casues the following error: ``` File "C:\Users\Giovanni\Tests\test_scale.py", line 604, in

[issue39145] Innocuous parent class changes multiple inheritance MRO

2019-12-29 Thread Mark Dickinson
Mark Dickinson added the comment: > You can close again if you feel this isn't a bug. Yep, it's still not a bug. As Steven said, Python is correctly (modulo undiscovered bugs) implementing the C3 algorithm, and the C3 algorithm does indeed fail in this case. -- nosy:

[issue38588] Use-after-free in dict/list

2019-12-29 Thread Dong-hee Na
Change by Dong-hee Na : -- keywords: +patch pull_requests: +17179 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17734 ___ Python tracker ___

[issue5851] Add a stream parameter to gc.set_debug

2019-12-29 Thread Batuhan
Batuhan added the comment: @nicdumz are you still interested in this issue? -- nosy: +BTaskaya ___ Python tracker ___ ___