On 2023/07/12 20:31, Frank R. wrote:
> Traceback (most recent call last):
> File "/usr/local/bin/email2trac", line 2948, in <module>
> tktparser.save_email_for_debug(m, settings.project_name)
> File "/usr/local/bin/email2trac", line 620, in save_email_for_debug
> fx.write(('%s' % message).encode())
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1424: ordinal not in range(128)
Try the following patch:
--- email2trac.orig 2023-07-13 07:43:25.588875000 +0900
+++ email2trac 2023-07-13 07:46:07.313533000 +0900
@@ -617,7 +617,10 @@
fx = os.fdopen(fd, 'wb')
self.logger.debug('saving email to %s' %(tmp_file))
- fx.write(('%s' % message).encode())
+ data = '%s' % message
+ if isinstance(data, unicode):
+ data = data.encode('utf-8')
+ fx.write(data)
fx.close()
try: