Обычно этот метод отрезает все кавычки аргумента. Если в результате
получается абсолютный путь Normally, this method first strips any quotes off the argument. If the result
is an absolute pathname, or there was no previous source request in effect, or
the previous source was a stream (such as sys.stdin), the result is left
alone. Otherwise, if the result is a relative pathname, the directory part of
the name of the file immediately before it on the source inclusion stack is
prepended (this behavior is like the way the C preprocessor handles #include"file.h").

The result of the manipulations is treated as a filename, and returned as the
first component of the tuple, with open() called on it to yield the second
component. (Note: this is the reverse of the order of arguments in instance
initialization!)

This hook is exposed so that you can use it to implement directory search paths,
addition of file extensions, and other namespace hacks. There is no
corresponding ‘close’ hook, but a shlex instance will call the
close() method of the sourced input stream when it returns
EOF.

Push an input source stream onto the input stack. If the filename argument is
specified it will later be available for use in error messages. This is the
same method used internally by the sourcehook() method.

This method generates an error message leader in the format of a Unix C compiler
error label; the format is '"%s",line%d:', where the %s is replaced
with the name of the current source file and the %d with the current input
line number (the optional arguments can be used to override these).

This convenience is provided to encourage shlex users to generate error
messages in the standard, parseable format understood by Emacs and other Unix
tools.

Instances of shlex subclasses have some public instance
variables which either control lexical analysis or can be used for debugging:

Characters that will be considered string quotes. The token accumulates until
the same quote is encountered again (thus, different quote types protect each
other as in the shell.) By default, includes ASCII single and double quotes.

This attribute is None by default. If you assign a string to it, that
string will be recognized as a lexical-level inclusion request similar to the
source keyword in various shells. That is, the immediately following token
will opened as a filename and input taken from that stream until EOF, at which
point the close() method of that stream will be called and
the input source will again become the original input stream. Source
requests may be stacked any number of levels deep.

If whitespace_split is False, any character not
declared to be a word character, whitespace, or a quote will be returned as
a single-character token. If it is True, shlex will only
split words in whitespaces;

EOF is signaled with an empty string ('');

It’s not possible to parse empty strings, even if quoted.

When operating in POSIX mode, shlex will try to obey to the
following parsing rules.

Quotes are stripped out, and do not separate words ("Do"Not"Separate" is
parsed as the single word DoNotSeparate);

Non-quoted escape characters (e.g. '\') preserve the literal value of the
next character that follows;

Enclosing characters in quotes which are not part of
escapedquotes (e.g. "'") preserve the literal value
of all characters within the quotes;

Enclosing characters in quotes which are part of
escapedquotes (e.g. '"') preserves the literal value
of all characters within the quotes, with the exception of the characters
mentioned in escape. The escape characters retain its
special meaning only when followed by the quote in use, or the escape
character itself. Otherwise the escape character will be considered a
normal character.