AttributeError: module 'icu' has no attribute 'Locale'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
natsort (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I stumbled over this crash during import while I was working on the tzdata package update. How to reproduce: Install natsort, but do not install the icu Python module. Create an empty directory called `icu` and then try to import natsort:
```
$ sudo apt install python3-natsort
$ sudo apt remove python3-icu
$ mkdir icu
$ python3 -c "import natsort"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/
from natsort.natsort import (
File "/usr/lib/
os_sort_key = os_sort_keygen()
File "/usr/lib/
loc = natsort.
File "/usr/lib/
return cast(str, icu.Locale(
AttributeError: module 'icu' has no attribute 'Locale'
```
ProblemType: Bug
DistroRelease: Ubuntu 23.04
Package: python3-natsort 8.0.2-2
ProcVersionSign
Uname: Linux 6.2.0-20-generic x86_64
ApportVersion: 2.26.1-0ubuntu2
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Sun May 7 00:37:52 2023
Dependencies:
InstallationDate: Installed on 2022-03-09 (423 days ago)
InstallationMedia: Ubuntu 21.10 "Impish Indri" - Release amd64 (20211012)
PackageArchitec
SourcePackage: natsort
UpgradeStatus: Upgraded to lunar on 2023-04-25 (11 days ago)