onekey-sec / ubi_reader

Collection of Python scripts for reading information about and extracting data from UBI and UBIFS images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python3 is required

lthiery opened this issue · comments

Under python2, the following error occurs:

Extracting files to: ubifs-root
extract_files Error: 'module' object has no attribute 'commonpath'

This seems to come from c6a1272. os.path.commonpath indeed requires Python 3.5+. Unless you really need v0.8.2 you can use v0.8.0 where this code wasn't present.

It's not a big deal on my end. I just ran it in Python3.

#62 opened to update docs

Hi lthiery,

Thank you for pointing this out. I will have to consider Python 2 support going forward, as it is EOL, and I imagine issues like this will only get worse going forward. I would imagine ubi_reader is probably used on newer OS's where python 3 is going to be supported, instead of older hardware.

-Jason

I would agree with dropping Python2 support. Generally, this package seems useful in build and development systems which should have no problem upgrading to Python3.

I ended up getting sucked into a different issue, that only showed up when comparing extractions from Python 2 vs 3. I ended up fixing it so Python 2 works in the latest commit.

-Jason

You're a kind person! Thanks