diff --git a/.ci/py3_sources.txt b/.ci/py3_sources.txt index 9603644ed8d..9f3df8c309d 100644 --- a/.ci/py3_sources.txt +++ b/.ci/py3_sources.txt @@ -27,17 +27,7 @@ lib/galaxy/tools/ lib/galaxy/tours/ lib/galaxy/util/ lib/galaxy/visualization/ -lib/galaxy/web/base/ -lib/galaxy/web/buildapp.py -lib/galaxy/web/framework/base.py -lib/galaxy/web/framework/decorators.py -lib/galaxy/web/framework/helpers/grids.py -lib/galaxy/web/framework/__init__.py -lib/galaxy/web/framework/middleware/error.py -lib/galaxy/web/framework/middleware/static.py -lib/galaxy/web/framework/middleware/statsd.py -lib/galaxy/web/framework/webapp.py -lib/galaxy/web/__init__.py +lib/galaxy/web/ lib/galaxy/webapps/galaxy/api/histories.py lib/galaxy/webapps/galaxy/api/library_datasets.py lib/galaxy/webapps/galaxy/api/tours.py diff --git a/lib/galaxy/web/framework/middleware/batch.py b/lib/galaxy/web/framework/middleware/batch.py index 2cd21e2f780..2231a186998 100644 --- a/lib/galaxy/web/framework/middleware/batch.py +++ b/lib/galaxy/web/framework/middleware/batch.py @@ -23,10 +23,10 @@ import io import json import logging import re -from urlparse import urlparse import routes from paste import httpexceptions +from six.moves.urllib.parse import urlparse log = logging.getLogger(__name__) diff --git a/lib/galaxy/web/framework/middleware/profile.py b/lib/galaxy/web/framework/middleware/profile.py index 53e79d51030..d09da18d9aa 100644 --- a/lib/galaxy/web/framework/middleware/profile.py +++ b/lib/galaxy/web/framework/middleware/profile.py @@ -149,7 +149,7 @@ def get_func_list(stats, sel_list): list = stats.fcn_list[:] order_message = "Ordered by: " + stats.sort_type else: - list = stats.stats.keys() + list = list(stats.stats.keys()) order_message = "Random listing order was used" # Do the selection and accumulate messages select_message = "" diff --git a/lib/galaxy/web/framework/middleware/remoteuser.py b/lib/galaxy/web/framework/middleware/remoteuser.py index 43e5368840d..fdce009f678 100644 --- a/lib/galaxy/web/framework/middleware/remoteuser.py +++ b/lib/galaxy/web/framework/middleware/remoteuser.py @@ -192,7 +192,7 @@ class RemoteUser(object): return self.app(environ, start_response) else: log.debug("Unable to identify user. %s not found" % self.remote_user_header) - for k, v in environ.iteritems(): + for k, v in environ.items(): log.debug("%s = %s", k, v) title = "Access to Galaxy is denied" diff --git a/lib/galaxy/web/framework/middleware/translogger.py b/lib/galaxy/web/framework/middleware/translogger.py index cf837c1421a..7326601a980 100644 --- a/lib/galaxy/web/framework/middleware/translogger.py +++ b/lib/galaxy/web/framework/middleware/translogger.py @@ -5,9 +5,9 @@ Middleware for logging requests, using Apache combined log format """ import logging import time -import urllib from six import string_types +from six.moves.urllib.parse import quote class TransLogger(object): @@ -52,8 +52,8 @@ class TransLogger(object): def __call__(self, environ, start_response): start = time.localtime() - req_uri = urllib.quote(environ.get('SCRIPT_NAME', '') + - environ.get('PATH_INFO', '')) + req_uri = quote(environ.get('SCRIPT_NAME', '') + + environ.get('PATH_INFO', '')) if environ.get('QUERY_STRING'): req_uri += '?' + environ['QUERY_STRING'] method = environ['REQUEST_METHOD'] diff --git a/lib/galaxy/web/security/__init__.py b/lib/galaxy/web/security/__init__.py index a7962e0229d..a00de87bafd 100644 --- a/lib/galaxy/web/security/__init__.py +++ b/lib/galaxy/web/security/__init__.py @@ -98,7 +98,7 @@ class SecurityHelper(object): if recursive and isinstance(v, dict): rval[k] = self.encode_all_ids(v, recursive) elif recursive and isinstance(v, list): - rval[k] = map(lambda el: self.encode_all_ids(el, True), v) + rval[k] = [self.encode_all_ids(el, True) for el in v] return rval def decode_id(self, obj_id, kind=None): diff --git a/lib/galaxy/web/stack/__init__.py b/lib/galaxy/web/stack/__init__.py index dcb13d9889f..29351d5c1f5 100644 --- a/lib/galaxy/web/stack/__init__.py +++ b/lib/galaxy/web/stack/__init__.py @@ -370,8 +370,8 @@ def _do_uwsgi_postfork(): def _mule_fixup(): - import urllib2 - urllib2._opener = None + from six.moves.urllib.request import install_opener + install_opener(None) if uwsgi: diff --git a/lib/galaxy/web/stack/transport.py b/lib/galaxy/web/stack/transport.py index 14226eb728b..19ff675a821 100644 --- a/lib/galaxy/web/stack/transport.py +++ b/lib/galaxy/web/stack/transport.py @@ -76,7 +76,7 @@ class UWSGIFarmMessageTransport(ApplicationStackTransport): if num < need: raise RuntimeError('Need %i uWSGI locks but only %i exist(s): Set `locks = %i` in uWSGI configuration' % (need, num, need - 1)) sys.exit(1) - self._locks.extend(map(lambda x: 'RECV_MSG_FARM_' + x, farms)) + self._locks.extend(['RECV_MSG_FARM_' + x for x in farms]) # this would be nice, but in my 2.0.15 uWSGI, the uwsgi module has no set_option function, and I don't know if it'd work even if the function existed as documented # if len(self.lock_map) > 1: # uwsgi.set_option('locks', len(self.lock_map)) @@ -136,7 +136,7 @@ class UWSGIFarmMessageTransport(ApplicationStackTransport): if not uwsgi.in_farm(): raise RuntimeError('Mule %s is not in a farm! Set `farm = :%s` in uWSGI configuration' % (uwsgi.mule_id(), - ','.join(map(str, range(1, len(filter(lambda x: x.endswith('galaxy/main.py'), self.stack._configured_mules)) + 1))))) + ','.join(map(str, range(1, len([x for x in self.stack._configured_mules if x.endswith('galaxy/main.py')]) + 1))))) elif len(self.stack._farms) > 1: raise RuntimeError('Mule %s is in multiple farms! This configuration is not supported due to locking issues' % uwsgi.mule_id()) # only mules receive messages so don't bother starting the dispatcher if we're not a mule (although