[py3k] io.BytesIO
authorRémi Cardona <remi.cardona@logilab.fr>
Mon, 14 Sep 2015 18:56:29 +0200
changeset 10618 3274a1648c7e
parent 10617 c36cda9074c5
child 10619 444b1df7b4cb
[py3k] io.BytesIO
devtools/htmlparser.py
web/request.py
--- a/devtools/htmlparser.py	Fri Sep 11 17:40:23 2015 +0200
+++ b/devtools/htmlparser.py	Mon Sep 14 18:56:29 2015 +0200
@@ -20,7 +20,7 @@
 import re
 import sys
 from xml import sax
-from cStringIO import StringIO
+from io import BytesIO
 
 from lxml import etree
 
@@ -164,7 +164,7 @@
 
     def _parse(self, data):
         inpsrc = sax.InputSource()
-        inpsrc.setByteStream(StringIO(data))
+        inpsrc.setByteStream(BytesIO(data))
         try:
             self._parser.parse(inpsrc)
         except sax.SAXParseException as exc:
--- a/web/request.py	Fri Sep 11 17:40:23 2015 +0200
+++ b/web/request.py	Mon Sep 14 18:56:29 2015 +0200
@@ -22,11 +22,11 @@
 import time
 import random
 import base64
-from StringIO import StringIO
 from hashlib import sha1 # pylint: disable=E0611
 from calendar import timegm
 from datetime import date, datetime
 from warnings import warn
+from io import BytesIO
 
 from six import string_types
 from six.moves import http_client
@@ -143,7 +143,7 @@
         #: form parameters
         self.setup_params(form)
         #: received body
-        self.content = StringIO()
+        self.content = BytesIO()
         # prepare output header
         #: Header used for the final response
         self.headers_out = Headers()