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:

-- 
Jun Omae <[email protected]> (大前 潤)

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/ae1857dd-cbd0-ab1e-8e4a-13f194481eff%40gmail.com.

Reply via email to