Explorar el Código

[python] output resources in binary mode (closes #4506)

Dan Korostelev hace 10 años
padre
commit
5ecf59a8ee
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      genpy.ml

+ 4 - 1
genpy.ml

@@ -2307,7 +2307,10 @@ module Generator = struct
 				in
 				in
 				let k_enc = Codegen.escape_res_name k false in
 				let k_enc = Codegen.escape_res_name k false in
 				print ctx "%s\"%s\": open('%%s.%%s'%%(_file,'%s'),'rb').read()" prefix (Ast.s_escape k) k_enc;
 				print ctx "%s\"%s\": open('%%s.%%s'%%(_file,'%s'),'rb').read()" prefix (Ast.s_escape k) k_enc;
-				Std.output_file (ctx.com.file ^ "." ^ k_enc) v
+
+				let f = open_out_bin (ctx.com.file ^ "." ^ k_enc) in
+				output_string f v;
+				close_out f
 			) ctx.com.resources;
 			) ctx.com.resources;
 			spr ctx "}"
 			spr ctx "}"
 		end
 		end