Skip to content

bundle_paths._words swaps a backslash escape inside double quotes, which a shell keeps literal #773

Open

Description

@antonwolfy

_INNER_ESCAPE_RE in dokimi/dokimi/external/bundle_paths.py:80 swaps \;, \,, \' and \ inside a double-quoted string for the bare character. In a POSIX shell a backslash inside double quotes escapes only $, backtick, ", \ and newline, so the others keep it.

Repro: _words('cp "assets/a\\;b.svg" /tmp/out') returns ['cp', 'assets/a;b.svg', '/tmp/out'] (expected assets/a\\;b.svg); \, gives assets/a,b.svg. The word the path check looks up is then not the name the shell reads.

Fix: inside double quotes swap only \" (and \\), and pin it with a test of each name; the removed test case in #753 was the wrong name, not the right one.

Follow-up from the review of #753: #753 (comment)

Activity

  1. self-assigned this
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions