pyaff4
pyaff4 copied to clipboard
Undefined Variable 'file'
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
This is also an issue in the extractAll function
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: