From 0849d878d0163668c5736e82bf155c1eceed5308 Mon Sep 17 00:00:00 2001 From: Henry Cox Date: Wed, 18 Dec 2024 15:56:05 -0500 Subject: [PATCH] Handle spaces in path/filename. See #350. Signed-off-by: Henry Cox --- bin/py2lcov | 2 +- bin/xml2lcovutil.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/py2lcov b/bin/py2lcov index 98326b0..b41a81d 100755 --- a/bin/py2lcov +++ b/bin/py2lcov @@ -191,7 +191,7 @@ Example: while os.path.exists(xml): xml = base + '.xml%d' % suffix suffix += 1 - cmd = 'COVERAGE_FILE=%s %s xml -o %s' % (f, args.cover_cmd, xml) + cmd = "COVERAGE_FILE='%s' '%s' xml -o '%s'" % (f, args.cover_cmd, xml) try: #x = subprocess.run(cmd, capture_output=True, shell=True, check=True) x = subprocess.run(cmd, shell=True, check=True, stdout=True, stderr=True) diff --git a/bin/xml2lcovutil.py b/bin/xml2lcovutil.py index 1b21164..839e7e0 100644 --- a/bin/xml2lcovutil.py +++ b/bin/xml2lcovutil.py @@ -121,7 +121,7 @@ def close(self): self._outf.close() if self._args.version and None == self._versionScript: - cmd = "%(lcov)s -a %(info)s -o %(info)s --version-script '%(vers)s' %(checksum)s--rc compute_file_version=1 --branch-coverage --ignore inconsistent" % { + cmd = "'%(lcov)s' -a '%(info)s' -o '%(info)s' --version-script '%(vers)s' %(checksum)s--rc compute_file_version=1 --branch-coverage --ignore inconsistent" % { 'lcov': os.path.join(os.path.split(sys.argv[0])[0], 'lcov'), 'checksum': "--checksum " if self._args.checksum else '', 'info': self._args.output,