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)
| 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. |
no outgoing calls
no test coverage detected