Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError in cnf #1651

Closed
gantsevdenis opened this issue Apr 22, 2021 · 1 comment
Closed

AttributeError in cnf #1651

gantsevdenis opened this issue Apr 22, 2021 · 1 comment

Comments

@gantsevdenis
Copy link

Not sure if this relates to cnf or to rpm.
Since cnf is just the frontend, I post it here:

denis@localhost:~/sources/rpm> cnf blabla
 blabla: command not found

denis@localhost:~/sources/rpm> cnf useradd
useradd: searching ... Traceback (most recent call last):
  File "/usr/bin/cnf", line 132, in <module>
    main()
  File "/usr/bin/cnf", line 99, in main
    pkg = find_package_by_file(path + '/' + term)
  File "/usr/bin/cnf", line 82, in find_package_by_file
    return next(mi)['name'].decode()
AttributeError: 'str' object has no attribute 'decode'

denis@localhost:~/sources/rpm> zypper info command-not-found
Loading repository data...
Reading installed packages...


Information for package command-not-found:
------------------------------------------
Repository     : openSUSE-Tumbleweed-Oss
Name           : command-not-found
Version        : 0.2.4+20210325.6c2d9f3-1.1
Arch           : noarch
Vendor         : openSUSE
Installed Size : 119.3 KiB
Installed      : Yes (automatically)
Status         : up-to-date
Source package : scout-0.2.4+20210325.6c2d9f3-1.1.src
Summary        : Command Not Found extension for shell

denis@localhost:~/sources/rpm> zypper info rpm
Loading repository data...
Reading installed packages...

Information for package rpm:
----------------------------
Repository     : openSUSE-Tumbleweed-Oss
Name           : rpm
Version        : 4.16.1.3-1.2
Arch           : x86_64
Vendor         : openSUSE
Installed Size : 2.7 MiB
Installed      : Yes
Status         : up-to-date
Source package : rpm-4.16.1.3-1.2.src
@pmatilai
Copy link
Member

It's a cnf issue, it assumes python bindings return header data as binary but since rpm >= 4.15 string data is returned as native Python strings (see https://rpm.org/wiki/Releases/4.15.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants