Getmail failure: invalid syntax

Table of Contents

img

getmail -rmymail.conf File “/usr/bin/getmail”, line 64 except ImportError, o: ^ SyntaxError: invalid syntax

It turns out, the service I use to collect my email, getmail, requires python 2; I’d forgotten this (if I ever knew it) and made python 3 my system default (I rebound the “python” command to 3 instead of 2) and so it failed. I didn’t realize this until 16 hours later wondering why I wasn’t getting my mail, and digging into my scripts, evaluating line by line, I finally got the above error. When looking at that actual file I saw it started with a comment mentioning the requirement of Python 2. I made /usr/bin/python point back to 2 instead of 3 and all was happy again.

So, be careful; even if you think you don’t use enough python to require Python 2, you might be wrong.

Tory Anderson avatar
Tory Anderson
Full-time Web App Engineer, Digital Humanist, Researcher, Computer Psychologist