nangtani / blender-addon-tester

The blender addon tester is a test harness to enable pytest hook to allow addons to be tested inside a defined version of blender.
MIT License
64 stars 13 forks source link

Crash with non-text files #30

Open Tilix4 opened 4 years ago

Tilix4 commented 4 years ago

In the function clean_file if there is a non-text file in the targeted directory, I get a UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 3131: invalid start byte (in my case it's for a .DS_Store OSX file). I also had the issue with image files.

I don't get what this function is supposed to do and if this issue is actually critical.

douglaskastle commented 3 years ago

I don't understand this. What targeted directory are we talking about here can you show me an example?

Tilix4 commented 3 years ago

The targeted directory is an addon directory, in OSX, the OS creates a .DS_Store binary file. Maybe the issue could be the same with a binary file, like an executable.

douglaskastle commented 3 years ago

Are you saying there is a file in the addon directory, .DS_Store, that is a binary file, and it causes a crash?

I don't have access to a osx machine, I'll try and replicate on linux.

Tilix4 commented 3 years ago

Exactly. Maybe you can reproduce it with any compiled file or a picture.

semagnum commented 2 years ago

I got this as well - if I have a non-Unicode or binary file in the addon and the tester tries to read it, it crashes due to the Unicode error. My case is an *.odp file, but there's been leftover pycache's that don't get deleted and also crash.

Tilix4 commented 2 years ago

I modified the code to skip this check. Maybe we could have an option to skip it.