@@ -128,7 +128,7 @@ def _create_gen_script(self, tasks):
128128 params .append (f'chparam -set { param [0 ]} { param [1 ]} { self .top } ' )
129129 # Script creation
130130 template = os .path .join (os .path .dirname (__file__ ), 'template.sh' )
131- with open (template , 'r' ) as file :
131+ with open (template , 'r' , encoding = 'utf-8' ) as file :
132132 text = file .read ()
133133 text = text .format (
134134 backend = self .backend ,
@@ -161,7 +161,7 @@ def _create_gen_script(self, tasks):
161161 tool_nextpnr_ecp5 = self .tools ['nextpnr-ecp5' ],
162162 tool_ecppack = self .tools ['ecppack' ]
163163 )
164- with open (f'{ self ._TOOL } .sh' , 'w' ) as file :
164+ with open (f'{ self ._TOOL } .sh' , 'w' , encoding = 'utf-8' ) as file :
165165 file .write (text )
166166
167167 def generate (self , to_task , from_task , capture ):
@@ -173,7 +173,7 @@ def generate(self, to_task, from_task, capture):
173173 def transfer (self , devtype , position , part , width , capture ):
174174 super ().transfer (devtype , position , part , width , capture )
175175 template = os .path .join (os .path .dirname (__file__ ), 'openprog.sh' )
176- with open (template , 'r' ) as file :
176+ with open (template , 'r' , encoding = 'utf-8' ) as file :
177177 text = file .read ()
178178 text = text .format (
179179 family = self .part ['family' ],
@@ -185,7 +185,7 @@ def transfer(self, devtype, position, part, width, capture):
185185 tool_iceprog = self .tools ['iceprog' ],
186186 tool_openocd = self .tools ['openocd' ]
187187 )
188- with open ('openprog.sh' , 'w' ) as file :
188+ with open ('openprog.sh' , 'w' , encoding = 'utf-8' ) as file :
189189 file .write (text )
190190 return run (self ._TRF_COMMAND , capture )
191191
0 commit comments