-
Notifications
You must be signed in to change notification settings - Fork 258
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
fast-export fails if python3 is sytem-wide default #11
Comments
Is this still a problem? |
Still. Python3 can't use package mercurial, because it is not ported from python 2. |
Ok. I'll leave it open then... |
It's supported now!
But I got this error in execution :
|
Hi, I thought I wrote following comments yesterday, but could not see it. Sorry I have to write it again, I've clone it from the master branch but I still have following errors, it runs python 2. Anyway, is it fixed in any branch? Or should I install python extra modules manually? File "/storage/data/SolarAnalytics/HAN/fast-export/hg-fast-export.py", line 7, in |
@houseofsuns if you change |
@houseofsuns My bad, I didn't notice you mentioned this solution. I tried it here and it works too. If the scripts have a dependency on Python2, perhaps it should be clearly specified on the scripts but I do agree this project should consider moving to Python3. |
From PEP 394 [1]: * python2 will refer to some version of Python 2.x. * end users should be aware that python refers to python3 on at least Arch Linux (that change is what prompted the creation of this PEP), so python should be used in the shebang line only for scripts that are source compatible with both Python 2 and 3. So to make sure that we run correctly on a system where python refers to python3 and avoid problems like issue #11 we change the shebangs. [1] https://www.python.org/dev/peps/pep-0394/
@jeandersonbc: As long as Mercurial does not fully support Python >= 3 porting fast-export to Python 3 is pretty pointless. Commit ac60034 should make it clear that Python 3 is not supported even if the requirements section in the readme is ignored. With PEP 394 now providing guidance on what a Python script should assume, I believe this bug is finally fixed. |
If the system default python is python3 (i.e. the symlink is /usr/bin/python -> /usr/bin/python3) then fast-export fails as it is python2 only. The error is in this case rather confusingly
A possible solution is to replace PYTHON=${PYTHON:-python} by PYTHON=${PYTHON:-python2} in the shell scripts and '#!/usr/bin/env python' by '#!/usr/bin/env python2' in the python scripts. This should work in most environments, with one caveat: Debian as greatest distribution under the sky decided to be extravagant and does not ship a python2 symlink, but only python2.6 and similar.
The text was updated successfully, but these errors were encountered: