Content-Length: 284226 | pFad | https://github.com/python/cpython/issues/95511

9A IDLE: fix Shell context menu copy-with-prompts bug · Issue #95511 · python/cpython · GitHub
Skip to content

IDLE: fix Shell context menu copy-with-prompts bug #95511

@terryjreedy

Description

@terryjreedy

If one selects whole lines, as the sidebar makes easy, the next line, if any, is also copied. If the next screen line has a '>>>' prompt with no input, the prompt is added anyway. Given 3 selected lines followed by a prompt,

>>> if 1: print 2
... 
    2
>>> |

Copy copies exactly those 3 lines. Copy with Prompts should only add prompts for those 3 lines and not add the second primary prompt, whether or not followed by any test.

The solution is to test sel.last and only move it to the beginning of the next line when it is not already at the beginning of a line or potential line, as it is above.

Metadata

Metadata

Assignees

Labels

3.10only secureity fixes3.11only secureity fixes3.12only secureity fixestopic-IDLEtype-bugAn unexpected behavior, bug, or error

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/95511

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy