Bug 1276932

Summary: [abrt] dnf: request.py:1112:do_request_:TypeError: POST data should be bytes or an iterable of bytes. It cannot be of type str.
Product: [Fedora] Fedora Reporter: Ashish Bhurtel <bhurtelashish>
Component: dnf-plugins-coreAssignee: rpm-software-management
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: bhurtelashish, debugger94, dzqnyb, ignatenko, jmracek, jsilhan, makiftasova, martincigorraga, mluscon, mschmidt, packaging-team-maint, pnemade, RadekHolyPublic, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/b8dcbb3a60212780bbfa8e64392e2677795f0742
Whiteboard: abrt_hash:6ac23f1df647659d46fb5611ab47e46bb93f6714;VARIANT_ID=workstation;
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-21 13:27:25 UTC Type: ---
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
File: backtrace
none
File: environ none

Description Ashish Bhurtel 2015-11-01 14:13:05 UTC
Version-Release number of selected component:
dnf-1.1.3-1.fc23

Additional info:
reporter:       libreport-2.6.2
cmdline:        /usr/bin/python3 -OO /bin/dnf copr enable jkoecny/kakoune
executable:     /bin/dnf
kernel:         4.2.5-300.fc23.x86_64
runlevel:       N 5
type:           Python3
uid:            0

Truncated backtrace:
request.py:1112:do_request_:TypeError: POST data should be bytes or an iterable of bytes. It cannot be of type str.

Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/dnfpluginscore/lib.py", line 71, in urlopen
    librepo.download_url(url, fo.fileno(), handle)
  File "/usr/lib64/python3.4/site-packages/librepo/__init__.py", line 1517, in download_url
    return _librepo.download_url(handle, url, fd)
librepo.LibrepoException: (10, 'Status code: 404 for https://copr.fedoraproject.org/coprs/jkoecny/kakoune/repo/fedora-23/', 'Error HTTP/FTP status code')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/dnf-plugins/copr.py", line 249, in _download_repo
    f = dnfpluginscore.lib.urlopen(self, None, self.copr_url + api_path, 'w+')
  File "/usr/lib/python3.4/site-packages/dnfpluginscore/lib.py", line 73, in urlopen
    raise IOError(e.args[1])
OSError: Status code: 404 for https://copr.fedoraproject.org/coprs/jkoecny/kakoune/repo/fedora-23/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/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 1091, in run
    return self.command.run(self.base.extcmds)
  File "/usr/lib/python3.4/site-packages/dnf-plugins/copr.py", line 138, in run
    self._download_repo(project_name, repo_filename, chroot)
  File "/usr/lib/python3.4/site-packages/dnf-plugins/copr.py", line 257, in _download_repo
    res = urllib.request.urlopen(self.copr_url + "/coprs/" + project_name, 'w+')
  File "/usr/lib64/python3.4/urllib/request.py", line 161, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python3.4/urllib/request.py", line 461, in open
    req = meth(req)
  File "/usr/lib64/python3.4/urllib/request.py", line 1112, in do_request_
    raise TypeError(msg)
TypeError: POST data should be bytes or an iterable of bytes. It cannot be of type str.

Local variables in innermost frame:
self: <urllib.request.HTTPSHandler object at 0x7f38ccfa4e10>
request: <urllib.request.Request object at 0x7f38ce482128>
data: 'w+'
msg: 'POST data should be bytes or an iterable of bytes. It cannot be of type str.'
host: 'copr.fedoraproject.org'

Comment 1 Ashish Bhurtel 2015-11-01 14:13:10 UTC
Created attachment 1088361 [details]
File: backtrace

Comment 2 Ashish Bhurtel 2015-11-01 14:13:11 UTC
Created attachment 1088362 [details]
File: environ

Comment 3 Fedora Admin XMLRPC Client 2016-07-08 09:25:51 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Igor Gnatenko 2016-07-21 13:27:25 UTC

*** This bug has been marked as a duplicate of bug 1304615 ***