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

antoine.pitrou python-checkins at python.org
Tue Jan 6 02:22:16 CET 2009


Author: antoine.pitrou
Date: Tue Jan 6 02:22:15 2009
New Revision: 68355
Log:
fix a failure in test_file.py
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 02:22:15 2009
@@ -747,10 +747,16 @@
 if (res == NULL)
 goto end;
 Py_CLEAR(res);
- _BufferedWriter_reset_buf(self);
 }
- if (self->readable)
+ if (self->readable) {
+ if (pos == Py_None) {
+ /* Rewind the raw stream so that its position corresponds to
+ the current logical position. */
+ if (_Buffered_raw_seek(self, -RAW_OFFSET(self), 1) == -1)
+ goto end;
+ }
 _BufferedReader_reset_buf(self);
+ }
 res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_truncate, pos, NULL);
 if (res == NULL)
 goto end;


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /