better-adb-sync icon indicating copy to clipboard operation
better-adb-sync copied to clipboard

Errors while syncing - File "<frozen runpy>" - UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0

Open Tom4tot opened this issue 1 year ago • 2 comments

Here is the error message I get: C:\Users\Tom>adbsync push "F:\1-Music\3-Music Phone\Music" "/sdcard/"

* daemon not running; starting now at tcp:5037
* daemon started successfully
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Tom\AppData\Roaming\Python\Python312\Scripts\adbsync.exe\__main__.py", line 7, in <module>
  File "C:\Users\Tom\AppData\Roaming\Python\Python312\site-packages\BetterADBSync\__init__.py", line 379, in main
    files_tree_destination = fs_destination.get_files_tree(path_destination, follow_links = args.copy_links)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Tom\AppData\Roaming\Python\Python312\site-packages\BetterADBSync\FileSystems\Base.py", line 45, in get_files_tree
    return self._get_files_tree(tree_path, statObject, follow_links = follow_links)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Tom\AppData\Roaming\Python\Python312\site-packages\BetterADBSync\FileSystems\Base.py", line 33, in _get_files_tree
    tree[filename] = self._get_files_tree(
                     ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Tom\AppData\Roaming\Python\Python312\site-packages\BetterADBSync\FileSystems\Base.py", line 33, in _get_files_tree
    tree[filename] = self._get_files_tree(
                     ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Tom\AppData\Roaming\Python\Python312\site-packages\BetterADBSync\FileSystems\Base.py", line 33, in _get_files_tree
    tree[filename] = self._get_files_tree(
                     ^^^^^^^^^^^^^^^^^^^^^
  [Previous line repeated 2 more times]
  File "C:\Users\Tom\AppData\Roaming\Python\Python312\site-packages\BetterADBSync\FileSystems\Base.py", line 30, in _get_files_tree
    for filename, stat_object_child, in self.lstat_in_dir(tree_path):
  File "C:\Users\Tom\AppData\Roaming\Python\Python312\site-packages\BetterADBSync\FileSystems\Android.py", line 176, in lstat_in_dir
    for line in self.adb_shell(["ls", "-la", path]):
  File "C:\Users\Tom\AppData\Roaming\Python\Python312\site-packages\BetterADBSync\FileSystems\Android.py", line 87, in adb_shell
    adb_line = adb_line.decode(self.adb_encoding).rstrip("\r\n")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 71: invalid start byte

Additional info: when using "adb push", I get errors when my files' path is too long, so maybe there's a similar issue with better-adb-sync?

I'm not familar with Python debugging so let me know if you need anything else.

Thank you!

Tom4tot avatar Feb 12 '24 11:02 Tom4tot

looks like a duplicate of #44 which has an input data to work with and suggested workaround

os97673 avatar Oct 12 '24 17:10 os97673

Yes, please close this @Tom4tot in favor of #44 (which already contains all the relevant info).

drws avatar Jan 27 '25 05:01 drws