mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-30 18:13:23 +08:00
Fix startup on python 3 if run through uwsgi
uwsgi options are returned as bytestring, so this avoids:
```
Traceback (most recent call last):
File "lib/galaxy/webapps/galaxy/buildapp.py", line 12, in <module>
import galaxy.app
File "lib/galaxy/app.py", line 8, in <module>
import galaxy.model
File "lib/galaxy/model/__init__.py", line 45, in <module>
import galaxy.exceptions
File "lib/galaxy/exceptions/__init__.py", line 19, in <module>
from ..exceptions import error_codes
File "lib/galaxy/exceptions/error_codes.py", line 9, in <module>
from galaxy.util import unicodify
File "lib/galaxy/util/__init__.py", line 1708, in <module>
executable = _executable()
File "lib/galaxy/util/__init__.py", line 1700, in _executable
exe = os.path.join(virtualenv, 'bin', 'python')
File "/Users/mvandenb/src/galaxy/.venv3/lib/python3.6/posixpath.py", line 94, in join
genericpath._check_arg_types('join', a, *p)
File "/Users/mvandenb/src/galaxy/.venv3/lib/python3.6/genericpath.py", line 151, in _check_arg_types
raise TypeError("Can't mix strings and bytes in path components") from None
TypeError: Can't mix strings and bytes in path components
```
Broken in https://github.com/galaxyproject/galaxy/commit/891daf4f82eb45c692f3fc5542cea35f94e10118
This commit is contained in:
@@ -1692,7 +1692,7 @@ def _executable():
|
||||
if uwsgi is not None:
|
||||
for name in ('home', 'virtualenv', 'venv', 'pyhome'):
|
||||
if name in uwsgi.opt:
|
||||
virtualenv = uwsgi.opt[name]
|
||||
virtualenv = unicodify(uwsgi.opt[name])
|
||||
break
|
||||
if virtualenv is None and 'VIRTUAL_ENV' in os.environ:
|
||||
virtualenv = os.environ['VIRTUAL_ENV']
|
||||
|
||||
Reference in New Issue
Block a user