Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when attemping extract of cramfs image #1

Open
tridentsx opened this issue Sep 17, 2023 · 1 comment
Open

Error when attemping extract of cramfs image #1

tridentsx opened this issue Sep 17, 2023 · 1 comment

Comments

@tridentsx
Copy link

tridentsx commented Sep 17, 2023

My test:/home/tridentsx/dumps/test/backup/nand/09-06-2023_17-21/fma5.img
WARNING: old cramfs format
Traceback (most recent call last):
File "/home/tridentsx/dumps/./test.py", line 43, in
unpack_dump("./backup_176.zip")
File "/home/tridentsx/dumps/./test.py", line 33, in unpack_dump
extract_dir(rootdir, "fma5") # Extract a directory tree
File "/usr/local/lib/python3.10/dist-packages/pycramfs/extract.py", line 108, in extract_dir
path.mkdir(file.mode, exist_ok=force)
AttributeError: 'PurePosixPath' object has no attribute 'mkdir'

@AT0myks
Copy link
Owner

AT0myks commented Nov 2, 2023

extract_dir expects dest to be a Path so the fix is to do

from pathlib import Path
extract_dir(rootdir, Path("fma5"))

This is not obvious unless you have type checking enabled in your editor. To avoid the same issue in the future I might change it so that it also accepts a str, that way it'll be more natural.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants