Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception while processing msg #8

Open
Smotrov opened this issue Feb 24, 2023 · 0 comments
Open

Exception while processing msg #8

Smotrov opened this issue Feb 24, 2023 · 0 comments

Comments

@Smotrov
Copy link

Smotrov commented Feb 24, 2023

Dear bluebird75,
The script is throwing an error.

23:50:28 Progress: msg 173400 of 225509
23:50:29 Progress: msg 173500 of 225509
ERROR 23:50:29 Exception while processing msg with key: 1642324253.M699656P643386.mail,S=3478,W=3548
Traceback (most recent call last):
  File "/Volumes/T7 Touch/MailArchive/maildir2mbox.py", line 205, in <module>
    convert(Path(args.maildir_path), Path(args.mbox_filename), bool(args.recurse))
  File "/Volumes/T7 Touch/MailArchive/maildir2mbox.py", line 105, in convert
    result = maildir2mailbox(maildir_path, mbox_path)
  File "/Volumes/T7 Touch/MailArchive/maildir2mbox.py", line 81, in maildir2mailbox
    mbox.add(msg)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/mailbox.py", line 606, in add
    self._toc[self._next_key] = self._append_message(message)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/mailbox.py", line 761, in _append_message
    offsets = self._install_message(message)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/mailbox.py", line 833, in _install_message
    self._dump_message(message, self._file, self._mangle_from_)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/mailbox.py", line 216, in _dump_message
    gen.flatten(message)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/email/generator.py", line 116, in flatten
    self._write(msg)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/email/generator.py", line 181, in _write
    self._dispatch(msg)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/email/generator.py", line 218, in _dispatch
    meth(msg)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/email/generator.py", line 268, in _handle_multipart
    self.write(subparts)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/email/generator.py", line 410, in write
    self._fp.write(s.encode('ascii', 'surrogateescape'))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 532-537: ordinal not in range(128)

Is there any way to fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant