walters added a new comment to an issue you are following:
``
This kobo function (used in a few places in pungi) also looks suspicious:
```
def save_to_file(filename, text, append=False, mode=0o644):
"""Save text to a file."""
if append and os.path.exists(filename):
fd = os.open(filename, os.O_RDWR | os.O_APPEND, mode)
else:
fd = os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, mode)
if not isinstance(text, bytes):
text = bytes(text, encoding=locale.getpreferredencoding())
os.write(fd, text)
os.close(fd)
```
Having one function to create both binary data and text seems odd...given the use cases
I'd just assume any `bytes()` instances are `UTF-8`?
``
To reply, visit the link below or just reply to this email
https://pagure.io/releng/issue/8330