Unicode error after migrating to python3.5


I recently upgraded my galaxy instance to v19.09 from v19.05. This went fine, so I decided to try moving from python2 to python3. I removed my .venv, and created a new one with
virtualenv --python=/usr/bin/python3 .venv
I had to upgrade setuptools (pip install --upgrade setuptools) and pull this change into my instance before the server could make it through startup.

The I tried to access galaxy and I got the following:

serving on view at - - [09/Dec/2019:09:34:47 -0700] "GET / HTTP/1.1" 500 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"

Error - <class 'NameError'>: name 'unicode' is not defined

URL: https://galaxy.lygos.com/

File '/home/galaxy/galaxy-dist/lib/galaxy/web/framework/middleware/error.py', line 154 in __call__

app_iter = self.application(environ, sr_checker)

File '/home/galaxy/galaxy-dist/.venv/lib/python3.5/site-packages/paste/recursive.py', line 85 in __call__

return self.application(environ, start_response)

File '/home/galaxy/galaxy-dist/.venv/lib/python3.5/site-packages/paste/httpexceptions.py', line 640 in __call__

return self.application(environ, start_response)

File '/home/galaxy/galaxy-dist/lib/galaxy/web/framework/base.py', line 143 in __call__

return self.handle_request(environ, start_response)

File '/home/galaxy/galaxy-dist/lib/galaxy/web/framework/base.py', line 222 in handle_request

body = method(trans, **kwargs)

File '/home/galaxy/galaxy-dist/lib/galaxy/webapps/galaxy/controllers/root.py', line 79 in index

return self._bootstrapped_client(trans)

File '/home/galaxy/galaxy-dist/lib/galaxy/webapps/base/controller.py', line 281 in _bootstrapped_client

return self.template(trans, app_name, options=js_options, **kwd)

File '/home/galaxy/galaxy-dist/lib/galaxy/webapps/base/controller.py', line 360 in template


File '/home/galaxy/galaxy-dist/lib/galaxy/web/framework/webapp.py', line 936 in fill_template

return self.fill_template_mako(filename, **kwargs)

File '/home/galaxy/galaxy-dist/lib/galaxy/web/framework/webapp.py', line 949 in fill_template_mako

return template.render(**data)

File '/home/galaxy/galaxy-dist/.venv/lib/python3.5/site-packages/mako/template.py', line 476 in render

return runtime._render(self, self.callable_, args, data)

File '/home/galaxy/galaxy-dist/.venv/lib/python3.5/site-packages/mako/runtime.py', line 883 in _render

**_kwargs_for_callable(callable_, data)

File '/home/galaxy/galaxy-dist/.venv/lib/python3.5/site-packages/mako/runtime.py', line 920 in _render_context

_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)

File '/home/galaxy/galaxy-dist/.venv/lib/python3.5/site-packages/mako/runtime.py', line 947 in _exec_template

callable_(context, *args, **kwargs)

File '/home/galaxy/galaxy-dist/database/compiled_templates/js-app.mako.py', line 48 in render_body

__M_writer(unicode( h.url_for( '/' ) ))

NameError: name 'unicode' is not defined

During Galaxy startup, I noticed a message ‘The Galaxy client build is up to date and will not be rebuilt at this time.’ I’m guessing this is incorrect and I do need to rebuild, but I would love to get an opinion form someone who knows the Galaxy internals. And if I do need to rebuild, how do I kick that off?


Within moments of posting I managed to solve the issue using this: