[ python-Bugs-1757057 ] IDLE + BeautifulSoup = Error

SourceForge.net noreply at sourceforge.net
Thu Jul 19 20:17:37 CEST 2007


Bugs item #1757057, was opened at 2007-07-19 21:17
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1757057&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: IDLE
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Tal Einat (taleinat)
Assigned to: Nobody/Anonymous (nobody)
Summary: IDLE + BeautifulSoup = Error

Initial Comment:
This bug manifests only when running with a subprocess.

Trying to display an instance of BeautifulSoup's NavigableString class, this is the result:

RuntimeError: maximum recursion depth exceeded

See http://mail.python.org/pipermail/idle-dev/2007-July/002600.html for details (including how to recreate the error).


Diagnosis: The problem arises when trying to pickle such instances - pickle enters an endless loop and reaches the max recursion limit (eventually). This happens regardless of the protocol used.

IDLE is probably trying to pickle them because their class, NavigableString, inherits from unicode, so isinstance(<NavigableString instance>, basestring) return True.

Possibly related to SF bug #1581183: "pickle protocol 2 failure on int subclass"
http://sourceforge.net/tracker/index.php?funchttp://sourceforge.net/tracker/index.php?func=detail&aid=1581183&group_id=5470&atid=105470=detail&aid=1512695&group_id=5470&atid=105470


Fix: IDLE should check for any exception when trying to pickle, not just pickle.PicklingError, to avoid such errors. If pickle doesn't work, for whatever reason, IDLE can still work around it with str() and repr().


I'll post a bug report for Pickle as well.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1757057&group_id=5470


More information about the Python-bugs-list mailing list