Fix windows permission error
per #33 the issue was trying to re-open the temporary file. it works on everything but windows. I've changed it to seek to the beginning and read from the file without re-opening, which should fix the issue.
This commit is contained in:
parent
39726e3936
commit
d4a8705708
1 changed files with 3 additions and 1 deletions
|
|
@ -154,7 +154,9 @@ class GerberCairoContext(GerberContext):
|
|||
self.surface_buffer.flush()
|
||||
|
||||
with open(filename, "w") as f:
|
||||
f.write(open(self.surface_buffer.name, "r").read())
|
||||
self.surface_buffer.seek(0)
|
||||
f.write(self.surface_buffer.read())
|
||||
f.flush()
|
||||
|
||||
else:
|
||||
self.surface.write_to_png(filename)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue