youtube-dl/youtube_dl
Yen Chi Hsuan 4bd7d9d4ae
[socks] Refine exception model for better error handling
1. ProxyError now inherits from socket.error instead of IOError

The only functions socks.py overrides are connect and connect_ex. In
Python 2.x and Python <= 3.2, socket functions raises socket.error. In
newer Python versions, those functions raises OSError instead. The name
socket.error is preserved as an alias of OSError for backward
compability. To keep socks.py compatible with Python's standard library,
it should raise the same exception as raw sockets.

See PEP 3151 (https://www.python.org/dev/peps/pep-3151/) for more
information about the change in Python 3.3.

2. Raise EOFError instead of IOError when the socket receives less data
than it expects

There's no common convention, but both ftplib and telnetlib raises
EOFError for similar situations. socks.py follows them.

Closes #11355

In #11355, only Python 2 is affected. In Python 3, both socket.error and
IOError are alias of OSError, so AbstractHTTPHandler.do_open correctly
catches the error and thus InfoExtractor._is_valid_url works fine.
2016-12-05 00:43:37 +08:00
..
downloader Update coding style after pycodestyle 2.1.0 2016-11-17 19:45:42 +08:00
extractor [1tv] Improve extraction and add support for playlists (closes #11335) 2016-12-04 23:35:21 +07:00
postprocessor
__init__.py Update coding style after pycodestyle 2.1.0 2016-11-17 19:45:42 +08:00
__main__.py
aes.py Update coding style after pycodestyle 2.1.0 2016-11-17 19:45:42 +08:00
cache.py
compat.py Update coding style after pycodestyle 2.1.0 2016-11-17 19:45:42 +08:00
jsinterp.py [jsinterp] Fix function calls without arguments. 2016-11-11 15:36:57 +01:00
options.py
socks.py [socks] Refine exception model for better error handling 2016-12-05 00:43:37 +08:00
swfinterp.py Update coding style after pycodestyle 2.1.0 2016-11-17 19:45:42 +08:00
update.py
utils.py [utils] Introduce base_url 2016-11-02 02:30:18 +07:00
version.py release 2016.12.01 2016-12-01 00:15:12 +07:00
YoutubeDL.py