Getmail throws warnings since python (2 -> 3) changes [solved]

(Peter Aronoff) #1

Now that the python formula points to python3 rather than python2, getmail has some problems.

When I invoke getmail from within mutt, I get this:

 File "/usr/local/bin/getmail", line 64
    except ImportError, o:
SyntaxError: invalid syntax

NB: getmail appears to still work after the warning, but I’m not sure how reliable that is or will be.

I don’t know python well enough to be sure, but I’m guessing that this is an upstream problem. That said, Homebrew might want to do something since I have no idea whether getmail’s maintainer intends to move to python3. I’m happy to help out with a pull request, but I wanted to start here since I have very little sense of python and Hombrew at this point.

Maybe (per this conversation) getmail’s formula should recommend --force installing python@2?

EDIT: This problem is solved. See my post below for a link to the relevant commit, if you’re curious.

(Jacob Ledbetter) #2

This looks like it could be an issue for the GitHub page.

(Peter Aronoff) #3

Okay. I wasn’t sure. The new warnings that pre-populate GitHub issues are so severe that I figured I would start here. I’m assuming that you mean an issue against the getmail formula, right?

(Jacob Ledbetter) #4

Yeah, the formula needs to be updated to support the new python

(Peter Aronoff) #6

Sorry for the noise: I think I misunderstood what you meant by “the formula needs to be updated.” I’m guessing it needs something like the mercurial formula has now.

  depends_on "python@2"

  def install
    ENV.prepend_path "PATH", Formula["python@2"].opt_libexec/"bin"

    system "make", "PREFIX=#{prefix}", "install-bin"

I can try to work on that and submit a pull request.

(Jacob Ledbetter) #7

Looks good to me. The migration has been confusing at best.

(Peter Aronoff) #8

Issue posted on GitHub tracker:

(Peter Aronoff) #9

This problem has been solved by this commit. Thanks all.

(For the record, I tried to put this in the original thread, but I can’t add more than two links there since I’m a “new user.”)

(Jacob Ledbetter) #10

No problem, I can put it as a reference