def escape_queue(s):
if isinstance(s, PosixPath):<EOL><INDENT>s = unicode_(s)<EOL><DEDENT>elif isinstance(s, bytes):<EOL><INDENT>s = s.decode('<STR_LIT:utf-8>')<EOL><DEDENT>if s.startswith('<STR_LIT>'):<EOL><INDENT>return '<STR_LIT>' + shell_escape(s[<NUM_LIT:2>:])<EOL><DEDENT>else:<EOL><INDENT>return shell_escape(s)<EOL><DEDENT>
Escapes the path to a queue, e.g. preserves ~ at the begining.