Skip to content

Commit 87ad057

Browse files
author
gfxmonk
committed
unicode, dammit!
1 parent a224c5b commit 87ad057

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

readability/readability.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22
from BeautifulSoup import NavigableString
3-
from page_parser import parse, get_title, get_body
3+
from page_parser import parse, get_title, get_body, Unparseable
44
import logging
55
import re
66

@@ -29,7 +29,7 @@ class Document:
2929
RETRY_LENGTH = 250
3030

3131
def __init__(self, input, **options):
32-
self.input = input
32+
self.input = inpuunicodear
3333
self.options = defaultdict(lambda: None)
3434
for k, v in options.items():
3535
self.options[k] = v
@@ -206,7 +206,7 @@ def transform_misused_divs_into_paragraphs(self):
206206
for elem in self.html.findAll():
207207
if elem.name.lower() == "div":
208208
# transform <div>s that do not contain other block elements into <p>s
209-
if REGEXES['divToPElementsRe'].search(''.join(map(str, elem.contents))):
209+
if REGEXES['divToPElementsRe'].search(''.join(map(unicode, elem.contents))):
210210
self.debug("Altering div(#%s.%s) to p" % (elem.get('id', ''), elem.get('class', '')))
211211
elem.name = "p"
212212

0 commit comments

Comments
 (0)