bundles / IPython 9.17.0 / IPython / utils / _process_common / arg_split_with_quotes
function
IPython.utils._process_common:arg_split_with_quotes
Signature
def arg_split_with_quotes(commandline: str, strict: bool = True) → list[tuple[str, bool]]Summary
Split a command line and report which tokens were originally quoted.
Extended Summary
Returns a list of (token, was_quoted) pairs. token is the unquoted form, as shlex.split(posix=True) returns, and was_quoted is True if that token had any single- or double-quote characters in commandline.
Useful for callers like %run that want to honor shell quoting when deciding whether to apply further expansion (glob, tilde) to a token.
Detection is shlex-based on both passes so the quote semantics are the same on Posix and Windows. If strict is False, malformed input (e.g. an unbalanced quote) returns whatever was parsed so far instead of raising.
Aliases
IPython.utils._process_common.arg_split_with_quotes