[Python-checkins] r65422 - in python/trunk: Lib/test/test_str.py Objects/stringobject.c
antoine.pitrou
python-checkins at python.org
Sat Aug 2 23:58:06 CEST 2008
Author: antoine.pitrou
Date: Sat Aug 2 23:58:05 2008
New Revision: 65422
Log:
Preemptively backport the relevant parts of r65420
Modified:
python/trunk/Lib/test/test_str.py
python/trunk/Objects/stringobject.c
Modified: python/trunk/Lib/test/test_str.py
==============================================================================
--- python/trunk/Lib/test/test_str.py (original)
+++ python/trunk/Lib/test/test_str.py Sat Aug 2 23:58:05 2008
@@ -364,6 +364,9 @@
self.assertRaises(ValueError, format, "", "-")
self.assertRaises(ValueError, "{0:=s}".format, '')
+ def test_buffer_is_readonly(self):
+ self.assertRaises(TypeError, sys.stdin.readinto, b"")
+
def test_main():
test_support.run_unittest(StrTest)
Modified: python/trunk/Objects/stringobject.c
==============================================================================
--- python/trunk/Objects/stringobject.c (original)
+++ python/trunk/Objects/stringobject.c Sat Aug 2 23:58:05 2008
@@ -1329,7 +1329,7 @@
string_buffer_getbuffer(PyStringObject *self, Py_buffer *view, int flags)
{
return PyBuffer_FillInfo(view, (void *)self->ob_sval, Py_SIZE(self),
- 0, flags);
+ 1, flags);
}
static PySequenceMethods string_as_sequence = {
More information about the Python-checkins
mailing list