Looks good.  I would wrap the `try..catch` in a little utility function and use it around *both* cases where `smart_urlquote` is called - we don't know that a similar ValueError couldn't also be raised here. ^^^