Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mako on Python 3 #8617

Closed
selten opened this issue Sep 11, 2019 · 4 comments
Closed

Mako on Python 3 #8617

selten opened this issue Sep 11, 2019 · 4 comments

Comments

@selten
Copy link
Contributor

@selten selten commented Sep 11, 2019

I'm using Galaxy release 19.09 and Python 3.7.
I'm trying to access the main page and get the following error:

Traceback (most recent call last):
  File "lib/galaxy/web/framework/middleware/error.py", line 154, in __call__
    app_iter = self.application(environ, sr_checker)
  File "GLXFOLDER/.venv/lib/python3.7/site-packages/paste/recursive.py", line 85, in __call__
    return self.application(environ, start_response)
  File "GLXFOLDER/.venv/lib/python3.7/site-packages/paste/httpexceptions.py", line 640, in __call__
    return self.application(environ, start_response)
  File "lib/galaxy/web/framework/base.py", line 143, in __call__
    return self.handle_request(environ, start_response)
  File "lib/galaxy/web/framework/base.py", line 222, in handle_request
    body = method(trans, **kwargs)
  File "lib/galaxy/webapps/galaxy/controllers/root.py", line 79, in index
    return self._bootstrapped_client(trans)
  File "lib/galaxy/webapps/base/controller.py", line 281, in _bootstrapped_client
    return self.template(trans, app_name, options=js_options, **kwd)
  File "lib/galaxy/webapps/base/controller.py", line 360, in template
    masthead=masthead
  File "lib/galaxy/web/framework/webapp.py", line 936, in fill_template
    return self.fill_template_mako(filename, **kwargs)
  File "lib/galaxy/web/framework/webapp.py", line 949, in fill_template_mako
    return template.render(**data)
  File "GLXFOLDER/.venv/lib/python3.7/site-packages/mako/template.py", line 476, in render
    return runtime._render(self, self.callable_, args, data)
  File "GLXFOLDER/.venv/lib/python3.7/site-packages/mako/runtime.py", line 883, in _render
    **_kwargs_for_callable(callable_, data)
  File "GLXFOLDER/.venv/lib/python3.7/site-packages/mako/runtime.py", line 920, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "GLXFOLDER/.venv/lib/python3.7/site-packages/mako/runtime.py", line 947, in _exec_template
    callable_(context, *args, **kwargs)
  File "GLXFOLDER/database/compiled_templates/js-app.mako.py", line 52, in render_body
    __M_writer(unicode( h.url_for( '/' ) ))
NameError: name 'unicode' is not defined
@selten
Copy link
Contributor Author

@selten selten commented Sep 11, 2019

After running the following command I see the homepage:

2to3 -w database/compiled_templates/js-app.mako.py

Loading

@selten
Copy link
Contributor Author

@selten selten commented Sep 11, 2019

I'm resorting to

2to3 -w database/compiled_templates/*.py

Loading

@nsoranzo
Copy link
Member

@nsoranzo nsoranzo commented Sep 11, 2019

Did you try to clean-up the directory with rm -rf database/compiled_templates/ and restart Galaxy?

Loading

@selten
Copy link
Contributor Author

@selten selten commented Sep 12, 2019

That seems to work. Sorry for this, I totally forgot about that.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants