1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-12-03 23:08:06 +00:00

Fix Encoding issues for python2

This commit is contained in:
Ozzieisaacs
2019-06-23 09:22:26 +02:00
parent 32af660f86
commit 572b5427c7
13 changed files with 5244 additions and 1119 deletions

View File

@@ -87,8 +87,8 @@ global_WorkerThread = WorkerThread()
from .server import WebServer
web_server = WebServer()
from .ldap import Ldap
ldap = Ldap()
from .ldap_login import Ldap
ldap1 = Ldap()
babel = Babel()
@@ -97,6 +97,12 @@ log = logger.create()
def create_app():
app.wsgi_app = ReverseProxied(app.wsgi_app)
# For python2 convert path to unicode
if sys.version_info < (3, 0):
app.static_folder = app.static_folder.decode('utf-8')
app.root_path = app.root_path.decode('utf-8')
app.instance_path = app.instance_path .decode('utf-8')
cache_buster.init_cache_busting(app)
log.info('Starting Calibre Web...')
@@ -106,7 +112,7 @@ def create_app():
web_server.init_app(app, config)
db.setup_db()
babel.init_app(app)
ldap.init_app(app)
ldap1.init_app(app)
global_WorkerThread.start()
return app