Message237180
This changes causes printing BeautifulSoup NavigableString objects to fail; the code actually could never work as `unicode.__getslice__` insists on getting passed in integers, not None.
To reproduce, create a new file in IDLE and paste in:
from bs4 import BeautifulSoup
html_doc = """<title>The Dormouse's story</title>"""
soup = BeautifulSoup(html_doc)
print soup.title.string
Then pick *Run Module* to see:
Traceback (most recent call last):
File "/private/tmp/test.py", line 4, in <module>
print soup.title.string
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/PyShell.py", line 1353, in write
s = unicode.__getslice__(s, None, None)
TypeError: an integer is required
The same error can be induced with:
unicode.__getslice__(u'', None, None)
while specifying a start and end index (0 and len(s)) should fix this. |
|
Date |
User |
Action |
Args |
2015-03-04 14:54:38 | mjpieters | set | recipients:
+ mjpieters, tim.peters, terry.reedy, kbk, ned.deily, roger.serwy, python-dev, serhiy.storchaka |
2015-03-04 14:54:38 | mjpieters | set | messageid: <1425480878.75.0.491044285485.issue19481@psf.upfronthosting.co.za> |
2015-03-04 14:54:38 | mjpieters | link | issue19481 messages |
2015-03-04 14:54:38 | mjpieters | create | |
|