I am passing am trying to pass directories-with-spaces as arguments on windows 11, and using PS autocomplete (TAB) to provide the full name. The '.a b'
gets naturally completed through powershell, using single-quoted and backslash-escaped, as shown, when building the command and before running the command.
But something adds an ending quotes (“) to the argument between the time i press enter, and before my script would run, thus breaking the following argument if i do not trim it.
PS C:> mkdir "a b"
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 10/08/2024 16:19 a b
PS C:> python.exe -i '.a b'
C:Users...PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0python.exe: can't open file 'C:\a b"': [Errno 22] Invalid argument
>>> import sys
>>> print(sys.argv)
['.\a b"']
Questions : is it normal, and if so, how am i supposed to manage this, besides manually trimming the last quote if present ?