Bug 2223524

Summary: python-Levenshtein is not importable with Python 3.12
Product: [Fedora] Fedora Reporter: Elliott Sales de Andrade <quantum.analyst>
Component: python-LevenshteinAssignee: Troy Curtis <troy>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: rawhideCC: dwayne, troy
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-08 10:05:27 UTC Type: ---
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: 2220061, 2226075    

Description Elliott Sales de Andrade 2023-07-18 06:14:40 UTC
PyUnicode_AS_UNICODE was deprecated in Python 3.3 and removed in Python 3.12. The code still compiles, but the compiled library fails to load due to the missing symbol. This has already been fixed upstream in version 0.19.0.

Reproducible: Always

Steps to Reproduce:
1. mock -r fedora-rawhide-x86_64 --install python-Levenshtein
2. mock -r fedora-rawhide-x86_64 --shell
3. python3 -c 'import Levenshtein'
Actual Results:  
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python3.12/site-packages/Levenshtein/__init__.py", line 1, in <module>
    from Levenshtein import _levenshtein
ImportError: /usr/lib64/python3.12/site-packages/Levenshtein/_levenshtein.cpython-312-x86_64-linux-gnu.so: undefined symbol: PyUnicode_AS_UNICODE


Expected Results:  
No import error.

Comment 1 Troy Curtis 2023-07-23 01:48:41 UTC
I'll see about getting the upgrade pushed out soon. The package naming got changed around a bit upstream, so I need to update some dependencies to be the right thing before I can push the update.

Comment 2 Elliott Sales de Andrade 2023-07-24 04:30:56 UTC
Please try to enable tests as well, or at least an import check. https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_running_tests

Comment 3 Troy Curtis 2023-07-31 10:03:03 UTC
Yep, the upgraded spec does contain tests already so this kind of thing should be more quickly noticed. I'm still having some trouble with the "paperwork" dependency and the new name, but should hopefully get to it this coming weekend.

Comment 4 Troy Curtis 2023-08-06 14:20:34 UTC
Updated and successful build in rawhide: https://bodhi.fedoraproject.org/updates/FEDORA-2023-770777bdbb