]> arthur.barton.de Git - bup.git/commit
metadata: accept only fixed python-xattr in python3
authorJohannes Berg <johannes@sipsolutions.net>
Sun, 12 Jan 2020 23:08:25 +0000 (00:08 +0100)
committerRob Browning <rlb@defaultvalue.org>
Fri, 17 Jan 2020 17:03:32 +0000 (11:03 -0600)
commitbf478211a7b79eb5165f62792f1d739492b9311a
tree035335b077ece2294828af50ba7f845af44d0d42
parent37c1b045a01efa8ddf9345569fe824f167bf48e4
metadata: accept only fixed python-xattr in python3

This is currently broken on python3, it returns junk when
we pass bytes because it uses string and %s internally.
I made a fix for it, so we can detect here if it's fixed
(in which case the NS_USER constant is bytes, not string),
load the module only if it is indeed fixed.

We can do this test always since in python2 bytes == str
and thus isinstance('user', bytes) == True.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/metadata.py