Bug 1741527

Summary: 'str' object has no attribute 'decode'
Product: [Fedora] Fedora Reporter: Dave Love <dave.love>
Component: fedora-reviewAssignee: Stanislav Ochotnicky <sochotni>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 31CC: admiller, leamas.alec, ngompa13, petersen, pingou, rjones, sochotni
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: fedora-review-0.7.3-1.fc30 fedora-review-0.7.3-1.fc31 fedora-review-0.7.3-1.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-24 01:08:41 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:
Attachments:
Description Flags
Patch
none
Patch none

Description Dave Love 2019-08-15 11:38:24 UTC
I've been seeing this failure for some time (e.g. with -b 1737580 just now):

08-15 11:26 root         DEBUG    Exception down the road...
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/FedoraReview/review_helper.py", line 236, in run
    self._do_run(outfile)
  File "/usr/lib/python3.7/site-packages/FedoraReview/review_helper.py", line 226, in _do_run
    self._do_report(outfile)
  File "/usr/lib/python3.7/site-packages/FedoraReview/review_helper.py", line 99, in _do_report
    self._run_checks(self.bug.spec_file, self.bug.srpm_file, outfile)
  File "/usr/lib/python3.7/site-packages/FedoraReview/review_helper.py", line 108, in _run_checks
    self.checks = Checks(spec, srpm)
  File "/usr/lib/python3.7/site-packages/FedoraReview/checks.py", line 280, in __init__
    self.spec = SpecFile(spec_file, self.flags)
  File "/usr/lib/python3.7/site-packages/FedoraReview/spec_file.py", line 89, in __init__
    self.expand_tag(rpm.RPMTAG_NAME).decode("utf-8"),
AttributeError: 'str' object has no attribute 'decode'

Running with LC_ALL=C, rather than my default of en_GB.UTF-8, fails similarly.

This is with fedora-review-0.7.2-2.fc31.

Comment 1 Jens Petersen 2019-09-08 11:06:37 UTC
Workaround is --no-scratch-build

Comment 2 Richard W.M. Jones 2019-09-10 14:35:41 UTC
Can confirm this happens for me with the same version
(fedora-review-0.7.2-2.fc31.noarch)

Comment 3 Richard W.M. Jones 2019-09-10 14:40:18 UTC
The workaround for me was to hand edit /usr/lib/python3.7/site-packages/FedoraReview/spec_file.py
and remove every place it says .decode("utf-8") (of which there are many).

Comment 4 Richard W.M. Jones 2019-09-10 14:53:32 UTC
Created attachment 1613627 [details]
Patch

Patch which fixes this bug and bug 1710791 as well.

Comment 5 Richard W.M. Jones 2019-09-10 14:55:17 UTC
Created attachment 1613628 [details]
Patch

Let's try that again, but this time without reversing the patch.

Comment 6 Richard W.M. Jones 2019-09-10 15:00:40 UTC
You'll also need to remove .decode("utf-8") calls in
/usr/lib/python3.7/site-packages/FedoraReview/rpm_file.py

Comment 7 Fedora Update System 2019-09-22 00:38:08 UTC
FEDORA-2019-ec5a783a3c has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-ec5a783a3c

Comment 8 Fedora Update System 2019-09-22 00:38:35 UTC
FEDORA-2019-5864ffc7d1 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-5864ffc7d1

Comment 9 Fedora Update System 2019-09-22 00:38:53 UTC
FEDORA-2019-596b8978cd has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-596b8978cd

Comment 10 Fedora Update System 2019-09-24 01:08:41 UTC
fedora-review-0.7.3-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2019-09-28 00:02:12 UTC
fedora-review-0.7.3-1.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2019-09-28 01:56:06 UTC
fedora-review-0.7.3-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.