File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -382,8 +382,8 @@ def umount_local(self):
382382 "CMD_ILISTDIR_NEXT" : 3 ,
383383 "CMD_OPEN" : 4 ,
384384 "CMD_CLOSE" : 5 ,
385- "CMD_READLINE " : 6 ,
386- "CMD_READ " : 7 ,
385+ "CMD_READ " : 6 ,
386+ "CMD_READLINE " : 7 ,
387387 "CMD_WRITE" : 8 ,
388388 "CMD_SEEK" : 9 ,
389389 "CMD_REMOVE" : 10 ,
@@ -575,11 +575,13 @@ def readline(self):
575575 c = self.cmd
576576 c.begin(CMD_READLINE)
577577 c.wr_s8(self.fd)
578- n = c.rd_u32()
579- buf = bytearray(n)
580- c.rd_bytes(buf)
578+ data = c.rd_bytes(None)
581579 c.end()
582- return bytes(buf)
580+ if self.is_text:
581+ data = str(data, 'utf8')
582+ else:
583+ data = bytes(data)
584+ return data
583585
584586 def readlines(self):
585587 ls = []
@@ -872,7 +874,6 @@ def do_read(self):
872874 def do_readline (self ):
873875 fd = self .rd_s8 ()
874876 buf = self .data_files [fd ][0 ].readline ()
875- self .wr_u32 (len (buf ))
876877 if self .data_files [fd ][1 ]:
877878 buf = bytes (buf , "utf8" )
878879 self .wr_bytes (buf )
You can’t perform that action at this time.
0 commit comments