Repository: pymedusa/Medusa

Issue:
History page doesn't open
This happens when oppening the history page. On the latest dev commit. @ngosang 
Locale: pt_PT.UTF-8

![image](https://pls.gtfo.accountant/YdZct.png)

Logs:
```
2018-09-24 21:17:09 DEBUG    Thread_9 :: [fd35974] File /home/pi/Medusa/medusa/server/web/core/base.py, line 120, in render
2018-09-24 21:17:09 DEBUG    Thread_9 :: [fd35974] File /home/pi/Medusa/ext/mako/template.py, line 471, in render_unicode
2018-09-24 21:17:09 DEBUG    Thread_9 :: [fd35974] File /home/pi/Medusa/ext/mako/runtime.py, line 838, in _render
2018-09-24 21:17:09 DEBUG    Thread_9 :: [fd35974] File /home/pi/Medusa/ext/mako/runtime.py, line 873, in _render_context
2018-09-24 21:17:09 DEBUG    Thread_9 :: [fd35974] File /home/pi/Medusa/ext/mako/runtime.py, line 899, in _exec_template
2018-09-24 21:17:09 DEBUG    Thread_9 :: [fd35974] File /home/pi/Medusa/themes/dark/templates/layouts/main.mako, line 74, in render_body
2018-09-24 21:17:09 DEBUG    Thread_9 :: [fd35974] File /home/pi/Medusa/themes/dark/templates/history.mako, line 154, in render_content
2018-09-24 21:17:09 DEBUG    Thread_9 :: [fd35974] File /home/pi/Medusa/medusa/sbdatetime.py, line 251, in sbfdatetime
2018-09-24 21:17:09 INFO     Thread_9 :: [fd35974] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
2018-09-24 21:17:12 DEBUG    Thread_5 :: [fd35974] File /home/pi/Medusa/medusa/server/web/core/base.py, line 120, in render
2018-09-24 21:17:12 DEBUG    Thread_5 :: [fd35974] File /home/pi/Medusa/ext/mako/template.py, line 471, in render_unicode
2018-09-24 21:17:12 DEBUG    Thread_5 :: [fd35974] File /home/pi/Medusa/ext/mako/runtime.py, line 838, in _render
2018-09-24 21:17:12 DEBUG    Thread_5 :: [fd35974] File /home/pi/Medusa/ext/mako/runtime.py, line 873, in _render_context
2018-09-24 21:17:12 DEBUG    Thread_5 :: [fd35974] File /home/pi/Medusa/ext/mako/runtime.py, line 899, in _exec_template
2018-09-24 21:17:12 DEBUG    Thread_5 :: [fd35974] File /home/pi/Medusa/themes/dark/templates/layouts/main.mako, line 74, in render_body
2018-09-24 21:17:12 DEBUG    Thread_5 :: [fd35974] File /home/pi/Medusa/themes/dark/templates/history.mako, line 154, in render_content
2018-09-24 21:17:12 DEBUG    Thread_5 :: [fd35974] File /home/pi/Medusa/medusa/sbdatetime.py, line 251, in sbfdatetime
2018-09-24 21:17:12 INFO     Thread_5 :: [fd35974] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
```


Discussion:
Do you know from which commit you upgraded? 
If I'm not mistaked I upgraded from: 4bcdff36e1219289de2a25d5de3839e9d475f2c1

Resolving patch:
diff --git a/medusa/sbdatetime.py b/medusa/sbdatetime.py
--- a/medusa/sbdatetime.py
+++ b/medusa/sbdatetime.py
@@ -246,11 +246,11 @@ def sbfdatetime(self, dt=None, show_seconds=False, d_preset=None, t_preset=None)
                         except Exception:
                             sbdatetime.has_locale = False
                     if t_preset is not None:
-                        strd += ', ' + dt.strftime(t_preset)
+                        strd += b', ' + dt.strftime(t_preset)
                     elif show_seconds:
-                        strd += ', ' + dt.strftime(app.TIME_PRESET_W_SECONDS)
+                        strd += b', ' + dt.strftime(app.TIME_PRESET_W_SECONDS)
                     else:
-                        strd += ', ' + dt.strftime(app.TIME_PRESET)
+                        strd += b', ' + dt.strftime(app.TIME_PRESET)
             else:
                 if d_preset is not None:
                     strd = self.strftime(d_preset)
@@ -266,11 +266,11 @@ def sbfdatetime(self, dt=None, show_seconds=False, d_preset=None, t_preset=None)
                     except Exception:
                         sbdatetime.has_locale = False
                 if t_preset is not None:
-                    strd += ', ' + self.strftime(t_preset)
+                    strd += b', ' + self.strftime(t_preset)
                 elif show_seconds:
-                    strd += ', ' + self.strftime(app.TIME_PRESET_W_SECONDS)
+                    strd += b', ' + self.strftime(app.TIME_PRESET_W_SECONDS)
                 else:
-                    strd += ', ' + self.strftime(app.TIME_PRESET)
+                    strd += b', ' + self.strftime(app.TIME_PRESET)
         finally:
             try:
                 if sbdatetime.has_locale:


Test patch: