[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-02 Thread STINNER Victor
STINNER Victor added the comment: > Another issue is that the GC doesn't prevent the crash. Would it be possible > to prevent the crash without changing the behavior (ex: still call weakref > callbacks)? Pablo opened bpo-38009 with a PR. I'm not sure if his PR is correct or not yet. ---

[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-02 Thread STINNER Victor
STINNER Victor added the comment: > Another issue is that the GC doesn't prevent the crash. Would it be possible > to prevent the crash without changing the behavior (ex: still call weakref > callbacks)? I discussed with Pablo and it doesn't seem possible to prevent to clear a function if i

[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-02 Thread STINNER Victor
STINNER Victor added the comment: This bug is quite complex. Let me try to explain it more simply. * Create an object A * Create a weak reference to A with a callback CB * A and CB are part of a reference cycle * Removing the last references to A and CB are not enough to destroy them * Trigger

[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-02 Thread STINNER Victor
STINNER Victor added the comment: > * A and CB are seen as unreachable by the GC Oh, that's not correct: * Only CB is seen as unreachable by the GC * The GC "clears" CB which makes CB inconsistent (tp_clear) * A is deleted indirectly * Deleting A calls CB through the weak reference to A The

[issue38009] Handle weakreference callbacks invoked indirectly in the middle of a gc collection

2019-09-02 Thread Christian Heimes
Change by Christian Heimes : -- nosy: +christian.heimes ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue37969] urllib.parse functions reporting false equivalent URIs

2019-09-02 Thread Géry
Géry added the comment: @nicktimko Thanks for the historical track. Here is a patch that solves this issue by updating the `urlsplit` and `urlunsplit` functions of the `urllib.parse` module to keep the '?' and '#' delimiters in URIs if present, even if their associated component is empty, as

[issue38013] AsyncGenerator breaks when not iterated fully with RuntimeError("can't send non-None value to a just-started coroutine")

2019-09-02 Thread Michael Yoo
New submission from Michael Yoo : Version: Python 3.7.3 When I run this code: import asyncio class TestAsyncGenerator: def __init__(self): pass async def aiter(self): yield 1 yield 2 async def main(): gen = TestAsyncGenerator() async for number in g

[issue24416] Have date.isocalendar() return a structseq instance

2019-09-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, most things in Python that return a structseq previously returned a tuple (for example, time.localtime() and sys.version_info). This is not an unprecedented upgrade to improve the repr and provide access by field name in addition to positional acces

[issue24416] Have date.isocalendar() return a structseq instance

2019-09-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: What IS unprecedented is having a C function bend over backwards to return an instance of collections.namedtuple(). The only case I know of is with functools.lru_cache() and it was done there because we didn't really have a choice -- there was a pre-exi

[issue36267] User input to argparse raises Index_Error: "-a=" on a 'store_true' action

2019-09-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, raising an uncaught exception isn't what we normally consider a "crash". We typically save that designation for segfaults. Ideally, a good patch/pr will also have tests. Also, given the rarity of the exception, I would be reserved about backporting

[issue36267] User input to argparse raises Index_Error: "-a=" on a 'store_true' action

2019-09-02 Thread hai shi
hai shi added the comment: Thanks, Raymond. This patch not a formal patch, just show what i want to do. if everything agree this behavior, I would add a normal PR. -- type: behavior -> crash ___ Python tracker

[issue38014] Python 3.7 does not compile

2019-09-02 Thread Daniel
New submission from Daniel : Hi, I use macOS Catalina 10.15. I use Xcode 10 and Xcode 11, but with that configuration, compiling Python 3.7.14 does not work for me. Any idea whats causing this issue? user@Users-MacBook-Pro Python-3.7.4 % ./configure --with-framework-name=python36 --with-univ

[issue36267] User input to argparse raises Index_Error: "-a=" on a 'store_true' action

2019-09-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: Why did you switch back to "crash"? -- ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue38015] inline function generates slightly inefficient machine code

2019-09-02 Thread Ma Lin
New submission from Ma Lin : Commit 5e63ab0 replaces macro with this inline function: static inline int is_small_int(long long ival) { return -NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS; } (by default, NSMALLNEGINTS is 5, NSMALLPOSINTS is 257) However, when invokin

[issue38014] Python 3.7 does not compile

2019-09-02 Thread Ned Deily
Ned Deily added the comment: When building a default 64-bit-only Python on current MacOS systems, don't use the --enable-universalsdk (and --with-universal-arch) options to ./configure since system header files are no longer installed in /usr/include. Be aware that you may have to supply som

[issue38015] inline function generates slightly inefficient machine code

2019-09-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: Do you see a way to salvage the commit? If not, I'm fine with reverting it. Its benefit was only aesthetic. -- assignee: -> rhettinger ___ Python tracker _

[issue37764] email.Message.as_string infinite loop

2019-09-02 Thread Ashwin Ramaswami
Change by Ashwin Ramaswami : -- pull_requests: +15321 pull_request: https://github.com/python/cpython/pull/15654 ___ Python tracker ___

[issue38015] inline function generates slightly inefficient machine code

2019-09-02 Thread Ma Lin
Ma Lin added the comment: There will always be a new commit, replacing with a macro version also looks good. I have no opinion, both are fine. -- ___ Python tracker ___

[issue37934] Docs: Clarify NotImplemented use cases

2019-09-02 Thread Kyle Stanley
Kyle Stanley added the comment: Thanks for the explanation. > Of course, you might argue that _once Python has NotImplemented_, it can be > used elsewhere - but as I said, I don't think it should be encouraged. Hmm, okay. My understanding of Raymond's explanation was more so "let's not enco

[issue21315] email._header_value_parser does not recognise in-line encoding changes

2019-09-02 Thread Ashwin Ramaswami
Change by Ashwin Ramaswami : -- pull_requests: +15322 pull_request: https://github.com/python/cpython/pull/15655 ___ Python tracker ___

[issue37934] Docs: Clarify NotImplemented use cases

2019-09-02 Thread Vedran Čačić
Vedran Čačić added the comment: Of course, languages evolve. Annotations were introduced just for function arguments, now we use them almost everywhere. Generators were simply loop managers, now they've blown up to complete asynchronous programming beasts. Ellipsis was introduced for easier s

[issue37980] regression when passing numpy bools to sorted(..., reverse=r)

2019-09-02 Thread Ralf Gommers
Change by Ralf Gommers : -- nosy: +ralf.gommers ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue38004] Duplicated sections in changelog

2019-09-02 Thread Ned Deily
Ned Deily added the comment: I'm not sure what happened here or why we haven't noticed it before. For example, it appears that the consolidated blurb file for the earliest example, 3.5.2rc1.rst, has not been modified since its original blurbification (in b902833f35efa1053f75d7b37769b27cb39e

[issue38004] Duplicated sections in changelog

2019-09-02 Thread Ned Deily
Ned Deily added the comment: Ah, some further insight: I realized that the original docset for 3.5.2 is available in the documentation archive. Comparing the (pre-blurb) changelog from the original release to its current state: https://docs.python.org/release/3.5.2/whatsnew/changelog.html#p

[issue36267] User input to argparse raises Index_Error: "-a=" on a 'store_true' action

2019-09-02 Thread hai shi
Change by hai shi : -- pull_requests: +15323 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/15656 ___ Python tracker ___ __

[issue37768] IDLE: Show help(object) output in a text viewer

2019-09-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: For myself, I only want this for 'large' outputs. I prefer something like the following left alone. >>> help('continue') The "continue" statement continue_stmt ::= "continue" "continue" may only occur syntactically nested in a "

[issue35771] IDLE: Fix tooltip Hovertiptest failure

2019-09-02 Thread miss-islington
Change by miss-islington : -- pull_requests: +15324 pull_request: https://github.com/python/cpython/pull/15657 ___ Python tracker ___ __

[issue35771] IDLE: Fix tooltip Hovertiptest failure

2019-09-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 132acaba5a7f01373ca624b1a5975b190fe866f5 by Terry Jan Reedy (Tal Einat) in branch 'master': bpo-35771: IDLE: Fix flaky tool-tip hover delay tests (GH-15634) https://github.com/python/cpython/commit/132acaba5a7f01373ca624b1a5975b190fe866f5

[issue35771] IDLE: Fix tooltip Hovertiptest failure

2019-09-02 Thread miss-islington
Change by miss-islington : -- pull_requests: +15325 pull_request: https://github.com/python/cpython/pull/15658 ___ Python tracker ___ __

[issue36267] User input to argparse raises Index_Error: "-a=" on a 'store_true' action

2019-09-02 Thread hai shi
hai shi added the comment: oh, sorry, pls ignore it. I misunderstand your opinion. -- type: crash -> behavior ___ Python tracker ___ __

[issue35771] IDLE: Fix tooltip Hovertiptest failure

2019-09-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: To decide whether I agree that a live delay test is needed would take time and energy currently better applied to other issues. Since the 2nd PR reduces net test time, and should be at least as good in avoiding spurious failures, I am merging it now. If I

[issue35771] IDLE: Fix tooltip Hovertiptest failure

2019-09-02 Thread miss-islington
miss-islington added the comment: New changeset 48058050cee5f6600150392100c162f223b4317f by Miss Islington (bot) in branch '3.7': bpo-35771: IDLE: Fix flaky tool-tip hover delay tests (GH-15634) https://github.com/python/cpython/commit/48058050cee5f6600150392100c162f223b4317f -- nos

[issue35771] IDLE: Fix tooltip Hovertiptest failure

2019-09-02 Thread miss-islington
miss-islington added the comment: New changeset 1c18aec3bb7d59061742854d3204439a5274e201 by Miss Islington (bot) in branch '3.8': bpo-35771: IDLE: Fix flaky tool-tip hover delay tests (GH-15634) https://github.com/python/cpython/commit/1c18aec3bb7d59061742854d3204439a5274e201 -- __

[issue37768] IDLE: Show help(object) output in a text viewer

2019-09-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: I should have said, 'who disable autosqueeze'. Anyway, an option to disable help autoview will make me more comfortable adding it. A similar change would be to add 'Squeeze & View' to the context menu. -- ___ Pyt

[issue35771] IDLE: Fix tooltip Hovertiptest failure

2019-09-02 Thread Terry J. Reedy
Change by Terry J. Reedy : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue38016] Results with re.sub and re.replace is giving different results

2019-09-02 Thread Mallinath Akkalkot
New submission from Mallinath Akkalkot : Issue is explained in the attached presentation for the below python script. # PYTHON script import re stringPassed = "START, 0.272342208623734, 0.122712611838329\nCIRCL, 0.2739, 0.1175, 0.2644, 0.1175\nCIRCL, 0.2644, 0.108, 0.2644, 0.1175\nLINE, 0.26

[issue38016] Results with re.sub and re.replace is giving different results

2019-09-02 Thread Mallinath Akkalkot
Change by Mallinath Akkalkot : Removed file: https://bugs.python.org/file48584/Bug_Description_Regular Expression.pptx ___ Python tracker ___ _

[issue38016] Results with re.sub and re.replace is giving different results

2019-09-02 Thread Mallinath Akkalkot
Change by Mallinath Akkalkot : Added file: https://bugs.python.org/file48585/Bug_Description_Regular Expression.pptx ___ Python tracker ___ ___

<    1   2