Fix URLError (python3) and add test for invalid server url, including logging