[Idle-dev] IDLE bug seen while using BeautifulSoup.py

Tal Einat taleinat at gmail.com
Thu Jul 19 17:07:15 CEST 2007


On 7/18/07, David M. Stoner <dmstoner at utmb.edu> wrote:
>
> I'm not sure if this is the place to submit bug reports.
>
> I'm running IDLE 1.1.1 with Python 2.4.1 on Windows XP.  It generally
> works well.  (Using 2.4 because, last I checked, that was the latest I
> could use with PyGTK+.)
>
> I'm running a simple application testing  Beautiful Soup
> http://www.crummy.com/software/BeautifulSoup/
>
> Source attached.
>
> I get the following error message:
>
> Traceback (most recent call last):
>   File "C:\a1\bin\Python24\dms\HTML_Parse\HTML_Parse.py", line 31, in
> -toplevel-
>     print soup3.body.contents[0]
> TypeError: 'NoneType' object is not callable
>
>
>
> At first I assumed it was a bug in BeautifulSoup,  but it turns out the
> script runs fine straight from the command line and under IPython, so it
> appears IDLE is at fault.
>
> Apologies if this is an old bug fixed in 2.5.
>
I'm getting a "maximum recursion limit reached" exception on my IDLE
1.2, Python 2.5, WinXP.

Congrats, you've found a bug in IDLE! Thank you for reporting it :)

The problem is that soup3.body.contents[0] cannot be pickled, even
though it is an instance of unicode. Try it - calling
pickle.dumps(soup3.body.contents[0]) in the command-line interpreter
(after execfile-ing your script) causes infinite recursion and finally
the above mentioned exception.

This is very bad behavior on behalf of BeautifulSoup! I'll write them
an angry memo ;). But IDLE surely should have a try/except block
around the pickling code, and on failure fall back to whatever it does
for un-pickle-able objects.

I'll submit a bug report on SourceForge, and talk with the
BeautifulSoup guys while I'm at it.

Thanks again for letting us know about this!
- Tal

P.S. I think you meant to call the renderContents method and print the
returned value, instead of printing the method itself.


More information about the IDLE-dev mailing list