Skip to content

Commit

Permalink
fix: don't fail if can't find a relative path to a data file on anoth…
Browse files Browse the repository at this point in the history
…er volume on win32 (#1428) (#1430)

Co-authored-by: Lorenzo Micò <lmico@dxc.com>
  • Loading branch information
lormico and lorenzomicodxc committed Aug 6, 2022
1 parent c31e9ad commit 1060813
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion coverage/data.py
Expand Up @@ -132,7 +132,13 @@ def combine_parallel_data(
data.update(new_data, aliases=aliases)
files_combined += 1
if message:
message(f"Combined data file {os.path.relpath(f)}")
try:
message(f"Combined data file {os.path.relpath(f)}")
except ValueError:
# ValueError can be raised under Windows when os.getcwd() returns a
# folder from a different drive than the drive of f, in which case
# we print the original value of f instead of its relative path
message(f"Combined data file {f!r}")
if not keep:
if data._debug.should('dataio'):
data._debug.write(f"Deleting combined data file {f!r}")
Expand Down

0 comments on commit 1060813

Please sign in to comment.