Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

[ERROR] UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff #183

Open
nqdrizzt opened this issue Aug 27, 2021 · 1 comment
Open

[ERROR] UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff #183

nqdrizzt opened this issue Aug 27, 2021 · 1 comment

Comments

@nqdrizzt
Copy link

Hello,
I have the latest verson of the project running in AWS to scan a bucket.
After uploading a binary exe file, in this case 7z1900-x64.exe ( 7z portable installer) the following error is thrown by the clamav scanner:

[ERROR] UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 6831: invalid start byte Traceback (most recent call last): File "/var/task/scan.py", line 238, in lambda_handler scan_result, scan_signature = clamav.scan_file(file_path) File "/var/task/clamav.py", line 197, in scan_file output = av_proc.communicate()[0].decode()
Is there a way to fix this ?

@tianbiao
Copy link

Hi @nqdrizzt I met the same issue and there is a workaround from my team member is to remove the -a from below code

av_proc = subprocess.Popen( [CLAMSCAN_PATH, "-v", "-a", "--stdout", "-d", AV_DEFINITION_PATH, path], stderr=subprocess.STDOUT, stdout=subprocess.PIPE, env=av_env, )

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

No branches or pull requests

2 participants