Skip to content

Instantly share code, notes, and snippets.

@shreeshga
Created November 5, 2011 05:33
Show Gist options
  • Save shreeshga/1341151 to your computer and use it in GitHub Desktop.
Save shreeshga/1341151 to your computer and use it in GitHub Desktop.
Python unicode pickle error
To solve the below error:
global name '__str__' is not defined
Decode the NavigableString to str and decode to utf-8
ldict['anchor'] = str(link.string).decode('utf-8')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment