duff2013 / ulptool

Program the esp32 ULP coprocessor in Arduino
275 stars 69 forks source link

Better method for python3 compatibility #80

Open angyongen opened 3 years ago

angyongen commented 3 years ago

https://docs.python.org/2.7/library/subprocess.html#subprocess.Popen.communicate https://docs.python.org/3.8/library/subprocess.html#subprocess.Popen.communicate The universal_newlines argument is equivalent to text and is provided for backwards compatibility. By default, file objects are opened in binary mode.

This fixes the TypeError: can only concatenate str (not "bytes") to str (for error_string = cmd[0] + '\r' + err) and also the TypeError: write() argument must be str, not bytes (for fsym.write(out))

angyongen commented 3 years ago

realised that the previous error can be solved by copying files using platforms.local.txt hooks recipe.hooks.core.prebuild.01.pattern.windows=cmd /c copy /y {build.source.path}\*.s {build.path}\sketch\ see issue #78