From a33265cf46bf269a1f015ace04f1111b8f0095e6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 8 Mar 2014 08:08:46 +0530 Subject: [PATCH] Content server: Fix (maybe) an error on some windows computers with a non-standard default encoding See http://www.mobileread.com/forums/showthread.php?t=235366 --- src/calibre/library/server/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/library/server/base.py b/src/calibre/library/server/base.py index e64319e88b..69d187dfa3 100644 --- a/src/calibre/library/server/base.py +++ b/src/calibre/library/server/base.py @@ -47,6 +47,10 @@ class DispatchController(object): # {{{ aw = kwargs.pop('android_workaround', False) if route != '/': route = self.prefix + route + if isinstance(route, unicode): + # Apparently the routes package chokes on unicode routes, see + # http://www.mobileread.com/forums/showthread.php?t=235366 + route = route.encode('utf-8') elif self.prefix: self.dispatcher.connect(name+'prefix_extra', self.prefix, self, **kwargs)