This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author georg.brandl
Recipients bgertzfield, eric.smith, georg.brandl, jjwiseman, r.david.murray, tim.peters
Date 2010-01-09.10:25:24
SpamBayes Score 1.7628141e-05
Marked as misclassified No
Message-id <1263032726.76.0.540199553315.issue7507@psf.upfronthosting.co.za>
In-reply-to
Content
I'm attaching a patch that changes quote() logic.  It also fixes #7476, the empty argument case.

Strings with unsafe characters are now always quoted with single quotes. Single quotes themselves are replaced by a single quote in double quotes, so that

    te$t'quoting

becomes

    'te$t'"'"'quoting'

which I believe is portable across all commonly used shells.

(Another implementation would be to just backslash-quote all unsafe chars, but it makes for less readable results.)

Assigning to David for review -- you recently claimed to like shells :)
History
Date User Action Args
2010-01-09 10:25:27georg.brandlsetrecipients: + georg.brandl, tim.peters, eric.smith, r.david.murray, jjwiseman, bgertzfield
2010-01-09 10:25:26georg.brandlsetmessageid: <1263032726.76.0.540199553315.issue7507@psf.upfronthosting.co.za>
2010-01-09 10:25:25georg.brandllinkissue7507 messages
2010-01-09 10:25:25georg.brandlcreate