#NEWLINE# def _align_to_newline( self ) : #NEWLINE# #INDENT# "Aligns the file object's position to the next newline." #NEWLINE# ( fo , bsize ) = ( self . _file_obj , self . _blocksize ) #NEWLINE# ( cur , total_read ) = ( '' , 0 ) #NEWLINE# cur_pos = fo . tell ( ) #NEWLINE# while ( '\n' not in cur ) : #NEWLINE# #INDENT# cur = fo . read ( bsize ) #NEWLINE# total_read += bsize #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# newline_offset = ( ( cur . index ( '\n' ) + total_read ) - cur ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# fo . seek ( ( cur_pos + newline_offset ) )