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

Getting a ChunkLen Error "not defined" #34

Open
minhanh1234 opened this issue Nov 9, 2022 · 2 comments
Open

Getting a ChunkLen Error "not defined" #34

minhanh1234 opened this issue Nov 9, 2022 · 2 comments

Comments

@minhanh1234
Copy link

I am getting the following error while i am trying to create a aff4 file.
I am running the following command:

python3 aff4.py -r --create-logical test.aff4 /home/development/E01_Files/

    Adding: /home/development/E01_Files/Program Files/Messengernewalert.wav
    Adding: /home/development/E01_Files/Program Files/Mozilla Firefoxplc4.dll
    Adding: /home/development/E01_Files/Program Files/AIM6coolcore52.dll
    Adding: /home/development/E01_Files/Program Files/Windows Media Player
    Adding: /home/development/E01_Files/Program Files/NetMeetingmst123.dll
    Adding: /home/development/E01_Files/Program Files/Movie Makermoviemk.exe

Traceback (most recent call last):
File "aff4.py", line 497, in
main(sys.argv)
File "aff4.py", line 475, in main
addPathNames(dest, args.srcFiles, args.recursive, args.append, args.hash, args.password)
File "aff4.py", line 319, in addPathNames
addPathNamesToVolume(resolver, volume, pathnames, recursive, hashbased)
File "aff4.py", line 292, in addPathNamesToVolume
urn = volume.writeLogicalStream(pathname, hasher, fsmeta.length)
File "/home/nc3admin/nc3apps/development/E01_Files/pyaff4/pyaff4/container.py", line 404, in writeLogicalStream
self.writeCompressedBlockStream(image_urn, filename, readstream)
File "/home/nc3admin/nc3apps/development/E01_Files/pyaff4/pyaff4/container.py", line 354, in writeCompressedBlockStream
stream.WriteStream(readstream)
File "/home/nc3admin/nc3apps/development/E01_Files/pyaff4/pyaff4/aff4_image.py", line 214, in WriteStream
bevy.WriteStream(stream, progress=progress)
File "/home/nc3admin/nc3apps/development/E01_Files/pyaff4/pyaff4/zip.py", line 516, in WriteStream
owner.StreamAddMember(
File "/home/nc3admin/nc3apps/development/E01_Files/pyaff4/pyaff4/zip.py", line 952, in StreamAddMember
data = stream.read(BUFF_SIZE)
File "/home/nc3admin/nc3apps/development/E01_Files/pyaff4/pyaff4/aff4_image.py", line 91, in read
if chunkLen < self.owner.chunk_size:
NameError: name 'chunkLen' is not defined

@ajnelson-nist
Copy link
Contributor

This class of error is identified with flake8 1. Shell transcript demonstrating this, and similar errors (flagged with error code F821):

$ git rev-parse master
94a3583475c07ad92147f70ff8a19e9e36f12aa9
$ flake8 --version
5.0.4 (mccabe: 0.7.0, pycodestyle: 2.9.1, pyflakes: 2.5.0) CPython 3.9.6 on Darwin
$ flake8 _version.py aff4.py pyaff4 | grep chunkLen
pyaff4/aff4_image.py:91:16: F821 undefined name 'chunkLen'
pyaff4/aff4_image.py:92:51: F821 undefined name 'chunkLen'
$ flake8 _version.py aff4.py pyaff4 | grep F821
pyaff4/data_store.py:913:33: F821 undefined name 'errno'
pyaff4/logical.py:45:16: F821 undefined name 'UnixMetadata'
pyaff4/logical.py:55:16: F821 undefined name 'UnixMetadata'
pyaff4/crypt_image_test.py:388:5: F821 undefined name 'logging'
pyaff4/crypt_image_test.py:388:34: F821 undefined name 'logging'
pyaff4/utils.py:26:30: F821 undefined name 'unicode'
pyaff4/utils.py:32:16: F821 undefined name 'unicode'
pyaff4/utils.py:49:16: F821 undefined name 'unicode'
pyaff4/utils.py:68:33: F821 undefined name 'unicode'
pyaff4/aff4_image.py:91:16: F821 undefined name 'chunkLen'
pyaff4/aff4_image.py:92:51: F821 undefined name 'chunkLen'

Footnotes

  1. Disclaimer: Participation by NIST in the creation of the documentation of mentioned software is not intended to imply a recommendation or endorsement by the National Institute of Standards and Technology, nor is it intended to imply that any specific software is necessarily the best available for the purpose.

@Parkyeongu
Copy link

Parkyeongu commented Nov 24, 2022

see this page.

you need to define ' chunkLen = len(chunk)' at pyaff4/aff4_image.py line81

https://github.com/aff4/pyaff4/pull/30/files

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

3 participants