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

Undefined Variable 'file' #12

Open
forensicmatt opened this issue Aug 20, 2019 · 2 comments
Open

Undefined Variable 'file' #12

forensicmatt opened this issue Aug 20, 2019 · 2 comments

Comments

@forensicmatt
Copy link

Undefined variable error in extract function:

Traceback (most recent call last):
  File "C:\test\pyaff4-master\aff4.py", line 421, in <module>
    main(sys.argv)
  File "C:\test\pyaff4-master\aff4.py", line 411, in main
    extract(dest, args.srcFiles, args.folder)
  File "C:\test\pyaff4-master\aff4.py", line 331, in extract
    printVolumeInfo(file, volume)
NameError: name 'file' is not defined
@forensicmatt
Copy link
Author

This is also an issue in the extractAll function

@gonmator
Copy link
Contributor

To fix it, the line:

printVolumeInfo(file, volume)

must be replaced by:

printVolumeInfo(container_urn.original_filename, volume)

But there still is a bug and the extraction will fail because the destination file is opened as text file. So the line:

with open(destFile, "w") as destStream:

must be replaced by:

with open(destFile, "wb") as destStream:

@gonmator gonmator mentioned this issue Aug 28, 2019
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