[utils] Encode hostnames before passing to urllib
authorYen Chi Hsuan <yan12125@gmail.com>
Wed, 23 Mar 2016 14:24:52 +0000 (22:24 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Wed, 23 Mar 2016 14:24:52 +0000 (22:24 +0800)
commitefbed08dc20c530fe428256e4dcbea4dc4423d0d
tree836f73a2f8b9f8b2f528619ec13374e42decce32
parent7da2c87119db8beda1bdc979fad38c08fc1252e9
[utils] Encode hostnames before passing to urllib

With IDN (Internationalized Domain Name) and a proxy, non-ascii URLs
are passed down to urllib/urllib2, causing UnicodeEncodeError

Fixes #8890
test/test_http.py
youtube_dl/utils.py