import smtplib
import argparse
import traceback
+import io
+
from email.message import EmailMessage
# Third party modules
if self.verbose > 1:
LOG.debug("Base directory: {!r}".format(self.base_dir))
+ LOG.debug("STDIN object: {}".format(sys.stdin.__class__.__name__))
+ LOG.debug("Encoding of STDIN: {!r}".format(sys.stdin.encoding))
+
+ LOG.debug("Setting encoding of STDIN to 'UTF-8'.")
+ input_stream = io.TextIOWrapper(sys.stdin.buffer, encoding='UTF-8')
+ if self.verbose > 2:
+ LOG.debug("Encoding of STDIN now: {!r}".format(input_stream.encoding))
- self.data = sys.stdin.read()
+ self.data = input_stream.read()
try:
self.json_data = json.loads(self.data)
if self.verbose > 1: