xattrs dict must be created first, decode xattrs as utf-8
In Python, the JSON encoder cannot process bytes, the JSON specification also does not define a "bytes" type. We are constrained by this in that we cannot serialize data of bytes type. xattrs can be either strings or bytes, in practice they're likely representable as strings, therefore, decode as utf-8, error otherwise. If real world situation of xattrs in true binary format arise then we will rule out another solution.
Showing
Please register or sign in to comment