memzip not working as intended any more
Posted: Tue Sep 21, 2021 2:35 pm
Hi
I have an old code and an old makefile. When i execute it i get the following error:
My memzip part of the make file looks as following.
can anyone help to why I get this error? All I really need is to put the "test_file.rpd" binary in memory so I can read it using "memzip_locate". I have been able to do this with an older version of micropython. But it has been changed and updated a few times over the last year, and now I'm back and need this piece to work again.
Regards
I have an old code and an old makefile. When i execute it i get the following error:
Code: Select all
Creating build/memzip-files.c
python3 ../micropython-master/lib/memzip/make-memzip.py --zip-file build/memzip-files.zip --c-file build/memzip-files.c memzip_files
adding: test_file.rpd (stored 0%)
args.zip_filename = build/memzip-files.zip
args.c_filename = build/memzip-files.c
args.source_dir = memzip_files
Traceback (most recent call last):
File "../micropython-master/lib/memzip/make-memzip.py", line 78, in <module>
main()
File "../micropython-master/lib/memzip/make-memzip.py", line 75, in main
create_c_from_file(args.c_filename, args.zip_filename)
File "../micropython-master/lib/memzip/make-memzip.py", line 30, in create_c_from_file
print('#include <stdint.h>', file=c_file)
TypeError: a bytes-like object is required, not 'str'
make[2]: *** [Makefile:55: build/memzip-files.c] Error 1
make[2]: *** Deleting file 'build/memzip-files.c'
make[2]: Leaving directory '/home/avbe/git-projects/triton_func/tst_sw/mpyshell/micropy-lib/nios2'
make[1]: *** [makefile:3: all] Error 2
make[1]: Leaving directory '/home/avbe/git-projects/triton_func/tst_sw/mpyshell/micropy-lib'
make: *** [makefile:8: mpyshell] Error 2
Code: Select all
SRC_C += \
lib/memzip/import.c \
lib/memzip/lexermemzip.c \
lib/memzip/memzip.c \
OBJ += $(BUILD)/memzip-files.o
MAKE_MEMZIP = ../micropython-master/lib/memzip/make-memzip.py
ifeq ($(MEMZIP_DIR),)
MEMZIP_DIR = memzip_files
endif
$(BUILD)/memzip-files.o: $(BUILD)/memzip-files.c
$(call compile_c)
$(BUILD)/memzip-files.c: $(shell find ${MEMZIP_DIR} -type f)
@$(ECHO) "Creating $@"
$(Q)$(PYTHON) $(MAKE_MEMZIP) --zip-file $(BUILD)/memzip-files.zip --c-file $@ $(MEMZIP_DIR)
Regards