Hello, I wonder why you are not using requests http://docs.python-requests.org/ It's a great library which could help to have same code for both Python 2 and Python 3. Kind regards