about summary refs log tree commit diff
path: root/youtube_dl/socks.py
Commit message (Collapse)AuthorAgeFilesLines
* [socks] Report errors elegantly when credentails are required but missingYen Chi Hsuan2017-04-221-2/+3
| | | | | | In some non-standard implementations, the server may respond AUTH_USER_PASS even if's not listed in available authentication methods. (it should respond AUTH_NO_ACCEPTABLE per standards)
* [socks] Refine exception model for better error handlingYen Chi Hsuan2016-12-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* [socks] Fix error reporting (#11355)Yen Chi Hsuan2016-12-031-1/+1
|
* Update coding style after pycodestyle 2.1.0Yen Chi Hsuan2016-11-171-0/+1
| | | | | | | | | | In pycodestyle 2.1.0, E305 was introduced, which requires two blank lines after top level declarations, too. See https://github.com/PyCQA/pycodestyle/issues/400 See also #10689; thanks @stepshal for first mentioning this issue and initial patches
* Fix misspellingstepshal2016-06-261-1/+1
|
* [socks] Remove a superfluous clauseYen Chi Hsuan2016-05-101-2/+0
|
* [compat] Rename struct_(un)pack to compat_struct_(un)packYen Chi Hsuan2016-05-101-16/+16
|
* [socks] Eliminate magic constants and improveYen Chi Hsuan2016-05-101-131/+156
|
* [socks] Support SOCKS proxiesYen Chi Hsuan2016-05-101-143/+55
|
* [socks] Add socks.py from @bluec0re's public domain implementationYen Chi Hsuan2016-05-101-0/+336
https://gist.github.com/bluec0re/cafd3764412967417fd3