Problem with chardet integration (need a bytearray)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Beautiful Soup |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I have a fix for this bug. Registering it anyway so I can link this to a fix branch.
Here is the issue: when BeautifulSoup uses chardet, a str is used when a byte array is required. Thus this exception is generated when chardet is used (below). My patch adds the proper code to create a byte array to properly use chardet.
{{{
File "Fetcher.py", line 262, in parse
self._soup = BeautifulSoup(
File "/home/
BeautifulSt
File "/home/
self.
File "/home/
smartQuotes
File "/home/
u = self._convertFr
File "/home/
u.feed(aBuf)
File "/home/
if prober.feed(aBuf) == constants.eFoundIt:
File "/home/
st = prober.feed(aBuf)
File "/home/
codingState = self._mCodingSM
File "/home/
byteCls = self._mModel[
}}}
Related branches
- Leonard Richardson: Pending requested
-
Diff: 14 lines (+3/-1)1 file modifiedBeautifulSoup.py (+3/-1)
Changed in beautifulsoup: | |
assignee: | nobody → Felipe Kellermann (felipekellermann) |
status: | New → Fix Committed |
Changed in beautifulsoup: | |
status: | Fix Committed → Fix Released |
Are you using a custom/ bleeding- edge version of chardet? That might explain why I don't see this error.