martinrusev / imbox

Python IMAP for Human beings
MIT License
1.18k stars 188 forks source link

invalid literal for int() with base 10: '' for clause #227

Open vncaragao opened 1 year ago

vncaragao commented 1 year ago

When my code runs "for uid, message in all_inbox_messages:", shows invalid literal for int() with base 10: '' for clause Follows the log.

Exception in thread Thread-535: Traceback (most recent call last): File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/usr/local/lib/python3.8/site-packages/flaskthreads/thread_helpers.py", line 191, in run super().run() File "/usr/local/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/usr/src/app/app/views/omnimail/controllers/ListEmails.py", line 33, in run Email.list(config)
File "/usr/src/app/app/entities/Email.py", line 68, in list for uid, message in all_inbox_messages: File "/usr/local/lib/python3.8/site-packages/imbox/messages.py", line 55, in _fetch_email_list yield uid, self._fetch_email(uid) File "/usr/local/lib/python3.8/site-packages/imbox/messages.py", line 42, in _fetch_email return fetch_email_by_uid(uid=uid, File "/usr/local/lib/python3.8/site-packages/imbox/parser.py", line 155, in fetch_email_by_uid email_object = parse_email(raw_email, policy=parser_policy) File "/usr/local/lib/python3.8/site-packages/imbox/parser.py", line 212, in parse_email attachment = parse_attachment(part) File "/usr/local/lib/python3.8/site-packages/imbox/parser.py", line 122, in parse_attachment filename_parts.insert(int(s_name[1]),value[1:-1] if value.startswith('"') else value) ValueError: invalid literal for int() with base 10: ''

vncaragao commented 1 year ago

I changed the 122th row, mocking a fixed value, works. But i need help.