facebook/redex

Build Redex Error ,object of type '_io.BufferedReader' has no len()

koftnt opened this issue · 1 comments

[ 0%] Generating generated_apilevels.py
[ 4%] Built target resource
[ 5%] Built target tool
INFO:root:Compressing as zip
INFO:root:Adding /usr/envroots/ks-mobile-vuln-scan/redex/service/api-levels/framework_classes_api_14.txt
Traceback (most recent call last):
File "/usr/envroots/ks-mobile-vuln-scan/redex/gen_packed_apilevels.py", line 175, in
main()
File "/usr/envroots/ks-mobile-vuln-scan/redex/gen_packed_apilevels.py", line 169, in main
base64_blob = compress_and_base_64(args.inputs, args.tarxz)
File "/usr/envroots/ks-mobile-vuln-scan/redex/gen_packed_apilevels.py", line 83, in compress_and_base_64
with compress_tar_xz(inputs) if tar_xz else compress_zip(inputs) as buf:
File "/usr/envroots/ks-mobile-vuln-scan/redex/gen_packed_apilevels.py", line 60, in compress_zip
zf.writestr(os.path.basename(input), f)
File "/usr/local/lib/python3.7/zipfile.py", line 1802, in writestr
zinfo.file_size = len(data) # Uncompressed size
TypeError: object of type '_io.BufferedReader' has no len()
make[2]: *** [generated_apilevels.py] Error 1
make[1]: *** [CMakeFiles/generated_apilevels.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 99%] Built target redex
make: *** [all] Error 2

Seems that the zip path is broken. For a quick workaround, can you make sure your system supports tar+lzma?