buffalob wrote: > When my TG code, which otherwise works fine, processes certain > instances of external data from the web it occasionally crashes with > a > "type error: function takes exactly 5 arguments (1 given)" > > I think I've narrowed down the data that is causing it to happen and > theorize the problem occurs in some behind the scenes unicode > functionality that TG does in it's Kid processing modules but only > when a character such as "&#151" is present in the data.
I think — is actually an invalid code, since 151 is part of cp1252 and does not exist in latin-1/unicode, but most browsers will probably treat this as cp1252. The problem is that your html_stripper.stip() method parses and outputs numeric entities between 0 and 255 (this is how the SGMLParser operates), and then Kid doesn't know how to handle these characters, and to increase the confusion, Kid outputs a wrong error message, probably becasuse of this Python bug: http://sf.net/tracker/?func=detail&aid=1748292&group_id=5470&atid=105470). A quick and dirty fix would be this: modified_summary = html_stripper.strip(safe_summary).decode('cp1252') -- Chris --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

