[Python-checkins] r68356 - sandbox/trunk/io-c/_bufferedio.c

antoine.pitrou python-checkins at python.org
Tue Jan 6 03:29:30 CET 2009


Author: antoine.pitrou
Date: Tue Jan  6 03:29:30 2009
New Revision: 68356

Log:
fix test_zipfile



Modified:
   sandbox/trunk/io-c/_bufferedio.c

Modified: sandbox/trunk/io-c/_bufferedio.c
==============================================================================
--- sandbox/trunk/io-c/_bufferedio.c	(original)
+++ sandbox/trunk/io-c/_bufferedio.c	Tue Jan  6 03:29:30 2009
@@ -708,6 +708,7 @@
         if (res == NULL)
             goto end;
         Py_CLEAR(res);
+        _BufferedWriter_reset_buf(self);
     }
 
     /* TODO: align on block boundary and read buffer if needed? */
@@ -718,7 +719,7 @@
         goto end;
     self->raw_pos = -1;
     res = PyLong_FromSsize_t(n);
-    if (res != NULL)
+    if (res != NULL && self->readable)
         _BufferedReader_reset_buf(self);
 
 end:


More information about the Python-checkins mailing list