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 1 commit
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
8000
Diff view
Next Next commit
Fix command line quoting for Windows
  • Loading branch information
ofek authored Oct 25, 2018
commit c97a8cf8e1bd8cde2dfc35f61de7bb3b55cd291a
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

if quote is None:
try:
from shlex import quote
except ImportError: # pragma: no cover
from pipes import quote

import subprocess

Expand Down
0