jsumners / jsumners/feedparser

crash when chardet.detect data on python3.4

Open
#429 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-migrated
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

I use feedparser on coreos when i parse a raw str rss string i crash.

  File "/usr/local/lib/python3.4/dist-packages/feedparser.py", line 3966, in parse
    data, result['encoding'], error = convert_to_utf8(http_headers, data)
  File "/usr/local/lib/python3.4/dist-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


change line 3768 

    chardet_encoding = chardet.detect(data)['encoding'] or ''

Fixed!

Original issue reported on code.google.com by lmjubu...@gmail.com on 10 Oct 2014 at 10:04

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect feedparser.py at convert_to_utf8 around line 3768, starting from the parse call shown in the traceback. Verify the behavior when parsing a raw str RSS input under Python 3.4; done means parsing completes without the TypeError and preserves the detected encoding result.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.