raise UnicodeError, "label too long"

Flavio fccoelho at gmail.com
Wed Jan 24 22:43:24 CET 2007


What I am doing is very simple:

I fetch an url (html page) parse it using BeautifulSoup, extract the
links and try to open each of the links, repeating the cycle.

Beautiful soup converts the html to unicode. That's why when I try to
open the links extracted from the page I get this error.

This is bad, since some links do contain strings with non-ascii
characters.

thanks,

Flávio


Marc 'BlackJack' Rintsch escreveu:
> In <1169672223.231030.262610 at l53g2000cwa.googlegroups.com>, Flavio wrote:
>
> > Hi I am havin a problem with urllib2.urlopen.
> >
> > I get this error when I try to pass a unicode to it.
> >
> > raise UnicodeError, "label too long"
> >
> > is this problem avoidable? no browser or programs such as wget seem to
> > have a problem with these strings.
>
> What exactly are you doing?  How does a (unicode?) string look like that
> triggers this exception?
> 
> Ciao,
> 	Marc 'BlackJack' Rintsch




More information about the Python-list mailing list