2
0
Эх сурвалжийг харах

don't write strings byte-by-byte (fix #8197) (#8340)

Aurel 6 жил өмнө
parent
commit
96cacb8e62

+ 4 - 0
std/python/io/NativeTextOutput.hx

@@ -40,6 +40,10 @@ class NativeTextOutput extends NativeOutput<TextIOBase> {
 		IoTools.seekInTextMode(stream, tell, p, pos);
 		IoTools.seekInTextMode(stream, tell, p, pos);
 	}
 	}
 
 
+	override public function writeBytes(s:haxe.io.Bytes, pos:Int, len:Int):Int {
+		return stream.buffer.write(python.Syntax.arrayAccess(@:privateAccess s.b, pos, pos + len));
+	}
+
 	override public function writeByte(c:Int):Void
 	override public function writeByte(c:Int):Void
 	{
 	{
 		stream.write(String.fromCharCode(c));
 		stream.write(String.fromCharCode(c));