aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2019-10-02 12:16:22 +0200
committerMatěj Cepl <mcepl@cepl.eu>2019-10-02 12:16:22 +0200
commitdf2683228cfb151dad3e78a624181af6fc771545 (patch)
tree4ade09a05e15d540a98c04d724a4bac226c1a77e
parentd6b4d3860c4b36d35b9a8a96dcdf49093a139650 (diff)
downloadpygn-df2683228cfb151dad3e78a624181af6fc771545.tar.gz
Fix processing data for post
-rw-r--r--mail2news.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mail2news.py b/mail2news.py
index dd4758c..6e60d4c 100644
--- a/mail2news.py
+++ b/mail2news.py
@@ -27,7 +27,7 @@ from socket import gethostbyaddr, gethostname
import sys
-#logging.basicConfig(level=logging.DEBUG)
+# logging.basicConfig(level=logging.DEBUG)
# This is the single source of Truth
# Yes, it is awkward to have it assymetrically here
# and not in news2mail as well.
@@ -186,7 +186,9 @@ class mail2news(object):
if self.verbose:
server.set_debuglevel(2)
- server.post(StringIO(self.message.as_string()))
+ data = [x.encode() for x in self.message.as_string().split('\n')]
+ logging.debug('data = type %s', type(data))
+ server.post(data)
server.quit()