File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -236,22 +236,22 @@ def test_readinto(self):
236236            fobj .flush ()
237237            fd  =  fobj .fileno ()
238238            os .lseek (fd , 0 , 0 )
239-             buffer  =  bytearray (8 )
239+             buffer  =  bytearray (7 )
240240            s  =  os .readinto (fd , buffer )
241241            self .assertEqual (type (s ), int )
242242            self .assertEqual (s , 4 )
243243            # Should overwrite the first 4 bytes of the buffer. 
244-             self .assertEqual (bytes ( buffer ) , b"spam\0 \0 \0 \0 " )
244+             self .assertEqual (buffer [: 4 ] , b"spam" )
245245
246-             # Readinto at EOF shold  return 0 and not touch buffer 
247-             buffer [:] =  b"notspam\0 " 
246+             # Readinto at EOF should  return 0 and not touch buffer.  
247+             buffer [:] =  b"notspam" 
248248            s  =  os .readinto (fd , buffer )
249249            self .assertEqual (type (s ), int )
250250            self .assertEqual (s , 0 )
251-             self .assertEqual (bytes (buffer ), b"notspam\0 " )
251+             self .assertEqual (bytes (buffer ), b"notspam" )
252252            s  =  os .readinto (fd , buffer )
253253            self .assertEqual (s , 0 )
254-             self .assertEqual (bytes (buffer ), b"notspam\0 " )
254+             self .assertEqual (bytes (buffer ), b"notspam" )
255255
256256            # Readinto a 0 length bytearray when at EOF should return 0 
257257            self .assertEqual (os .readinto (fd , bytearray ()), 0 )
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments