You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current version of mtools (specifically, mlaunch) requires python 3 and does not work on python 2. However, it retains the /usr/bin/env python shebang lines.
This is causing problems on systems where the default python is python 2. In these cases mtools installs but with an exception as follows:
[2019/12/30 16:11:47.683] + mlaunch --dir /data/mci/d1c82ce78a6313e78ba96cd703415531/src/../drivers-tools/.evergreen/orchestration/db --binarypath /data/mci/d1c82ce78a6313e78ba96cd703415531/src/../drivers-tools/.evergreen/orchestration/mdb/mongodb-linux-x86_64-enterprise-ubuntu1404-4.0.9/bin --single --sslMode requireSSL --sslPEMKeyFile spec/support/certificates/server-second-level-bundle.pem --sslCAFile spec/support/certificates/ca.crt --sslClientCertificate spec/support/certificates/client.pem
[2019/12/30 16:11:47.694] Traceback (most recent call last):
[2019/12/30 16:11:47.694] File "/data/mci/d1c82ce78a6313e78ba96cd703415531/src/../drivers-tools/.evergreen/orchestration/python/bin/mlaunch", line 5, in
[2019/12/30 16:11:47.694] from mtools.mlaunch.mlaunch import main
[2019/12/30 16:11:47.694] File "/data/mci/d1c82ce78a6313e78ba96cd703415531/drivers-tools/.evergreen/orchestration/python/mtools/mlaunch/mlaunch.py", line 1541
[2019/12/30 16:11:47.694] result.append(f'"{arg}"')
[2019/12/30 16:11:47.694] ^
[2019/12/30 16:11:47.694] SyntaxError: invalid syntax
[2019/12/30 16:11:47.696] Command failed: command encountered problem: error waiting on process 'c0de4964-271f-4412-91b7-ee8acaa83f4d': exit status 1
https://www.python.org/dev/peps/pep-0394/ discusses the behavior of the "python" command. According to my reading, this pep does not prescribe or recommend any particular behavior of this command.
It is my understanding that python3 is available if python 3 is installed. As far as I can recall, all python 3 installations I worked with provided a python3 binary. Therefore it should be safe to change shebang lines in mtools to specify python3 rather than python, which would make mtools work on systems that provide python 2 as the default python.
Expected behavior
mlaunch works
Actual/current behavior
mlaunch does not work because it is run with python 2 interpreter
Steps to reproduce the actual/current behavior
Use mlaunch on Evergreen
Environment
Software
Version
mtools
1.6.0
MongoDB server
any
Operating system
Linux
The text was updated successfully, but these errors were encountered:
…_JSONSerialize_crash_w_bytes
* 'develop' of github.com:bugre/mtools:
Add VSCode config to .gitignore
Bump dev version
Update for 1.6.1 release
Fix Flake8 complaints
Fixrueckstiess#765: mloginfo --clients: more robust parsing of client metadata (rueckstiess#766)
Fixrueckstiess#761: mtools should use python3 in shebangs
Fixrueckstiess#698: Add rounding option for mloginfo --queries (rueckstiess#758)
More specific match for checkpoint duration log line
Fixrueckstiess#258: Add timezone to mloginfo summary
Current version of mtools (specifically, mlaunch) requires python 3 and does not work on python 2. However, it retains the
/usr/bin/env python
shebang lines.This is causing problems on systems where the default python is python 2. In these cases mtools installs but with an exception as follows:
https://www.python.org/dev/peps/pep-0394/ discusses the behavior of the "python" command. According to my reading, this pep does not prescribe or recommend any particular behavior of this command.
It is my understanding that
python3
is available if python 3 is installed. As far as I can recall, all python 3 installations I worked with provided apython3
binary. Therefore it should be safe to change shebang lines in mtools to specifypython3
rather thanpython
, which would make mtools work on systems that provide python 2 as the default python.Expected behavior
mlaunch works
Actual/current behavior
mlaunch does not work because it is run with python 2 interpreter
Steps to reproduce the actual/current behavior
Use mlaunch on Evergreen
Environment
The text was updated successfully, but these errors were encountered: