cm: Upgrade dependencies and fix deprecated APIs.
M requirements.txt +11 -11
@@ 1,11 1,11 @@
-Flask==0.12.2
-Flask-Bcrypt==0.7.1
-Flask-Login==0.2.10
-Jinja2==2.10
-Markdown==3.0.1
-Pygments==2.2.0
-SQLAlchemy==1.2.0
-Whoosh==2.7.4
-colorama==0.3.9
-python-hglib==1.8
-repoze.lru==0.6
+Flask>=0.12.2
+Flask-Bcrypt>=0.7.1
+Flask-Login>=0.2.10
+Jinja2>=2.10
+Markdown>=3.0.1
+Pygments>=2.2.0
+SQLAlchemy>=1.2.0
+Whoosh>=2.7.4
+colorama>=0.3.9
+python-hglib>=1.8
+repoze.lru>=0.6

          
M tests/mock.py +4 -4
@@ 5,7 5,7 @@
 import io
 from collections import deque
 from contextlib import closing
-from configparser import SafeConfigParser
+from configparser import ConfigParser
 from wikked.fs import FileSystem
 from wikked.db.base import Database
 from wikked.indexer.base import WikiIndex

          
@@ 59,12 59,12 @@
 os.path.dirname(__file__), '..',
             'wikked', 'resources', 'defaults.cfg')
 
-        config = SafeConfigParser()
-        config.readfp(open(default_config_path))
+        config = ConfigParser()
+        config.read_file(open(default_config_path))
         config.set('wiki', 'root', '/fake/root')
         if self.config_text:
             with closing(io.StringIO(self.config_text)) as conf:
-                config.readfp(conf)
+                config.read_file(conf)
 
         return config
 

          
M tests/test_auth.py +2 -2
@@ 1,5 1,5 @@
 import pytest
-from configparser import SafeConfigParser
+from configparser import ConfigParser
 from wikked.auth import (
         UserManager, PERM_NAMES,
         NoSuchGroupOrUserError, MultipleGroupMembershipError,

          
@@ 7,7 7,7 @@
  
 def _user_manager_from_str(txt):
-    config = SafeConfigParser()
+    config = ConfigParser()
     config.read_string(txt)
     return UserManager(config)
 

          
M wikked/api/user.py +2 -2
@@ 15,7 15,7 @@
  @app.route('/api/user/is_logged_in')
 def api_user_is_logged_in():
-    if current_user.is_authenticated():
+    if current_user.is_authenticated:
         result = {'logged_in': True}
         return jsonify(result)
     abort(401)

          
@@ 31,7 31,7 @@
 @app.route('/api/user/info')
 def api_current_user_info():
     user = current_user
-    if user.is_authenticated():
+    if user.is_authenticated:
         result = {
             'user': {
                 'username': user.username,

          
M wikked/db/sql.py +3 -3
@@ 205,8 205,7 @@
 self.engine_url)
                     self._engine = create_engine(
                             self.engine_url,
-                            connect_args=self.connect_args,
-                            convert_unicode=True)
+                            connect_args=self.connect_args)
         return self._engine
 
     def close(self, exception=None):

          
@@ 594,13 593,14 @@
 # Load requested fields... some need subqueries.
         for f in fields:
             col = fieldnames.get(f) or f
-            query = query.options(l_load_only(col))
             sqf = subqueryfields.get(f)
             if sqf:
                 if use_joined:
                     query = query.options(l_joinedload(sqf))
                 else:
                     query = query.options(l_subqueryload(sqf))
+            else:
+                query = query.options(l_load_only(col))
         return query
 
     def _addPage(self, page):

          
M wikked/views/__init__.py +1 -1
@@ 7,7 7,7 @@
  def add_auth_data(data):
     username = current_user.get_id()
-    if current_user.is_authenticated():
+    if current_user.is_authenticated:
         user_page_url = 'user:/%s' % urllib.parse.quote(username.title())
         data['auth'] = {
                 'is_logged_in': True,

          
M wikked/views/user.py +1 -1
@@ 15,7 15,7 @@
 raw_url='/api/user/login')
 
     if request.method == 'GET':
-        if current_user.is_authenticated():
+        if current_user.is_authenticated:
             data['already_logged_in'] = True
             return render_template('logout.html', **data)
         else: