#4985 [RFE] Support Python 3
Closed: fixed 6 years ago Opened 9 years ago by mkosek.

FreeIPA is currently only working in Python 2 environment. The long term plan is to continuously converge to support of both Python 2 and Python 3 environments and then switching to Python 3 only, when the time comes.

Currently known steps required before switching the actual Python 3:

  • Break off ipaldap into a separate subpackage
  • Python 3 support of all FreeIPA Requires and BuildRequires. The biggest blocker is Python 3 support with python-ldap
  • Move to python-gssapi instead of python-kerberos and python-krbV which do not have Python 3 support and it is not planned either
  • (Optional) Fixing the build process of FreeIPA so that Python code is in proper noarch packages

master:

  • b8c46f2 Modernize number literals

master:

  • 28b0bfa dns plugin: Fix zone normalization under Python 3
  • 05cb4ba sysrestore: Iterate over a list of dict keys

ipa-4-3:

  • 1e228f2 dns plugin: Fix zone normalization under Python 3
  • c8bcf42 sysrestore: Iterate over a list of dict keys

master:

  • f753ad3 test_xmlrpc: Use absolute imports
  • 6406c7a xmlrpc_test: Rename exception instance before working with it
  • 890f83b radiusproxy plugin: Use str(error) rather than error.message
  • 095d0cb xmlrpc_test: Expect bytes rather than strings for binary attributes
  • baaa041 ipalib.rpc: Send base64-encoded data as string under Python 3
  • 14aba1c range plugin tests: Use bytes with MockLDAP under Python 3
  • bdee890 radiusproxy plugin tests: Expect bytes, not text, for ipatokenradiussecret
  • 6ddf0d6 certprofile plugin: Use binary mode for file with binary data
  • 20a6a42 test_add_remove_cert_cmd: Use bytes for base64.b64encode()

ipa-4-3:

  • 5750c3e test_xmlrpc: Use absolute imports
  • ba3d772 xmlrpc_test: Rename exception instance before working with it
  • a514ebd radiusproxy plugin: Use str(error) rather than error.message
  • 4c68bd6 xmlrpc_test: Expect bytes rather than strings for binary attributes
  • 72fb267 ipalib.rpc: Send base64-encoded data as string under Python 3
  • 8f637bc range plugin tests: Use bytes with MockLDAP under Python 3
  • aa052a0 radiusproxy plugin tests: Expect bytes, not text, for ipatokenradiussecret
  • ffb8fcc certprofile plugin: Use binary mode for file with binary data
  • c009ea8 test_add_remove_cert_cmd: Use bytes for base64.b64encode()

master:

  • a9a1353 Fix remaining relative import and enable Pylint check
  • 5dbb0f6 ipalib.cli: Improve reporting of binary values in the CLI
  • 7d4d819 test_cert_plugin: Encode 'certificate' for comparison with 'usercertificate'

ipa-4-3:

  • 2c5b29f Fix remaining relative import and enable Pylint check
  • 39132fd ipalib.cli: Improve reporting of binary values in the CLI
  • 0ebbb48 test_cert_plugin: Encode 'certificate' for comparison with 'usercertificate'

master:

  • 36094b2 ipaldap: Keep attribute names as text, not bytes
  • 75d0a73 ipapython.secrets.kem: Use ConfigParser from six.moves
  • 9477cdd test_topology_plugin: Don't rely on order of an attribute's values
  • 9ca450a test_rpcserver: Expect updated error message under Python 3
  • 743828b ipaplatform.redhat: Use bytestrings when calling rpm.so for version comparison
  • 25560f0 test_ipaserver.test_ldap: Use bytestrings for raw LDAP values
  • c192c1a ipaldap: Convert dict items to list before iterating
  • 037eae2 test_ipaserver.test_ldap: Adjust tests to Python 3's KeyView

ipa-4-3:

  • f01b5e5 ipaldap: Keep attribute names as text, not bytes
  • 546b1d0 ipapython.secrets.kem: Use ConfigParser from six.moves
  • 937ebf4 test_topology_plugin: Don't rely on order of an attribute's values
  • 74e3fd1 test_rpcserver: Expect updated error message under Python 3
  • 12e73c9 ipaplatform.redhat: Use bytestrings when calling rpm.so for version comparison
  • 3c610be test_ipaserver.test_ldap: Use bytestrings for raw LDAP values
  • a78c350 ipaldap: Convert dict items to list before iterating
  • 1933e60 test_ipaserver.test_ldap: Adjust tests to Python 3's KeyView

master:

  • 38e8719 Python3 pylint fixes
  • 7fef9cb Fix Python 3 bugs discovered by pylint
  • fef6f18 Silence import warnings for Samba bindings
  • 6bbbce4 wrap long line

master:

  • 84a9611 ipaldap: properly escape raw binary values in LDAP filters

master:

  • 23239bc py3: create_cert_db: write to file in a compatible way
  • e064109 py3: service.py: replace mkstemp by NamedTemporaryFile
  • 63b5d4a py3: open temporary ldif file in text mode
  • bbe8849 py3: ldap modlist must have keys as string, not bytes
  • 7ae5e5f py3: ipautil: open tempfiles in text mode
  • 0d4074b py3: CA/KRA: config parser requires string
  • 2547bca py3: write CA/KRA config into file opened in text mode
  • 232ceed py3: cainstance: replace mkstemp with NamedTemporaryFile
  • c0b5c67 py3: _httplib_request: don't convert string to bytes
  • 5157888 py3: HTTPResponse has no 'dict' attribute in 'msg'
  • 0a1d7f2 py3: add_entry_to_group: attribute name must be string not bytes
  • 4b148c8 py3: __add_acl: use standard ipaldap methods
  • 746d4ff py3: make_filter_from_attr: use string instead of bytes
  • 1e0f98a py3: convert_attribute_members: don't use bytes as parameter for DN
  • 0eb5a0e dogtag.py: fix exception logging of JSON data
  • 18337bf py3: decode bytes for json.loads()

master:

  • a9fec1d py3: session.py decode server name to str
  • 9739d03 py3: rpcserver: decode input because json requires string
  • 7e8eb53 Py3: Fix undefined variable
  • 35e135c py3: session: fix r/w ccache data
  • cca9aa4 py3: WSGI executioners must return bytes in list
  • aa036e5 py3: rpcserver fix undefined variable
  • dd3d9f1 py3: ipaldap: update encode/decode methods
  • 4933305 py3: get_effective_rights: values passed to ldap must be bytes
  • b37d182 py3: can_read: attributelevelrights is already string
  • deaf9ae Use dict comprehension
  • 1023cfe Principal: validate type of input parameter
  • d5ab063 py3: fix CSR encoding inside framework
  • 47e76e1 py3: fingerprint_hex_sha256: fix encoding/decoding
  • b8d6524 py3: strip_header: support both bytes and unicode
  • 980c8a5 py3: normalize_certificate: support both bytes and unicode

master:

  • 5de70e3 py3: tests_xmlrpc: do not call str() on bytes

master:

  • 91ab650 py3: x509.py: return principal as unicode string

master:

  • 66fa058 pki: add missing depedency pki-base[-python3]
  • bd83fdf pki-base: use pki-base-python2 as dependency

master:

  • caa560c py3: base64 encoding/decoding returns always bytes don't mix it
  • a93b2be py3: remove_entry_from_group: attribute name must be string
  • a3d3b0a py3: _ptrrecord_precallaback: use bytes with labels
  • 03d0a55 py3: DNS: get_record_entry_attrs: do not modify dict during iteration
  • a584758 py3: _convert_to_idna: fix bytes/unicode mistmatch
  • ab53d80 py3: ipaldap: properly encode DNSName to bytes
  • 4c84341 py3: send Decimal number as string instead of base64 encoded value

