8000 Fix command line quoting for Windows by ofek · Pull Request #169 · codecov/codecov-python · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.
Fix command line quoting for Windows #169
Merged
merged 3 commits into from
May 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions codecov/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,22 @@
except ImportError: # pragma: no cover
from urllib import urlencode

try:
from shlex import quote
except ImportError: # pragma: no cover
from pipes import quote
quote = None
if sys.platform == 'win32': # pragma: no cover
try:
# https://github.com/python/cpython/blob/3.7/Lib/subprocess.py#L174-L175
from subprocess import list2cmdline

def quote(arg):
return list2cmdline([arg])
except ImportError:
pass
< 53E2 span class='blob-code-inner blob-code-marker ' data-code-marker="+">
if quote is None:
try:
from shlex import quote
except ImportError: # pragma: no cover
from pipes import quote

import subprocess

Expand Down
0