Skip to content

Commit 038ce76

Browse files
committed
Improve handling of file paths
1 parent b85f95f commit 038ce76

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ppadb/device.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ def push(self, src, dest, mode=0o644, progress=None):
7878
subdir = os.path.relpath(root, src)
7979
root_dir_path = os.path.normpath(os.path.join(basename, subdir))
8080

81-
self.shell('mkdir -p "{}/{}"'.format(dest, root_dir_path))
81+
self.shell('mkdir -p "{}"'.format(os.path.normpath(os.path.join(dest, root_dir_path))))
8282

8383
for item in files:
84-
self._push(os.path.join(root, item), os.path.join(dest, root_dir_path, item), mode, progress)
84+
self._push(os.path.normpath(os.path.join(root, item)), os.path.normpath(os.path.join(dest, root_dir_path, item)), mode, progress)
8585

8686
def pull(self, src, dest):
8787
sync_conn = self.sync()

ppadb/device_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ async def push(self, src, dest, mode=0o644, progress=None):
4848
subdir = os.path.relpath(root, src)
4949
root_dir_path = os.path.normpath(os.path.join(basename, subdir))
5050

51-
await self.shell('mkdir -p "{}/{}"'.format(dest, root_dir_path))
51+
await self.shell('mkdir -p "{}"'.format(os.path.normpath(os.path.join(dest, root_dir_path))))
5252

5353
for item in files:
54-
await self._push(os.path.join(root, item), os.path.join(dest, root_dir_path, item), mode, progress)
54+
await self._push(os.path.normpath(os.path.join(root, item)), os.path.normpath(os.path.join(dest, root_dir_path, item)), mode, progress)
5555

5656
async def pull(self, src, dest):
5757
sync_conn = await self.sync()

0 commit comments

Comments
 (0)