By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,957 Members | 1,969 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,957 IT Pros & Developers. It's quick & easy.

getattr/setattr still ASCII-only, not Unicode - blows up SGMLlibfrom BeautifulSoup

P: n/a
Just noticed, again, that getattr/setattr are ASCII-only, and don't support
Unicode.

SGMLlib blows up because of this when faced with a Unicode end tag:

File "/usr/local/lib/python2.5/sgmllib.py", line 353, in finish_endtag
method = getattr(self, 'end_' + tag)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xae'
in position 46: ordinal not in range(128)

Should attributes be restricted to ASCII, or is this a bug?

John Nagle
Mar 13 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.