Skip to content

Instantly share code, notes, and snippets.

@borwickatuw
Last active October 26, 2023 23:00
Show Gist options
  • Select an option

  • Save borwickatuw/0a253daa7995ad7bbad1e2e903cbdc3b to your computer and use it in GitHub Desktop.

Select an option

Save borwickatuw/0a253daa7995ad7bbad1e2e903cbdc3b to your computer and use it in GitHub Desktop.
workaround for Python offlineimap error "obs_local_part[0].token_type == 'dot'"
--- /old/_header_value_parser.py 2023-10-26 15:58:17.000000000 -0700
+++ /opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/email/_header_value_parser.py 2023-10-26 15:58:29.000000000 -0700
@@ -1513,6 +1513,9 @@
raise
token, value = get_cfws(value)
obs_local_part.append(token)
+ if not obs_local_part:
+ return obs_local_part, value
+
if (obs_local_part[0].token_type == 'dot' or
obs_local_part[0].token_type=='cfws' and
obs_local_part[1].token_type=='dot'):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment