cover2cover
cover2cover copied to clipboard
Got an error running with Python3
Hi, thanks for this nice conversion script! I found a small error running it under python3:
File "cover2cover.py", line 147
print '<?xml version="1.0" ?>'
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('<?xml version="1.0" ?>')?
Any way to fix that? python2 works fine.
--- cover2cover.py.old 2020-07-13 10:50:27.602377479 +0200
+++ cover2cover.new 2020-07-13 10:50:18.786395875 +0200
@@ -142,12 +143,12 @@
into = ET.Element('coverage')
convert_root(root, into, source_roots)
- print '<?xml version="1.0" ?>'
- print ET.tostring(into)
+ print('<?xml version="1.0" ?>')
+ print(ET.tostring(into))
if __name__ == '__main__':
if len(sys.argv) < 2:
- print "Usage: cover2cover.py FILENAME [SOURCE_ROOTS]"
+ print("Usage: cover2cover.py FILENAME [SOURCE_ROOTS]")
sys.exit(1)
filename = sys.argv[1]
The line print(ET.tostring(into)) prints as a byte string for me; i.e. prefixed by "b'" and ending with "'". To fix that change the line to: print(ET.tostring(into).decode()) I am using python 3.10