Preemptively backport the relevant parts of r65420
diff --git a/Lib/test/test_str.py b/Lib/test/test_str.py
index 535e66a..044711c 100644
--- a/Lib/test/test_str.py
+++ b/Lib/test/test_str.py
@@ -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)