Anonymous committed d63b57a

Deleted trailing whitespace. This is really a way to be able to add
a missing part of the previous checkin message:

Marc-Andre Lemburg:

Added encoding name attributes to wrapper classes which
allow applications to check the used encoding names.

  • Participants
  • Parent commits 214303d
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Lib/

 BOM_BE = BOM32_BE = '\376\377'
 #	corresponds to Unicode U+FEFF in UTF-16 on big endian
-BOM_LE = BOM32_LE = '\377\376' 
+BOM_LE = BOM32_LE = '\377\376'
 #	corresponds to Unicode U+FFFE in UTF-16 on little endian
 #	platforms == defined as being an illegal Unicode character
     def encode(self,input,errors='strict'):
         """ Encodes the object input and returns a tuple (output
             object, length consumed).
             input must be an object which provides the bf_getreadbuf
             buffer slot. Python strings, buffer objects and memory
             mapped files are examples of objects providing this slot.
             errors defines the error handling to apply. It defaults to
             'strict' handling.
             return an empty object of the output object type in this
-        """ 
+        """
         raise NotImplementedError
 # interfaces which can be used to implement new encodings submodules
 # very easily. See encodings/ for an example on how this is
 # done.
 class StreamWriter(Codec):
             using .write().
     def reset(self):
         """ Flushes and resets the codec buffers used for keeping state.
         # Unsliced reading:
         if size < 0:
             return self.decode([0]
         # Sliced reading:
         read =
         decode = self.decode
             size, if given, is passed as size argument to the stream's
             .readline() method.
         if size is None:
             line =
             line =
         return self.decode(line)[0]
     def readlines(self, sizehint=0):
             Line breaks are implemented using the codec's decoder
             method and are included in the list entries.
             sizehint, if given, is passed as size argument to the
             stream's .read() method.
         """ Creates a StreamRecoder instance which implements a two-way
             conversion: encode and decode work on the frontend (the
-            input to .read() and output of .write()) while 
+            input to .read() and output of .write()) while
             Reader and Writer work on the backend (reading and
             writing to the stream).
     return sr
 ### Tests
 if __name__ == '__main__':
     import sys
     # Make stdout translate Latin-1 output into UTF-8 output
     sys.stdout = EncodedFile(sys.stdout, 'latin-1', 'utf-8')
     # Have stdin translate Latin-1 input into UTF-8 input
     sys.stdin = EncodedFile(sys.stdin, 'utf-8', 'latin-1')