Skip to content

Commit

Permalink
fix(device): convert PosixPath to str (#1)
Browse files Browse the repository at this point in the history
The is_remote_path utility function returns `PosixPath` class, but the
functions later expect a string as parameter. This commit adds the
`as_posix()` call which converts the class into a `str` fixing this bug.
  • Loading branch information
ankitrgadiya authored Nov 12, 2021
1 parent d809c36 commit d293e02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions riocli/device/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ def is_remote_path(src, devices=[]):
parts = src.split(":")
if len(parts) == 2:
if is_valid_uuid(parts[0]):
return parts[0], Path(parts[1]).absolute()
return parts[0], Path(parts[1]).absolute().as_posix()
else:
for device in devices:
if device.name == parts[0]:
return device.uuid, Path(parts[1]).absolute()
return device.uuid, Path(parts[1]).absolute().as_posix()
return None, src

0 comments on commit d293e02

Please sign in to comment.