Bug 1722868 - rpmlint broken in Rawhide: AttributeError: 'str' object has no attribute 'decode'
Summary: rpmlint broken in Rawhide: AttributeError: 'str' object has no attribute 'dec...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: rpmlint
Version: 31
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Tom "spot" Callaway
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1693760 (view as bug list)
Depends On:
Blocks: 1693751 1718430 1779194
TreeView+ depends on / blocked
 
Reported: 2019-06-21 14:23 UTC by Jerry James
Modified: 2020-11-24 20:25 UTC (History)
6 users (show)

Fixed In Version: rpmlint-1.11-1.fc31
Clone Of:
Environment:
Last Closed: 2020-11-24 20:25:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rpm-software-management rpmlint issues 202 0 None closed decode('UTF-8') is not correct. 2020-11-05 16:37:49 UTC

Description Jerry James 2019-06-21 14:23:27 UTC
Description of problem:
After last night's Rawhide compose, rpmlint is now completely broken.  All invocations of it result in only this output:

Traceback (most recent call last):
  File "/usr/bin/rpmlint", line 381, in <module>
    main()
  File "/usr/bin/rpmlint", line 169, in main
    runChecks(pkg)
  File "/usr/bin/rpmlint", line 226, in runChecks
    check.check(pkg)
  File "/usr/share/rpmlint/TagsCheck.py", line 695, in check
    self.check_summary(pkg, lang, ignored_words)
  File "/usr/share/rpmlint/TagsCheck.py", line 903, in check_summary
    if not Pkg.is_utf8_bytestr(summary):
  File "/usr/share/rpmlint/Pkg.py", line 168, in is_utf8_bytestr
    s.decode('UTF-8')
AttributeError: 'str' object has no attribute 'decode'

Version-Release number of selected component (if applicable):
rpmlint-1.10-22.fc31.noarch

How reproducible:
Always

Steps to Reproduce:
1. Run rpmlint on anything
2.
3.

Actual results:
An AttributeError is thrown.

Expected results:
Useful output.

Additional info:

Comment 1 Jerry James 2019-06-21 14:54:31 UTC
This is the definition of is_utf8_bytestr, at line 166 of /usr/share/rpmlint/Pkg.py:

def is_utf8_bytestr(s):
    try:
        s.decode('UTF-8')
    except UnicodeError:
        return False
    return True

This crude change to the function is probably not the right fix for the issue, but does allow me to do useful work with rpmlint again:

def is_utf8_bytestr(s):
    try:
        s.decode('UTF-8')
    except AttributeError:
        pass
    except UnicodeError:
        return False
    return True

Comment 2 Tom "spot" Callaway 2019-06-21 14:57:58 UTC
The fix is a bit more complicated than that, see the upstream bug I attached to this bz.

Comment 3 Petr Pisar 2019-07-01 08:48:02 UTC
*** Bug 1693760 has been marked as a duplicate of this bug. ***

Comment 4 Miro Hrončok 2019-07-03 23:23:33 UTC
This should fix it: https://src.fedoraproject.org/rpms/rpmlint/pull-request/8

Comment 5 Miro Hrončok 2019-07-10 22:52:58 UTC
Try rpmlint-1.11-1.fc31.

However note that we are figuring more and more problematic places in the codebase that fail. Trying to lint an RPM with non-UTF-8 data in headers will most likely crash it.

Comment 6 Petr Pisar 2019-07-11 09:48:43 UTC
I confirm rpmlint-1.11-1.fc31.noarch works for me.

How could a Fedora's RPM package contain non-UTF-8 data when guidelines state the UTF-8 is mandatory :)

Comment 7 Miro Hrončok 2019-07-11 09:54:18 UTC
(In reply to Petr Pisar from comment #6)
> How could a Fedora's RPM package contain non-UTF-8 data when guidelines
> state the UTF-8 is mandatory :)

Exactly!

Comment 8 Jerry James 2019-07-12 22:05:43 UTC
Ahhh, much better; rpmlint-1.11-2.fc31.noarch works for me.  Thank you!

Comment 9 Ben Cotton 2019-08-13 16:49:11 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 10 Fedora Admin user for bugzilla script actions 2020-06-03 02:57:06 UTC
This package has changed maintainer in the Fedora.
Reassigning to the new maintainer of this component.

Comment 11 Ben Cotton 2020-11-03 16:52:30 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 12 Ben Cotton 2020-11-24 20:25:01 UTC
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.