Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1741527 - 'str' object has no attribute 'decode'
Summary: 'str' object has no attribute 'decode'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: fedora-review
Version: 31
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Stanislav Ochotnicky
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-15 11:38 UTC by Dave Love
Modified: 2019-09-28 01:56 UTC (History)
7 users (show)

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:
Clone Of:
Environment:
Last Closed: 2019-09-24 01:08:41 UTC
Type: Bug


Attachments (Terms of Use)
Patch (3.07 KB, patch)
2019-09-10 14:53 UTC, Richard W.M. Jones
no flags Details | Diff
Patch (3.07 KB, patch)
2019-09-10 14:55 UTC, Richard W.M. Jones
no flags Details | Diff

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.


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