You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't reproduce itstool erroring out. But I can confirm that type(serialized) is str before the encode, and bytes after the encode. Maybe some more recent version of python3 got strict about what gets handed to write? Strange.
$ rm -f help/cs/cs.mo help/cs/about.page; /usr/bin/msgfmt help/cs/cs.po --output-file help/cs/cs.mo && python3 /usr/bin/itstool -m help/cs/cs.mo help/cs/../C/about.page --output help/cs/about.page && /usr/bin/itstool --version
1111 <class 'str'>
1112 <class 'bytes'>
Traceback (most recent call last):
File "/usr/bin/itstool", line 1607, in <module>
fout.write(serialized)
TypeError: write() argument must be str, not bytes
The following section prints 1111 and 1112:
serialized = doc._doc.serialize('utf-8')
if PY3:
print(1111, type(serialized))
# For some reason, under py3, our serialized data is returns as a str.
# Let's encode it to bytes
serialized = serialized.encode('utf-8')
print(1112, type(serialized))
Maybe fout sometimes wants bytes and sometimes str.
I switched our itstool package over to be py3 based - and most things work (after a few hiccups)
One package constantly failing is pitivi, which fails with an error like this:
Interestingly enough, just a couple lines before the error reported, itstool does this:
Skipping the encode works for cs merge, but fails on other languages
The text was updated successfully, but these errors were encountered: