diff --git a/bitter/VERSION b/bitter/VERSION index c006218..879be8a 100644 --- a/bitter/VERSION +++ b/bitter/VERSION @@ -1 +1 @@ -0.7.6 +0.7.7 diff --git a/bitter/utils.py b/bitter/utils.py index 7e59018..af46ac9 100644 --- a/bitter/utils.py +++ b/bitter/utils.py @@ -30,6 +30,12 @@ from bitter.models import Following, User, ExtractorEntry, make_session from bitter import config +# Fix Python 2.x. +try: + UNICODE_EXISTS = bool(type(unicode)) +except NameError: + unicode = lambda s: str(s) + logger = logging.getLogger(__name__) @@ -90,7 +96,7 @@ def read_config(conffile): elif 'BITTER_CONFIG' not in os.environ: raise Exception('No config file or BITTER_CONFIG env variable.') else: - f = io.StringIO(os.environ.get('BITTER_CONFIG', "").strip().replace('\\n', '\n')) + f = io.StringIO(unicode(os.environ.get('BITTER_CONFIG', "")).strip().replace('\\n', '\n')) return yaml.load(f) or {'credentials': []}