[Python-checkins] CVS: python/dist/src/Lib codecs.py,1.9,1.10

M.-A. Lemburg python-dev@python.org
Wed, 21 Jun 2000 14:21:07 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv14827/Lib

Modified Files:
	codecs.py 
Log Message:
Marc-Andre Lemburg <mal@lemburg.com>:
Made codecs.open() default to 'rb' as file mode.

Index: codecs.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/codecs.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** codecs.py	2000/05/01 16:17:32	1.9
--- codecs.py	2000/06/21 21:21:04	1.10
***************
*** 459,463 ****
  ### Shortcuts
  
! def open(filename, mode, encoding=None, errors='strict', buffering=1):
  
      """ Open an encoded file using the given mode and return
--- 459,463 ----
  ### Shortcuts
  
! def open(filename, mode='rb', encoding=None, errors='strict', buffering=1):
  
      """ Open an encoded file using the given mode and return
***************
*** 468,471 ****
--- 468,476 ----
          codecs. Output is also codec dependent and will usually by
          Unicode as well.
+ 
+         Files are always opened in binary mode, even if no binary mode
+         was specified. Thisis done to avoid data loss due to encodings
+         using 8-bit values. The default file mode is 'rb' meaning to
+         open the file in binary read mode.
  
          encoding specifies the encoding which is to be used for the