[Python-checkins] r70135 - in python/branches/io-c: Doc/library/io.rst Lib/_pyio.py

benjamin.peterson python-checkins at python.org
Tue Mar 3 22:47:30 CET 2009


Author: benjamin.peterson
Date: Tue Mar  3 22:47:30 2009
New Revision: 70135

Log:
fix typos and inconsistencies. thanks to Daniel Diniz

Modified:
   python/branches/io-c/Doc/library/io.rst
   python/branches/io-c/Lib/_pyio.py

Modified: python/branches/io-c/Doc/library/io.rst
==============================================================================
--- python/branches/io-c/Doc/library/io.rst	(original)
+++ python/branches/io-c/Doc/library/io.rst	Tue Mar  3 22:47:30 2009
@@ -508,7 +508,7 @@
 
    The constructor creates a :class:`BufferedWriter` for the given writeable
    *raw* stream.  If the *buffer_size* is not given, it defaults to
-   :data:`DEAFULT_BUFFER_SIZE`.  If *max_buffer_size* is omitted, it defaults to
+   :data:`DEFAULT_BUFFER_SIZE`.  If *max_buffer_size* is omitted, it defaults to
    twice the buffer size.
 
    :class:`BufferedWriter` provides or overrides these methods in addition to

Modified: python/branches/io-c/Lib/_pyio.py
==============================================================================
--- python/branches/io-c/Lib/_pyio.py	(original)
+++ python/branches/io-c/Lib/_pyio.py	Tue Mar  3 22:47:30 2009
@@ -263,7 +263,7 @@
     stream.
 
     IOBase also supports the :keyword:`with` statement. In this example,
-    fp is closed after the suite of the with statment is complete:
+    fp is closed after the suite of the with statement is complete:
 
     with open('spam.txt', 'r') as fp:
         fp.write('Spam and eggs!')
@@ -960,7 +960,7 @@
 
     The constructor creates a BufferedWriter for the given writeable raw
     stream. If the buffer_size is not given, it defaults to
-    DEAFULT_BUFFER_SIZE. If max_buffer_size is omitted, it defaults to
+    DEFAULT_BUFFER_SIZE. If max_buffer_size is omitted, it defaults to
     twice the buffer size.
     """
 
@@ -1725,7 +1725,9 @@
         line = self._get_decoded_chars()
 
         start = 0
-        decoder = self._decoder or self._get_decoder()
+        # Make the decoder if it doesn't already exist.
+        if not self._decoder:
+            self._get_decoder()
 
         pos = endpos = None
         while True:
@@ -1780,8 +1782,7 @@
                 endpos = limit  # reached length limit
                 break
 
-            # No line ending seen yet - get more data
-            more_line = ''
+            # No line ending seen yet - get more data'
             while self._read_chunk():
                 if self._decoded_chars:
                     break


More information about the Python-checkins mailing list