jb2170 / better-adb-sync

Completely rewritten adbsync with --exclude
Apache License 2.0
355 stars 23 forks source link

AttributeError: 'AndroidFileSystem' object has no attribute 'proc_adb_shell' #43

Open louwers opened 7 months ago

louwers commented 7 months ago
Traceback (most recent call last):
  File "/Users/bart/.local/bin/adbsync", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/bart/Library/Application Support/pipx/venvs/betteradbsync/lib/python3.12/site-packages/BetterADBSync/__init__.py", line 349, in main
    fs_android = AndroidFileSystem(adb_arguments, args.adb_encoding)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bart/Library/Application Support/pipx/venvs/betteradbsync/lib/python3.12/site-packages/BetterADBSync/FileSystems/Android.py", line 67, in __init__
    self.proc_adb_shell = subprocess.Popen(
                          ^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 1953, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'adb'
Exception ignored in: <function AndroidFileSystem.__del__ at 0x1006596c0>
Traceback (most recent call last):
  File "/Users/bart/Library/Application Support/pipx/venvs/betteradbsync/lib/python3.12/site-packages/BetterADBSync/FileSystems/Android.py", line 75, in __del__
    self.proc_adb_shell.stdin.close()
    ^^^^^^^^^^^^^^^^^^^
AttributeError: 'AndroidFileSystem' object has no attribute 'proc_adb_shell'
TomasRiker commented 6 months ago

The actual error is this one: FileNotFoundError: [Errno 2] No such file or directory: 'adb'

You haven't installed adb.

But it's also a bug in better-adb-sync, since it tries to access proc_adb_shell without checking if it exists.