[3.7] bpo-33482: fix codecs.StreamRecoder.writelines (GH-6779) (GH-13502)



A very simple fix. I found this while writing typeshed stubs for StreamRecoder.

https://bugs.python.org/issue33482.
(cherry picked from commit b3be4072888a4ce054993c2801802721466ea02d)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>





https://bugs.python.org/issue33482
diff --git a/Lib/codecs.py b/Lib/codecs.py
index a70ed20..3cd78fc 100644
--- a/Lib/codecs.py
+++ b/Lib/codecs.py
@@ -838,7 +838,7 @@
 
     def writelines(self, list):
 
-        data = ''.join(list)
+        data = b''.join(list)
         data, bytesdecoded = self.decode(data, self.errors)
         return self.writer.write(data)