Python Element Tree Writing to New File
The ElementTree.write method defaults to us-ascii encoding and as such expects a file opened for writing binary: The output is either a string (str) or binary (bytes). This is controlled by the encoding argument. If encoding is “unicode”, the output is a string; otherwise, it’s binary. Note that this may conflict with the type of … Read more