Commit Graph

23 Commits (b84d311d53a4cc023eb458072c09cf382f45c762)

Author SHA1 Message Date
Yen Chi Hsuan dfe5fa49ae
[compat] Fix compat_shlex_split for non-ASCII input
Closes 
Jaime Marquínez Ferrándiz a9eede3913
[test/compat] compat_shlex_split: test with newlines
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 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․ fad7bbec3a
[test_compat] Remove unused import
Sergey M․ 20cfdcc910
[test_compat] Avoid None values for compat_setenv
Sergey M․ 1292638754
[test_compat] Use compat_setenv
Sergey M․ fe40f9eef2
[compat] Add compat_setenv
Yen Chi Hsuan 92d5477d84 [compat] Handle tuples properly in urlencode()
Fixes 
Sergey M․ e289d6d62c [test_compat] Add tests for compat_urllib_parse_urlencode
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).
Sergey M․ 3513d41436 [test_compat] Fix typo
Sergey M․ ee087c79ad [test_compat] Add test for compat_shlex_split
Sergey M․ 8954e48140 [test_compat] Add tests for compat_urllib_parse_unquote_plus
Sergey M․ d79febcd06 [test_compat] Remove redundant test
Sergey M․ 14309e1ddc [test_compat] Make tests more idiomatic
fnord 4a63291144 Add tests for compat_urllib_parse_unquote
Jaime Marquínez Ferrándiz f56875f271 [test/test_compat] Restore the old value of the HOME environment variable
If the test was run before the YoutubeIE tests (for example by running
"nosetests -v test/test_compat.py test/test_download.py -m 'Youtube_1|compat_expand'"),
it wrote the signatures cache to the 'C:\Documents and Settings\тест\Application Data' folder.
It failed due to a problem in the cache code and the write_json_file function (fixed in f03e33b89a622af13fa5275c46b63aaa4814c499)
Philipp Hagemeister 278143df5b [test_compat] Ignore unicode_literals
Philipp Hagemeister 8c25f81bee [util] Move compatibility functions out of util
utils is large enough without these compatibility functions.

Everything that is present in newer versions of Python (i.e. with dev Python it's just an import) goes into compat.py .
Everything else (i.e. youtube-dl-specific helpers) goes into utils.py .