Comment 3 for bug 1633331

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi,
Nish is right, this This appears to be a syntax error wrt. to python3.

Orig Xenial release
2:4.3.8+dfsg-0ubuntu1
Current Xenial
2:4.3.11+dfsg-0ubuntu0.16.04.3

And the error seems on pre-removal script according to the log:
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:

In the reported case the versions were:
Reporter prior to update
2:4.3.9+dfsg-0ubuntu0.16.04.2
Trying to update to:
4.3.11+dfsg-0ubuntu0.16.04.1

But just as Nish assumed I think we do not have to look at the samba versions too much, essentially the bug is in /usr/bin/pyclean which is part of "python-minimal".

And in fact the line:
   except (IOError, OSError), e:
Gets highlighted by syntax checkers as:
"Python 3.x incompatible 'except x,y:' construct [H231]"

The code is still as-is on Zesty with #! /usr/bin/python.

I'd assume this only triggers when the system is tweaked to run /usr/bin/python as python3?
Does that match your case?

Quick verify:
$ python2.7 /usr/bin/pyclean
Usage: pyclean [-p PACKAGE] [DIR_OR_FILE]

$ python3.5 /usr/bin/pyclean
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
SyntaxError: invalid syntax

Therefore I'd file it against python-defaults and subscribe Barry as he is way deeper into the future of py2/py3 transition.