GAM-team / GAM-team/got-your-back
UnicodeDecodeError when restoring from eml files
- Dominant language
- Python
- Stars
- 3.1k
- Forks
- 245
- PR merge metrics
- No merged PRs in 30d
Description
Unfortunately I don't think I can provide the email that failed because the import seems to be unordered and I don't believe gyp logs the file being processed before this point.
Wrapping this in error handling, logging the error and filename, and continuing with the restore would be a nice improvement.
```
Traceback (most recent call last):
File "/opt/homebrew/bin/gyb", line 2897, in
main(sys.argv[1:])
~~~~^^^^^^^^^^^^^^
File "/opt/homebrew/bin/gyb", line 2517, in main
message = mbox.next()
File "/opt/homebrew/Cellar/gyb/1.82_1/libexec/lib/python3.13/site-packages/fmbox.py", line 94, in next
msg.set_from(self._last_from_line[5:].decode())
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 70: invalid start byte
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating fmbox.py and the restore path around mbox.next(), which raises the UnicodeDecodeError shown in the report. Reproduce the failure with an .eml containing the problematic byte; done means the filename and decoding error are logged and the restore continues.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100