Bug 1227679

Summary: exception when running on python3: TypeError: decoding str is not supported
Product: [Fedora] Fedora Reporter: Michael Stahl <mstahl>
Component: python-feedparserAssignee: Haïkel Guémar <karlthered>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: karlthered, lmacken, louiz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-04 11:48: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:

Description Michael Stahl 2015-06-03 09:55:20 UTC
Description of problem:

running a script that uses python-feedparser, it works successfully
with F21 system Python 2 but with system Python 3 exception is raised:
"TypeError: decoding str is not supported"

Version-Release number of selected component (if applicable):

python3-feedparser-5.1.3-7.fc21.noarch

How reproducible: always

Steps to Reproduce: 

> python3
>>> import feedparser
>>> feedparser.parse("http://bugs.libreoffice.org/buglist.cgi?type0-1-0=changedbefore&field0-1-0=changed&query_format=advanced&ctype=rss&field0-0-0=attachments.mimetype&value0-1-0=2015-06-01&value0-0-0=application/rtf&type0-0-0=equals")

Actual results:

  File "/usr/lib/python3.4/site-packages/feedparser.py", line 3966, in parse
    data, result['encoding'], error = convert_to_utf8(http_headers, data)
  File "/usr/lib/python3.4/site-packages/feedparser.py", line 3768, in convert_to_utf8
    chardet_encoding = str(chardet.detect(data)['encoding'] or '', 'ascii', 'ignore')
TypeError: decoding str is not supported

Expected results:

no exception

Additional info:

the upstream changelog for 5.2.0 mentions this, which looks relevant:

 * Issue 384 (fix chardet support in Python 3)

https://github.com/kurtmckee/feedparser/blob/develop/NEWS

so with any luck upgrade to 5.2.0 should fix it.

Comment 1 Fedora End Of Life 2015-11-04 11:36:14 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. 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 '21'.

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 21 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 2 Michael Stahl 2015-11-04 11:48:41 UTC
python3-feedparser-5.2.0-1.fc22.noarch

can't reproduce, bug apparently fixed in Fedora 22