Encode url before using urllib methods [RD-64]

urllib doesn't like unicode. Ensure our url is in an appropriate format before passing it to urllib methods.

All tests pass. If you want to test that this does what I say it does, remove the line that I added and re-run the tests.