[utils] Support xattr as well as pyxattr
authorYen Chi Hsuan <yan12125@gmail.com>
Sat, 1 Oct 2016 12:13:04 +0000 (20:13 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Sat, 1 Oct 2016 12:13:04 +0000 (20:13 +0800)
commit53a7e3d2879feac7b1b6f714692581057b9b5f6b
tree87a4b6e19ec4698bd61a1e851403b72b08c0ac56
parentd54739a2e6a8dc089e7530afda0a1cfe355a6fef
[utils] Support xattr as well as pyxattr

Closes #9054

There are two xattr packages in Python, pyxattr [1] and xattr [2]. They
have different APIs.

In old days pyxattr supports Linux only and xattr supports Linux, Mac,
FreeBSD and Solaris, and pyxattr supports Linux only. Recently pyxattr
adds support for Mac OS X. [3]

An old version of [2] is shipped with Mac OS X. However, some Linux
distributions have pyxattr only, for example PLD-Linux [4] and old Arch
Linux. [5] As a result, supporting both is the way to go.

[1] https://github.com/iustin/pyxattr
[2] https://github.com/xattr/xattr
[3] https://github.com/iustin/pyxattr/pull/9
[4] https://github.com/rg3/youtube-dl/issues/5498
[5] https://git.archlinux.org/svntogit/community.git/commit/?id=427c4c76401e386d865ccddea4fbfdc74df80492
    https://git.archlinux.org/svntogit/community.git/commit/?id=59b40da7b69622a6761d364a8b07909e9cccaa56
    python-xattr is added on 2016/06/29 while pyxattr is there for more
    than 6 years
ChangeLog
youtube_dl/utils.py