Commit Graph

82 Commits (af85ce29c61749676ab934a2b297505ab33bf4c7)

Author SHA1 Message Date
Tatsuyuki Ishi 2384f5a64e
[mixcloud] Fix extraction (closes )
Sergey M․ b08e235f09
[compat] Fix compat_shlex_quote on Windows (closes , closes )
Sergey M․ b081f53b08
[compat] Add compat_HTMLParseError to __all__
Sergey M․ 72b409559c
[compat] Introduce compat_HTMLParseError
Remita Amine 40fcba5edb improve coding style
Sergey M․ 831217291a
[compat] Use try except for compat_numeric_types
Sergey M․ 28572a1a0b [compat] Add compat_numeric_types
Remita Amine da162c1135 [compat] add compat_etree_register_namespace to __all__ list
Remita Amine c2d9c25f81 [compat] add compat_etree_register_namespace
Yen Chi Hsuan ec85ded83c
Fix "invalid escape sequences" error on Python 3.6
Yen Chi Hsuan 582be35847
Update coding style after pycodestyle 2.1.0
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 ; thanks @stepshal for first mentioning this issue and
initial patches
Yen Chi Hsuan ec3518725b
[compat] Fix test_cmdline_umlauts on Python 2.6
The original statement raises uncaught UnicodeWarning on Python 2.6
Yen Chi Hsuan dfe5fa49ae
[compat] Fix compat_shlex_split for non-ASCII input
Closes 
Yen Chi Hsuan 836ab0c554
[compat] Import html5 entities correctly
Yen Chi Hsuan 9631a94fb5
[compat] Add compat_html_entities_html5
Used in tset_Vporn_1. Also Related to 
Jaime Marquínez Ferrándiz e67f688025 [compat] Add 'compat_input' to __all__
Sergey M․ 1ae6c83bce
[compat] Add compat_input
Yen Chi Hsuan eb7941e3e6
[compat] Fix for XML with <!DOCTYPE> in Python 2.7 and 3.2
Such XML documents cause DeprecationWarning if python is run
with `-W error`
Yen Chi Hsuan 702ccf2dc0
[compat] Rename shlex_quote and remove unused subprocess_check_output
Yen Chi Hsuan edaa23f822
[compat] Rename struct_(un)pack to compat_struct_(un)pack
Yen Chi Hsuan dab0daeeb0
[utils,compat] Move struct_pack and struct_unpack to compat.py
Sergey M․ fe40f9eef2
[compat] Add compat_setenv
Yen Chi Hsuan 92d5477d84 [compat] Handle tuples properly in urlencode()
Fixes 
Sergey M․ 15707c7e02 [compat] Add compat_urllib_parse_urlencode and eliminate encode_dict
encode_dict functionality has been improved and moved directly into compat_urllib_parse_urlencode
All occurrences of compat_urllib_parse.urlencode throughout the codebase have been replaced by compat_urllib_parse_urlencode

Closes 
Sergey M․ 57f7e3c62d [compat] Add compat_xpath
remitamine 83548824c2 Merge pull request from bpfoley/twitter-thumbnail
[utils] Add extract_attributes for extracting html tag attributes
Yen Chi Hsuan e9c0cdd389 [jython] Introduce compat_os_name
os.name is always 'java' on Jython
Brian Foley 8bb56eeeea [utils] Add extract_attributes for extracting html tag attributes
This is much more robust than just using regexps, and handles all
the common scenarios, such as empty/no values, repeated attributes,
entity decoding, mixed case names, and the different possible value
quoting schemes.
Sergey M․ 611c1dd96e [refactor] Single quotes consistency
Yen Chi Hsuan 614db89ae3 [compat] Clarify the versions requiring compat_kwargs
It's supported since 2.7.0 alpha 1 and 2.6.5 rc 1. See
https://hg.python.org/cpython/file/v2.7a1/Misc/NEWS#l337
https://hg.python.org/cpython/file/v2.6.5rc1/Misc/NEWS#l28
Sergey M․ 67dda51722 Rename compat_urllib_request_Request to sanitized_Request and move to utils
Sergey M․ 13a10d5aa3 [compat] Add compat_urllib_request_Request
This is actually not a compatibility routine but rather a workaround for URLs without protocol specified.
The protocol-less URL is treated as HTTP one since it's most probable scenario and it will most likely to
redirect to HTTPS if HTTPS was actually expected. This routine could also be useful for any Request
preprocessing that may be added in future.
Jaime Marquínez Ferrándiz ae37338e68 [compat] compat_etree_fromstring: clarify comment
Jaime Marquínez Ferrándiz f78546272c [compat] compat_etree_fromstring: also decode the text attribute
Deletes parse_xml from utils, because it also does it.
Jaime Marquínez Ferrándiz 387db16a78 [compat] compat_etree_fromstring: only decode bytes objects
Jaime Marquínez Ferrándiz 36e6f62cd0 Use a wrapper around xml.etree.ElementTree.fromstring in python 2.x ()
Attributes aren't unicode objects, so they couldn't be directly used in info_dict fields (for example '--write-description' doesn't work with bytes).
Yen Chi Hsuan 0a67a3632b [compat] Add compat_urllib_request_DataHandler
Sergey M․ f2dbc54066 [compat] Fix wrong lines/columns order
stty size is rows x columns
Philipp Hagemeister 4810c48d6d [compat] Do not compare None <= 0
The result is meaningless (and it emits a warning in cpython2 when called with -3), so handle None before making integer comparisons.
Yen Chi Hsuan 13118a50b8 [compat] Allow overriding by only COLUMNS or LINES in compat_get_terminal_size
Now the semantic of this function is identical to
shutil.get_terminal_size() in Python 3.3+. The new behavior also
corresponds to the old get_term_width(), which is removed in
003c69a84b
Philipp Hagemeister 953fed280f [compat] Do not use unicode
If the code ever runs on 3.x, it would fail. Even if it never does, the unicode name confuses Python 3 code analysis tools.
Sergey M․ 8df5ae15d1 [compat] Fix python version check for compat_shlex_split
Sergey M․ 51f579b635 [compat] Add compat shlex.split
Jaime Marquínez Ferrándiz 03950c90f7 Merge remote-tracking branch 'jaimemf/format_spec_groups' (closes )
remitamine 799207e838 [viewster] extract the api auth token
Closes .
Sergey M․ 22603348aa [compat] Fix _asciire
Sergey M․ 3cc8b4c327 [compat] Fix missing _asciire on python 2.6
Sergey M․ 4d08161ac2 [compat] Mention unquote_plus
Sergey M․ aa99aa4e85 [compat] Add compat_urllib_parse_unquote_plus
Sergey M․ 5513967926 [compat] Simplify and use latest cpython 3 code