Skip to content

IDLE: Run ... Customized strips backslashes from arguments #93016

Description

@davidyorke

PART 1/2

Actions
In editor, do "Run... Customized"
In text box, Paste or type a valid Windows path (e.g.: c:\Users, \\server\share)
Select "OK"

Expected response:
script receives argument as entered without modification just as it does when run on the command line (e.g.: python prog.py c:\users)

Actual response:
script receives argument with backslashes treated as escape characters (e.g.: c:users, \servershare)

Workaround:
argument is not altered if entered in quotes. This is not the same behavior as the command line where quotes are accepted as part of the argument.

Part 2/2

Actions
In editor, do "Run... Customized"

Expected response:
text box is populated with previous entry, a legal windows path (e.g. `c:\Users)

Actual response:
text box is populated with previous entry mangled as above surrounded by curly braces (e.g.: {c:users}, {\serverpath}). If workaround above is used, then the string is correct, but quotes are gone and curly braces are present (e.g.: {c:\users}, {\\server\share}

System information

Windows 10 Home x86-64 (21H1 build 19043.1706)
Idle version 3.10.4

Linked PRs

Activity

  1. serhiy-storchaka commented on Sep 16, 2026

    @serhiy-storchaka
    Member

    Both parts are fixed in #157635. On Windows, the arguments are now split by the same rules as python.exe splits the command line, so backslashes are literal, and quotes work as on the command line. The previous arguments are now displayed quoted and joined, so they can be edited and are parsed back to the same list.

  2. added 3 commits that reference this issue on Sep 24, 2026
  3. beta-tester commented on Sep 24, 2026

    @beta-tester

    is this the same issue?

    for the issue with “Run… Customized” i tried
    the simple test script:

    import sys; print(sys.argv[1:])

    at first “Run…Customized”, i typed in:

    xyz "C:\abcd feg\123.txt"

    at second “Run…Customized”, the previous entered text altered to:

    xyz {C:\abcd feg\123.txt}

    at third “Run…Customized”, the previous altered text altered to:

    xyz \{C:abcd feg123.txt\}

    at that point the text does not alter anymore.

    the script output of the runs above
    at first run:

    ['xyz', 'C:\\abcd feg\\123.txt']

    at second run:

    ['xyz', '{C:abcd', 'feg123.txt}']

    at third run:

    ['xyz', '{C:abcd', 'feg123.txt}']

    i am using Python IDLE 3.14.7 for windows / Python 3.14.7 with td/tk 9.0.4
    installed with winget install Python.Python.3.14 on windows 11 25h2

  4. dqqFA8995 commented on Sep 24, 2026

    @dqqFA8995
  5. serhiy-storchaka commented on Sep 24, 2026

    @serhiy-storchaka
    Member

    Yes, it is the same issue. It was fixed in #157635 after 3.14.7 was released; the fix will be in the next 3.14 and 3.13 bugfix releases.

  6. terryjreedy commented on Sep 27, 2026

    @terryjreedy
    Member

    3.15 backport must be generated after prior 3.15 backports are merged after 3.15 branch is unblocked.

  7. added a commit that references this issue on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-IDLEtype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions