Skip to content

shelx should support dollar-single-quotes quoting #158811

Description

@calestyo

Feature or enhancement

Hey.

POSIX.1-2024 added dollar-single-quotes quoting to the Shell Command Language like e.g. $'a\nb' for

'a
b'

(using single-quotes quoting).

It would be nice if shlex and in particular shlex.quote would support this, especially as it allows to keep quoted strings in a single line and avoid other special characters (like HT) which might get lost in some circumstances (e.g. when copy and pasting such strings).

If implemented, the use of dollar-single-quotes quoting should probably be optional, defaulting to no use it. Especially as there are still POSIX "compliant" shells which do not support it yet.

Cheers,
Chris.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Activity

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

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions