MCPcopy Create free account
hub / github.com/apache/impala / _shlex_split

Method _shlex_split

shell/impala_shell/impala_shell.py:538–548  ·  view source on GitHub ↗

Reimplement shlex.split() so that escaped single quotes are actually escaped. shlex.split() only escapes double quotes by default. This method will throw a ValueError if an open quotation (either single or double) is found.

(self, line)

Source from the content-addressed store, hash-verified

536 return args.rstrip(ImpalaShell.CMD_DELIM)
537
538 def _shlex_split(self, line):
539 """Reimplement shlex.split() so that escaped single quotes
540 are actually escaped. shlex.split() only escapes double quotes
541 by default. This method will throw a ValueError if an open
542 quotation (either single or double) is found.
543 """
544 my_split = shlex.shlex(line, posix=True)
545 my_split.escapedquotes = '"\''
546 my_split.whitespace_split = True
547 my_split.commenters = ''
548 return list(my_split)
549
550 def _cmd_ends_with_delim(self, line):
551 """Check if the input command ends with a command delimiter.

Callers 1

_cmd_ends_with_delimMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected