Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2af2aef commit eecc0b9Copy full SHA for eecc0b9
1 file changed
lib/parse/cmdline.py
@@ -788,7 +788,16 @@ def _(self, *args):
788
prompt = False
789
advancedHelp = True
790
791
- for arg in (sys.argv if not IS_WIN else shlex.split(" ".join(sys.argv))):
+ _ = sys.argv
792
+
793
+ # Python on Windows has problems with quote/whitespace cases like: python -c "import sys; print sys.argv" --dummy='foo: bar' # ['-c', "--dummy='foo:", "bar'"]
794
+ if IS_WIN:
795
+ try:
796
+ _ = shlex.split(" ".join(sys.argv), posix=False)
797
+ except ValueError:
798
+ pass
799
800
+ for arg in _:
801
argv.append(getUnicode(arg, encoding=sys.getfilesystemencoding()))
802
803
checkDeprecatedOptions(argv)
0 commit comments