Commits

Anonymous committed 6c73571

Corrected the builtin_server test by modifying django.core.servers.basehttp's _write method to handle bytes/unicode correctly.

  • Participants
  • Parent commits ca9f82e

Comments (0)

Files changed (1)

File django/core/servers/basehttp.py

     # Pure abstract methods; *must* be overridden in subclasses
 
     def _write(self,data):
-        self.stdout.write(data)
-        self._write = self.stdout.write
+        if type(data) == bytes:
+            self.stdout.write(data.decode("utf-8", "replace"))
+        else:
+            self.stdout.write(data)
+        #self._write = self.stdout.write
 
     def _flush(self):
         self.stdout.flush()