avibrazil/iOSbackup

Error when running iOSbackup.getDeviceList()

Closed this issue · 7 comments

Whenever I run iOSbackup.getDeviceList() I get this error

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\...\AppData\Roaming\Python\Python39\site-packages\iOSbackup\__init__.py", line 374, in getDeviceList
    (_, dirnames, _)=next(os.walk(root))
StopIteration

I really have no idea what this error is, and what I can do to fix it. Can someone please tell me what this error means, and how to fix it?

I can't reproduce this problem

I can't reproduce this problem

Well then can you tell me step by step how to install it on windows?

I also had this issue. I initially tried running in a Python 3.8.9 virtual environment on macOS Big Sur (2012 intel chip) and got that error.

I decided it must be due to the venv, and tried it in my system python install (3.9.12) which had been installed correctly and cleanly with pyenv and brew. Also got the exact same error. In short it wasn't that. However as I was writing out this comment I fixed the issue.

outside of the venv
$ python3 -V
Python 3.9.12

$ pip3 install iOSbackup --user this works

$ python3

Python 3.9.12 (main, Mar 26 2022, 15:52:10) 
[Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

>>> from iOSbackup import iOSbackup this also works
>>> iOSbackup.getDeviceList() results in

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/yoda/Library/Python/3.9/lib/python/site-packages/iOSbackup/__init__.py", line 374, in getDeviceList
    (_, dirnames, _)=next(os.walk(root))
StopIteration

inside a venv
$ python3 -V
Python 3.8.9

$ pip install iOSbackup success

$ python

Python 3.8.9 (default, Oct 26 2021, 07:25:54) 
[Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

>>> from iOSbackup import iOSbackup
>>> iOSbackup.getDeviceList() results in

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/yodaisntmyactualusername/Documents/Projects/Programming/Python/iOSBackupExtractor/venv/lib/python3.8/site-packages/iOSbackup/__init__.py", line 374, in getDeviceList
    (_, dirnames, _)=next(os.walk(root))
StopIteration

The fix for this error was due to my macOS permissions.
System Preferences > Security & Privacy > Full Disk Access and in my case I had to give PyCharm and Terminal a tick and restart them. Now running >>> iOSbackup.getDeviceList() in both instances are successful.

My fix was for MacOS only which to any windows user reading this will have their heart sink a little bit. As for windows, there may be a similar fix to allow full disk access, or that you have a non standard backup location in which case check out this issue

after a bit of testing (and some help from the previous post), I realized I have to specify the backups path, even though my path is the standard path. All I need now, is to figure out how to actually view the contents of my backup.

edit: I now have full access to the contents of my backup.

iOSbackup should be smart enough to know the default path on Windows and Mac.

What is the full path of backup created by iTunes on your system?

Also, I’ll try to detect the lack of permission issue and print a better error message.

Thank you folks!

What is the full path of backup created by iTunes on your system?

%APPDATA%\Apple Computer\MobileSync\Backup Or c:\Users\[USERNAME]\AppData\Roaming\Apple Computer\MobileSync\Backup

Would you please change this line of iOSbackup, put this new path and let me know what happens?

I'm asking you because I don't even have a Windows installation to test it.

Maybe this deserves a fix indeed.