# HG changeset patch # User RĂ©mi Cardona # Date 1443695638 -7200 # Node ID f73a9a884534460b89c3e0e3eb8bcd28ad44838d # Parent 3eb527ce5f0f50883fc55993a096552a2401a887 [py3k] io.BytesIO diff -r 3eb527ce5f0f -r f73a9a884534 server/sources/datafeed.py --- a/server/sources/datafeed.py Thu Oct 01 12:32:27 2015 +0200 +++ b/server/sources/datafeed.py Thu Oct 01 12:33:58 2015 +0200 @@ -19,7 +19,7 @@ database """ -import StringIO +from io import BytesIO from os.path import exists from datetime import datetime, timedelta @@ -346,7 +346,7 @@ self.source.info('Using cwclientlib for %s' % url) resp = cnx.get(url) resp.raise_for_status() - return URLLibResponseAdapter(StringIO.StringIO(resp.text), url) + return URLLibResponseAdapter(BytesIO(resp.text), url) except (ImportError, ValueError, EnvironmentError) as exc: # ImportError: not available # ValueError: no config entry found @@ -360,7 +360,7 @@ return _OPENER.open(req, timeout=self.source.http_timeout) # url is probably plain content - return URLLibResponseAdapter(StringIO.StringIO(url), url) + return URLLibResponseAdapter(BytesIO(url.encode('ascii')), url) def add_schema_config(self, schemacfg, checkonly=False): """added CWSourceSchemaConfig, modify mapping accordingly""" @@ -559,7 +559,7 @@ def info(self): from mimetools import Message - return Message(StringIO.StringIO()) + return Message(BytesIO()) # use a cookie enabled opener to use session cookie if any _OPENER = build_opener()