We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd6916a commit 192329eCopy full SHA for 192329e
Lib/shlex.py
@@ -326,7 +326,8 @@ def quote(s):
326
safe_chars = (b'%+,-./0123456789:=@'
327
b'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'
328
b'abcdefghijklmnopqrstuvwxyz')
329
- if not s.encode().translate(None, delete=safe_chars):
+ # No quoting is needed if `s` is an ASCII string consisting only of `safe_chars`
330
+ if s.isascii() and not s.encode().translate(None, delete=safe_chars):
331
return s
332
333
# use single quotes, and put single quotes into double quotes
0 commit comments