#7715 Remove Python 2 specific elements
Opened by cheimes. Modified

FreeIPA master is now Python 3 only. Let's remove workarounds, hacks, and other code that was necessary for Python 2 support.


  • Don't subclass from `object any more, https://github.com/freeipa/freeipa/pull/2392
  • Replace six.*type with actual Python 3 types, https://github.com/freeipa/freeipa/pull/2394

master:

  • b431e9b684df11c811892bd9d2a5711355f0076e Py3: Remove subclassing from object

master:

  • 964a9bdcec1110b9f108704536dc3ce5487ee80c Py3: Replace six.string_types with str
  • ea396528b7e9575b5fcf4902ce9211cf0a67fcc6 Py3: Replace six.integer_types with int
  • 61156b0a50dc4eddff46a1352574e04d298e9af9 Py3: Replace six.text_type with str
  • ed967ec24dee2cd8b4204e117f7f41fac5b845a7 Py3: Replace six.bytes_type with bytes

master:

  • 15d5e44ee89ce4c0f1f366b0d7150166f1a26844 Py3: Replace six.moves imports

I suppose this can be closed?

I suppose this can be closed?

Ignore this comment. There are still six.PY3 things around.

Is there any reason why some six usage remained? If not I would try and give it a go to remove them.

Some places (like upgrade code or DCERPC handling) should be lest with six for longer -- we want to keep possibility to backport to 4.6 branch which is Python 2 for some of the complex code we have.

No, please don't close the ticket yet. There is still a lot of Python 2 code besides six in master, for example u"" string and imports of Python 2 package names with try: import oldname except ImportError: import newname.

Hello folks, I know this is quite old issue, but I'll give it a go. Do you know what's the current state of Python 2 in freeipa? We would like to get rid of python-six in RHEL 11. Would you be ok, if I try to remove all the six usage?

I think it makes sense to start removing six from IPA (FreeIPA 4.9+ is running on RHEL8 or later already). Feel free to contribute a PR.

Metadata Update from @abbra:
- Issue set to the milestone: None (was: FreeIPA 4.8)

Metadata Update from @dhanina:
- Issue assigned to dhanina

Metadata