mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Encode as UTF-8 before writing to gz
Turns out that gzip only accepts bytes as input, not str. Contributes to issue CURA-5097.
This commit is contained in:
parent
c1ea1320f0
commit
88912e3973
1 changed files with 1 additions and 1 deletions
|
@ -36,6 +36,6 @@ class GCodeGzWriter(MeshWriter):
|
||||||
if not success: #Writing the g-code failed. Then I can also not write the gzipped g-code.
|
if not success: #Writing the g-code failed. Then I can also not write the gzipped g-code.
|
||||||
return False
|
return False
|
||||||
|
|
||||||
result = gzip.compress(gcode_textio.getvalue())
|
result = gzip.compress(gcode_textio.getvalue().encode("utf-8"))
|
||||||
stream.write(result)
|
stream.write(result)
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue