Yasuhito FUTATSUKI wrote on Mon, Nov 04, 2019 at 11:13:38 +0900:
> On 2019/11/04 8:16, Nathan Hartman wrote:
> > On Sun, Nov 3, 2019 at 12:56 AM Nathan Hartman <hartman.nathan_at_gmail.com>
> > wrote:
> > It seems there's another problem.
> > Apparently the 'raise .. from' construct is Python 3+. Which means
> > this breaks the mailer for Python 2.7. I found this when I tested on
> > Python 2.7 earlier and the script terminated with a syntax error at
> > 'raise MessageSendFailure from detail'.
> > Which do you think is better:
> > Remove the 'from detail' and lose the original cause of
> > MessageSendFailure. MessageSendFailure is meant to be handled and
> > ignored (possibly only used for outputting additional logging),
> > allowing the mailer to continue mailing, so this might be acceptable.
> > Or, alternately:
> > Check which version of Python is running, use 'from detail' only when
> > Python 3+.
> The latter can't accomplish with only single script, because syntax
> error occurs on parse on loading, not on execution. To hide
> 'from detail' from Python 2 interpreter, we should get it out of
> the script.
We could do:
eval("raise MessageSendFailure from detail")
Or we could just keep the «raise … from» construct in there, unconditional, and
bump the script's minimum Python version to 3 on trunk. Analysis:
+ I assume everyone has a py3 interpreter these days, even people whose distros
will continue to support py2 past its EOL date.
+ trunk will be released in April. That's four months _after_ py2's upstream EOL.
- It's possible that some downstreams run distros that will support py2 past
its EOL date, have written py2 code that extends mailer.py, and won't have
gotten around to upgrading their custom extensions to py3 by April.
I suppose this boils down to "Do we want to continue to support py2 after its
upstream EOL because some of our downstreams might do so?" — which is being
discussed in another thread.
Received on 2019-11-04 05:51:01 CET