stringio doesn't have an encoding
This commit is contained in:
parent
16f966ee26
commit
b487e63282
|
@ -1834,3 +1834,7 @@ class StringIO(TextIOWrapper):
|
||||||
# TextIOWrapper tells the encoding in its repr. In StringIO,
|
# TextIOWrapper tells the encoding in its repr. In StringIO,
|
||||||
# that's a implementation detail.
|
# that's a implementation detail.
|
||||||
return object.__repr__(self)
|
return object.__repr__(self)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def encoding(self):
|
||||||
|
return None
|
||||||
|
|
|
@ -451,7 +451,7 @@ class PyStringIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase):
|
||||||
|
|
||||||
# These are just dummy values but we nevertheless check them for fear
|
# These are just dummy values but we nevertheless check them for fear
|
||||||
# of unexpected breakage.
|
# of unexpected breakage.
|
||||||
self.assertEqual(memio.encoding, "utf-8")
|
self.assertTrue(memio.encoding is None)
|
||||||
self.assertEqual(memio.errors, "strict")
|
self.assertEqual(memio.errors, "strict")
|
||||||
self.assertEqual(memio.line_buffering, False)
|
self.assertEqual(memio.line_buffering, False)
|
||||||
|
|
||||||
|
|
|
@ -665,7 +665,7 @@ stringio_encoding(StringIOObject *self, void *context)
|
||||||
{
|
{
|
||||||
CHECK_INITIALIZED(self);
|
CHECK_INITIALIZED(self);
|
||||||
CHECK_CLOSED(self);
|
CHECK_CLOSED(self);
|
||||||
return PyUnicode_FromString("utf-8");
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
|
|
Loading…
Reference in New Issue