Bug 2245672

Summary: python-ldap fails to build with Python 3.13: SystemError: invalid format string: %f
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-ldapAssignee: Simon Pichugin <spichugi>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: abokovoy, cheimes, ksurma, mhroncok, pviktori, python-packagers-sig, rstrode, spichugi
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-ldap-3.4.4-1.fc40 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-29 23:42:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2244836    

Description Karolina Surma 2023-10-23 14:55:58 UTC
python-ldap fails to build with Python 3.13.0a1.

======================================================================
ERROR: test_network_timeout (t_ldap_options.TestGlobalOptions.test_network_timeout)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-ldap-3.4.3/Tests/t_ldap_options.py", line 84, in test_network_timeout
    self._test_timeout(ldap.OPT_NETWORK_TIMEOUT)
  File "/builddir/build/BUILD/python-ldap-3.4.3/Tests/t_ldap_options.py", line 66, in _test_timeout
    self._check_option(option, -5)
  File "/builddir/build/BUILD/python-ldap-3.4.3/Tests/t_ldap_options.py", line 46, in _check_option
    self.set_option(option, value)
  File "/builddir/build/BUILD/python-ldap-3.4.3/Tests/t_ldap_options.py", line 135, in set_option
    return ldap.set_option(option, value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILDROOT/python-ldap-3.4.3-4.fc40.x86_64/usr/lib64/python3.13/site-packages/ldap/functions.py", line 112, in set_option
    return _ldap_function_call(None,_ldap.set_option,option,invalue)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILDROOT/python-ldap-3.4.3-4.fc40.x86_64/usr/lib64/python3.13/site-packages/ldap/functions.py", line 52, in _ldap_function_call
    result = func(*args,**kwargs)
             ^^^^^^^^^^^^^^^^^^^^
SystemError: invalid format string: %f

======================================================================
ERROR: test_timeout (t_ldap_options.TestGlobalOptions.test_timeout)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-ldap-3.4.3/Tests/t_ldap_options.py", line 81, in test_timeout
    self._test_timeout(ldap.OPT_TIMEOUT)
  File "/builddir/build/BUILD/python-ldap-3.4.3/Tests/t_ldap_options.py", line 66, in _test_timeout
    self._check_option(option, -5)
  File "/builddir/build/BUILD/python-ldap-3.4.3/Tests/t_ldap_options.py", line 46, in _check_option
    self.set_option(option, value)
  File "/builddir/build/BUILD/python-ldap-3.4.3/Tests/t_ldap_options.py", line 135, in set_option
    return ldap.set_option(option, value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILDROOT/python-ldap-3.4.3-4.fc40.x86_64/usr/lib64/python3.13/site-packages/ldap/functions.py", line 112, in set_option
    return _ldap_function_call(None,_ldap.set_option,option,invalue)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILDROOT/python-ldap-3.4.3-4.fc40.x86_64/usr/lib64/python3.13/site-packages/ldap/functions.py", line 52, in _ldap_function_call
    result = func(*args,**kwargs)
             ^^^^^^^^^^^^^^^^^^^^
SystemError: invalid format string: %f

======================================================================
ERROR: test_network_timeout (t_ldap_options.TestLDAPObjectOptions.test_network_timeout)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-ldap-3.4.3/Tests/t_ldap_options.py", line 84, in test_network_timeout
    self._test_timeout(ldap.OPT_NETWORK_TIMEOUT)
  File "/builddir/build/BUILD/python-ldap-3.4.3/Tests/t_ldap_options.py", line 66, in _test_timeout
    self._check_option(option, -5)
  File "/builddir/build/BUILD/python-ldap-3.4.3/Tests/t_ldap_options.py", line 46, in _check_option
    self.set_option(option, value)
  File "/builddir/build/BUILD/python-ldap-3.4.3/Tests/t_ldap_options.py", line 158, in set_option
    return self.conn.set_option(option, value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILDROOT/python-ldap-3.4.3-4.fc40.x86_64/usr/lib64/python3.13/site-packages/ldap/ldapobject.py", line 698, in set_option
    return self._ldap_call(self._l.set_option,option,invalue)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILDROOT/python-ldap-3.4.3-4.fc40.x86_64/usr/lib64/python3.13/site-packages/ldap/ldapobject.py", line 128, in _ldap_call
    result = func(*args,**kwargs)
             ^^^^^^^^^^^^^^^^^^^^
SystemError: invalid format string: %f

======================================================================
ERROR: test_timeout (t_ldap_options.TestLDAPObjectOptions.test_timeout)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-ldap-3.4.3/Tests/t_ldap_options.py", line 81, in test_timeout
    self._test_timeout(ldap.OPT_TIMEOUT)
  File "/builddir/build/BUILD/python-ldap-3.4.3/Tests/t_ldap_options.py", line 66, in _test_timeout
    self._check_option(option, -5)
  File "/builddir/build/BUILD/python-ldap-3.4.3/Tests/t_ldap_options.py", line 46, in _check_option
    self.set_option(option, value)
  File "/builddir/build/BUILD/python-ldap-3.4.3/Tests/t_ldap_options.py", line 158, in set_option
    return self.conn.set_option(option, value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILDROOT/python-ldap-3.4.3-4.fc40.x86_64/usr/lib64/python3.13/site-packages/ldap/ldapobject.py", line 698, in set_option
    return self._ldap_call(self._l.set_option,option,invalue)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILDROOT/python-ldap-3.4.3-4.fc40.x86_64/usr/lib64/python3.13/site-packages/ldap/ldapobject.py", line 128, in _ldap_call
    result = func(*args,**kwargs)
             ^^^^^^^^^^^^^^^^^^^^
SystemError: invalid format string: %f

----------------------------------------------------------------------
Ran 253 tests in 8.370s

FAILED (errors=4, skipped=1, expected failures=3)

https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06551215-python-ldap/

For all our attempts to build python-ldap with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-ldap/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Christian Heimes 2023-10-23 16:50:12 UTC
I have noticed the issue in upstream CI and fixed it in https://github.com/python-ldap/python-ldap/pull/537 .

Simon, can you cut a new upstream release?

Comment 2 Simon Pichugin 2023-11-29 23:43:36 UTC
Update:
https://bodhi.fedoraproject.org/updates/FEDORA-2023-d134d899f2