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

Python version 2 is EOL #989

Closed
benaryorg opened this issue Mar 19, 2020 · 3 comments
Closed

Python version 2 is EOL #989

benaryorg opened this issue Mar 19, 2020 · 3 comments

Comments

@benaryorg
Copy link

@benaryorg benaryorg commented Mar 19, 2020

Python version 2 has been EOL-ed for some time now.
CRIU seems to still use python2 in some spots.
Currently having a related compile error on my Gentoo box, so I thought I might bring this to your attention.

@adrianreber

This comment has been minimized.

Copy link
Member

@adrianreber adrianreber commented Mar 19, 2020

Python version 2 has been EOL-ed for some time now.
CRIU seems to still use python2 in some spots.

Thanks for the ticket, but everything is already ready for Python 3.

In the code search you linked in the ticket, the first is Dockerfile.centos, which is correctly using python2 as CentOS 7 still supports Python 2.

The second crit-python2 is an explicit Python 2 wrapper for systems still relying on Python 2 (CentOS 7 for example).

The third (soccr/test/tcp-test.py) is probably a valid report, but probably nobody ever runs the test. So that is not good.

The fourth (scripts/nmk/scripts/tools.mk) is the actual detection of the build system if Python 2 or Python 3 is available. So also not a problem.

I think coredump/criu-coredump has not actually been ported to Python 2. That needs to be ported at some point. Not relevant for anything during build.

The last (scripts/magic-gen.py) is also not a real problem, because the script is called from a Makefile with the Python version detected by the build system.

It seems there are still two places where we have not ported CRIU to Python 3 (soccr/test/tcp-test.py and coredump/criu-coredump), which is unfortunate, but so far only in code which no one uses.

Currently having a related compile error on my Gentoo box, so I thought I might bring this to your attention.

CRIU is Python 3 ready for a while and should autodetect it. Let us know which errors you are seeing and I am sure we can help you building CRIU.

@benaryorg

This comment has been minimized.

Copy link
Author

@benaryorg benaryorg commented Mar 19, 2020

CRIU is Python 3 ready for a while and should autodetect it. Let us know which errors you are seeing and I am sure we can help you building CRIU.

Yeah, I figured it out some time ago, the explicit which python2 || which python3 seems to have found a stale python2 wrapper of python-exec.
Checking the other way round (trying python3 before python2) or dropping the check entirely and blindly using python from the PATH sounds reasonable even though my specific issue was in a different place.
Good to see it's mostly ported though, (too quick of) an assumption on my part when I saw the error.

@adrianreber

This comment has been minimized.

Copy link
Member

@adrianreber adrianreber commented Mar 20, 2020

Yes, we probably should first test for python3 and then for python2. When we introduced Python 3 support we did not want to force people on a new Python version if 2 was still installed. Now that Python 3 has been EOL'd we should probably default to version 3.

As your immediate problem has been fixed, I am closing this now.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.