master:

  • d38540a py3: DN: fix BytesWarning
  • 6bb5af7 py3: get_memberofindirect: fix ByteWarnings
  • a5ccdc1 py3: test_ipaserver: fix BytesWarnings

master:

  • b24787a py3: ldapupdate: fix logging str(bytes) issue

master:

  • 88b192a py3: modify_s: attribute name must be str not bytes
  • 2674a21 py3: configparser: use raw keyword
  • c27a461 py3: custodia: basedn must be unicode
  • 8660b9e py3: kem.py: user bytes with ldap values
  • d4aa75d custodia: kem.set_keys: replace too-broad exception
  • f31d73b py3: upgradeinstance: open dse.ldif in textual mode
  • 7fd36e4 py3: upgradeinstance: decode data before storing them as backup...
  • 47f912e py3: upgradeinstance: use bytes literals with LDIF operations
  • 488d01c py3: create DNS zonefile: use textual mode
  • 69072cb py3: change_admin_password: use textual mode
  • dd119f8 py3: ipa_generate_password: do not compare None and Int

mass moving python3 tickets to FreeIPA 4.6 which should be smaller release targeted mainly on python3 porting.

Metadata Update from @mkosek:
- Issue assigned to mbasti
- Issue set to the milestone: FreeIPA 4.6

7 years ago

master:

  • 35675ca Change ConfigParser to RawConfigParser

master:

  • 6e67978 py3: add missing py3 pylint depedencies
  • cba678d travis: fix pylint execution with py3

master:

  • 89eb162 py3: fix regression in schemaupdate

Metadata Update from @mbasti:
- Issue close_status updated to: None

6 years ago

master:

  • a2147de Explicitly ask for py2 dependencies in py2 packages

master:

  • d665224 session_storage: Correctly handle string/byte types

master:

  • 1cab1e9 ipadiscovery: Return realm as a string
  • c8cc625 Docstring+refactor of IPADiscovery.ipadnssearchkrbrealm()

master:

  • 7c163c9 LDAPEntry: rename _orig to _orig_raw
  • db01767 py3: LDAPClient: remove del method
  • 0487f99 py3: ipaldap: fix encoding of datetime objects

master:

  • a83b258 adtrustinstance: pep8 fix
  • 8311069 adtrustinstance: write the conf as a string

master:

  • b0e5168 py3: secrets: remove iteritems usage

master:

  • b35db91 py3: travis: enable tests for plugins that are aleready working
  • c422206 py3: dogtag.py: fix bytes warnings
  • 8116a7b py3: test_kerberos_principal_aliases: fix code scope
  • 10d4fb7 py3: test_location_plugin: fix iteration over changed dict
  • 3f59721 py3: vault: data must be bytes

master:

  • db4d099 wsgi plugins: mod_wsgi expects bytes as an output
  • d308aba rpcserver: remove addition of str and bytes

master:

  • 8416d57 py3: Remove comparison >=2 of debnug log level
  • 24eadd3 py3: ipa_otptoken_import: fix lamba code inspection
  • e53674e py3: ipa_otptoken_import: fix calling unicode on bytes
  • 637d259 py3: ipa_otptoken_import: fix hex decoding
  • 902f736 py3: test_otptoken_import: fix bytes usage

master:

  • 17103e5 py3: temporary set dependencies to both py2 and py3 packages
  • aa1c0cf py3: run already ported scripts under py3 by default

master:

  • 4375ef8 Split x509.load_certificate() into PEM/DER functions
  • b5732ef x509: Make certificates represented as objects
  • 43c74d3 Introduce load_unknown_x509_certificate()
  • bf4dae7 tests: fix failing HTTPS connection
  • 5ff1de8 parameters: relax type checks
  • 5a44ca6 Create a Certificate parameter
  • 1521296 x509,certdb: handle certificates as bytes
  • e1f88c8 Fixup of not-so-good PEM certs

