From 5aa36b8d300d3e04b45c1e540865f6efe1c5a9da Mon Sep 17 00:00:00 2001 From: Lital Natan Date: Sun, 8 Mar 2020 18:00:26 +0000 Subject: [PATCH 1/2] Fixed setup.py reading requirement strings as bytes() Signed-off-by: Lital Natan --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index ed04bf5..524d12a 100644 --- a/setup.py +++ b/setup.py @@ -59,6 +59,8 @@ def read_requirements(filename): line = line.strip() if not line or line.startswith(b'#') or line == '': continue + if isinstance(line, bytes): + line = line.decode() requirements.append(line) except IOError: warnings.warn('{0} was not found'.format(filename)) From 6917494457a4046ed74371e4bbb24ffd5500eb1d Mon Sep 17 00:00:00 2001 From: Lital Natan Date: Tue, 10 Mar 2020 20:26:21 +0000 Subject: [PATCH 2/2] Python3 compatibility fixes Signed-off-by: Lital Natan --- flask_store/__init__.py | 5 ++++- flask_store/providers/__init__.py | 5 ++++- flask_store/providers/local.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/flask_store/__init__.py b/flask_store/__init__.py index d537263..0ff3871 100644 --- a/flask_store/__init__.py +++ b/flask_store/__init__.py @@ -11,7 +11,10 @@ * Amazon Simple File Storage (requires ``boto`` to be installed) """ -import urlparse +try: + import urlparse +except ImportError: + import urllib.parse as urlparse from flask import current_app, send_from_directory from flask_store.exceptions import NotConfiguredError diff --git a/flask_store/providers/__init__.py b/flask_store/providers/__init__.py index d9b52bb..441ea46 100644 --- a/flask_store/providers/__init__.py +++ b/flask_store/providers/__init__.py @@ -9,7 +9,10 @@ import os import shortuuid -import urlparse +try: + import urlparse +except ImportError: + import urllib.parse as urlparse from flask import current_app from flask_store.utils import is_path, path_to_uri diff --git a/flask_store/providers/local.py b/flask_store/providers/local.py index 0caa6e9..59dd1d9 100644 --- a/flask_store/providers/local.py +++ b/flask_store/providers/local.py @@ -62,7 +62,7 @@ def app_defaults(app): # For Local file storage the default store path is the current # working directory - app.config.setdefault('STORE_PATH', os.getcwdu()) + app.config.setdefault('STORE_PATH', os.getcwd()) # Default URL Prefix app.config.setdefault('STORE_URL_PREFIX', '/uploads')