Bladeren bron

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

Aurel 6 jaren geleden
bovenliggende
commit
96cacb8e62
1 gewijzigde bestanden met toevoegingen van 4 en 0 verwijderingen
  1. 4 0
      std/python/io/NativeTextOutput.hx

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

@@ -40,6 +40,10 @@ class NativeTextOutput extends NativeOutput<TextIOBase> {
 		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
 	{
 		stream.write(String.fromCharCode(c));