Metadata Update from @mbasti:
- Issue assigned to stlaz (was: mbasti)

6 years ago

master:

  • 276bef1 krainstance: fix writing str to file

master:

  • c95617e cainstance: read cert file as bytes

master:

  • 6f8d90d client: make ipa-client-install py3 compatible

master:

  • 9fc2cab certs: write and read bytes as such
  • 1124eee replica-prepare: run the script in py3 by default

master:

  • 76904ba replica: fix SetuptoolsVersion comparison

master:

  • d147948 server plugin: pass bytes to ldap.modify_s

master:

  • 5f03329 Misc Python 3 fixes for ipaserver.secrets

master:

  • dbeb41e kerberos: fix sorting Principal objects
  • 31a5cf5 conncheck: fix progression on failure

master:

  • b1fbdbe ipautil: port host_port_open() to python 3

master:

  • 7bf6eb7 py3: Depend on newer pyldap for server-upgrade

master:

  • 5965e27 Turn IPA scripts to python3 -bb for testing
  • 9869d52 Make the IPA server run under Python 3 by default

master:

  • 32be3ef certmonger: fix storing retrieved certificates
  • 0412625 certmonger: finish refactoring for request script
  • a3c11b0 crtmgr: fix bug if CERTMONGER_CERTIFICATE not set
  • 7ef6de9 python3: port certmonger requests script

master:

  • 6fc7a96 cacert_manage: fix CA cert renewal

master:

master:

  • 2151ab0 py3: fix caless to CA promotion on replica

master:

  • 31142ea Unify storing certificates in LDAP

master:

  • 6ca8787 Uninstall: fix BytesWarning exception

master:

  • e6a9de8 py3: remove Exception.message appearances
  • 2bc5b7f py3: remove relative import

master:

  • b1e1109 py3: fix schema response for py2 server with py3 client

master:

  • cac7357 cert: fix application of 'str' to bytes when formatting otherName

master:

  • e09b6c2 rpc: don't encode bytes
  • 1b78f79 cert: fix wrong assumption of cert-show result type

master:

  • 3aff58c spec: remove python3 workaround
  • 263217f spec: have the scripts depend on py3 packages
  • aa969da spec: remove strict options from shebangs

master:

  • 5dcb0e6 dnssec: keep dnssec daemons in Python2

Metadata Update from @tkrizek:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

6 years ago

Fixes that are not part of the 4.6.0 release: https://pagure.io/freeipa/issue/7131

master:

  • 84a10ee py3: ipa-dnskeysyncd: fix bytes issues
  • 53f202b py3: bindmgr: fix iteration over bytes
  • 005d85f py3: bindmgr: fix bytes issues
  • efded22 py3 dnssec: convert hexlify to str
  • 575e513 More DNSSEC house keeping
  • 7670dcb Run DNSSEC under Python 3
  • 6a54146 Decode ODS commands
  • f39d855 DNSSEC: Reformat lines to address PEP8 violations
  • 6f65abf DNSSEC code cleanup

ipa-4-6:

  • 6ba2f1e py3: ipa-dnskeysyncd: fix bytes issues
  • 329178b py3: bindmgr: fix iteration over bytes
  • cf2d239 py3: bindmgr: fix bytes issues
  • ac2b6a4 py3 dnssec: convert hexlify to str
  • bc0ad3e More DNSSEC house keeping
  • c478639 Run DNSSEC under Python 3
  • 7021b8c Decode ODS commands
  • 349fa4a DNSSEC: Reformat lines to address PEP8 violations
  • 1afdd51 DNSSEC code cleanup

master:

  • f31797c Have all the scripts run in python 3 by default

master:

  • a349629 ipa-custodia-checker now uses python3 shebang

Login to comment on this ticket.

Metadata