@@ -43,15 +43,15 @@ def start():
4343
4444 files = [i for i in os .listdir ("{}/source" .format (home ))]
4545
46- with open (notice_path ) as f :
46+ with open (notice_path , encoding = "utf-8" ) as f :
4747 notice = []
4848
4949 for line in f .readlines ():
5050 notice .append ("# {}" .format (line ).strip ())
5151
5252 notice = "\n " .join (notice )
5353
54- with open ("{}/all.py" .format (dest ), "w" ) as f_all :
54+ with open ("{}/all.py" .format (dest ), "w" , encoding = "utf-8" ) as f_all :
5555 f_all .write (notice + "\n \n " )
5656 f_all .write ("count = {count}\n \n " )
5757 f_all .write ("exceptions = {\n " )
@@ -66,14 +66,14 @@ def start():
6666 init = "{}/__init__.py" .format (dest )
6767
6868 if not os .path .exists (init ):
69- with open (init , "w" ) as f_init :
69+ with open (init , "w" , encoding = "utf-8" ) as f_init :
7070 f_init .write (notice + "\n \n " )
7171
72- with open (init , "a" ) as f_init :
72+ with open (init , "a" , encoding = "utf-8" ) as f_init :
7373 f_init .write ("from .{}_{} import *\n " .format (name .lower (), code ))
7474
75- with open ("{}/source/{}" .format (home , i )) as f_csv , \
76- open ("{}/{}_{}.py" .format (dest , name .lower (), code ), "w" ) as f_class :
75+ with open ("{}/source/{}" .format (home , i ), encoding = "utf-8" ) as f_csv , \
76+ open ("{}/{}_{}.py" .format (dest , name .lower (), code ), "w" , encoding = "utf-8" ) as f_class :
7777 reader = csv .reader (f_csv , delimiter = "\t " )
7878
7979 super_class = caml (name )
@@ -98,10 +98,10 @@ def start():
9898
9999 sub_classes .append ((sub_class , id , message ))
100100
101- with open ("{}/template/class.txt" .format (home ), "r" ) as f_class_template :
101+ with open ("{}/template/class.txt" .format (home ), "r" , encoding = "utf-8" ) as f_class_template :
102102 class_template = f_class_template .read ()
103103
104- with open ("{}/template/sub_class.txt" .format (home ), "r" ) as f_sub_class_template :
104+ with open ("{}/template/sub_class.txt" .format (home ), "r" , encoding = "utf-8" ) as f_sub_class_template :
105105 sub_class_template = f_sub_class_template .read ()
106106
107107 class_template = class_template .format (
@@ -123,10 +123,10 @@ def start():
123123
124124 f_all .write ("}\n " )
125125
126- with open ("{}/all.py" .format (dest )) as f :
126+ with open ("{}/all.py" .format (dest ), encoding = "utf-8" ) as f :
127127 content = f .read ()
128128
129- with open ("{}/all.py" .format (dest ), "w" ) as f :
129+ with open ("{}/all.py" .format (dest ), "w" , encoding = "utf-8" ) as f :
130130 f .write (re .sub ("{count}" , str (count ), content ))
131131
132132 print ("Compiling Errors: [100%]" )
0 commit comments