Bug 1267808 - dnf playground enable doesn't work
dnf playground enable doesn't work
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf-plugins-core (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Suchý
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-01 02:01 EDT by Honza Horak
Modified: 2015-10-23 13:20 EDT (History)
7 users (show)

See Also:
Fixed In Version: dnf-plugins-core-0.1.13-1.fc23 dnf-plugins-core-0.1.13-1.fc22
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-17 11:51:52 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Honza Horak 2015-10-01 02:01:31 EDT
Description of problem:
`dnf playground enable` fails with python traceback.

Version-Release number of selected component (if applicable):
# rpm -q dnf dnf-plugins-core 
dnf-1.1.1-2.fc23.noarch
dnf-plugins-core-0.1.11-1.fc23.noarch


How reproducible:
every-time

Steps to Reproduce:
1. #> dnf playground enable

Actual results:
You are about to enable a Playground repository.

Do you want to continue? [y/N]: y
Traceback (most recent call last):
  File "/usr/bin/dnf", line 35, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 198, in user_main
    errcode = main(args)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 84, in main
    return _main(base, args)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 136, in _main
    cli.run()
  File "/usr/lib/python3.4/site-packages/dnf/cli/cli.py", line 1085, in run
    return self.command.run(self.base.extcmds)
  File "/usr/lib/python3.4/site-packages/dnf-plugins/copr.py", line 382, in run
    self._cmd_enable(chroot)
  File "/usr/lib/python3.4/site-packages/dnf-plugins/copr.py", line 339, in _cmd_enable
    output = self._get_data(f)
  File "/usr/lib/python3.4/site-packages/dnf-plugins/copr.py", line 299, in _get_data
    output = json.loads(f.read())
  File "/usr/lib64/python3.4/json/__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'


Expected results:
playground enabled


Additional info:
Patch that works, but I'm not sure whether it shouldn't be fixed in dnfpluginscore/lib.py..

--- /usr/lib/python3.4/site-packages/dnf-plugins/copr.py.orig	2015-10-01 07:57:41.885483723 +0200
+++ /usr/lib/python3.4/site-packages/dnf-plugins/copr.py	2015-10-01 07:56:25.485292506 +0200
@@ -335,7 +335,7 @@ You are about to enable a Playground rep
 Do you want to continue? [y/N]: """)
         api_url = "{0}/api/playground/list/".format(
             self.copr_url)
-        f = dnfpluginscore.lib.urlopen(self, None, api_url)
+        f = dnfpluginscore.lib.urlopen(self, None, api_url, "w+")
         output = self._get_data(f)
         f.close()
         if output["output"] != "ok":
Comment 1 Miroslav Suchý 2015-10-13 18:43:31 EDT
Fixed in commit:
* aff262d  read file as utf-8 in Py3 (RhBug:1267808)
Comment 2 Fedora Update System 2015-10-14 13:00:12 EDT
dnf-1.1.3-1.fc23 dnf-plugins-extras-0.0.11-1.fc23 dnf-plugins-core-0.1.13-1.fc23 hawkey-0.6.2-1.fc23 libsolv-0.6.14-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-a011ac001a
Comment 3 Fedora Update System 2015-10-14 13:02:02 EDT
dnf-1.1.3-1.fc22 dnf-plugins-extras-0.0.11-1.fc22 dnf-plugins-core-0.1.13-1.fc22 hawkey-0.6.2-1.fc22 libsolv-0.6.14-2.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-02efefba0e
Comment 4 Fedora Update System 2015-10-14 18:52:20 EDT
dnf-1.1.3-1.fc23, dnf-plugins-core-0.1.13-1.fc23, dnf-plugins-extras-0.0.11-1.fc23, hawkey-0.6.2-1.fc23, libsolv-0.6.14-2.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update hawkey dnf-plugins-core dnf-plugins-extras dnf libsolv'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-a011ac001a
Comment 5 Fedora Update System 2015-10-15 01:51:48 EDT
dnf-1.1.3-1.fc22, dnf-plugins-core-0.1.13-1.fc22, dnf-plugins-extras-0.0.11-1.fc22, hawkey-0.6.2-1.fc22, libsolv-0.6.14-2.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update hawkey dnf-plugins-core dnf-plugins-extras dnf libsolv'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-02efefba0e
Comment 6 Fedora Update System 2015-10-17 11:51:20 EDT
dnf-1.1.3-1.fc23, dnf-plugins-core-0.1.13-1.fc23, dnf-plugins-extras-0.0.11-1.fc23, hawkey-0.6.2-1.fc23, libsolv-0.6.14-2.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.
Comment 7 Fedora Update System 2015-10-23 13:19:35 EDT
dnf-1.1.3-1.fc22, dnf-plugins-core-0.1.13-1.fc22, dnf-plugins-extras-0.0.11-1.fc22, hawkey-0.6.2-1.fc22, libsolv-0.6.14-2.fc22 has been pushed to the Fedora 22 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.