/usr/bin/pyclean fails with python3

Bug #1633331 reported by semitego
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-defaults (Ubuntu)
Invalid
High
Unassigned
samba (Ubuntu)
Invalid
High
Unassigned

Bug Description

samba

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: python-samba 2:4.3.9+dfsg-0ubuntu0.16.04.2
ProcVersionSignature: Ubuntu 4.4.0-36.55-generic 4.4.16
Uname: Linux 4.4.0-36-generic i686
NonfreeKernelModules: wl
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: i386
Date: Fri Oct 14 08:31:48 2016
ErrorMessage: subprocess new pre-removal script returned error exit status 1
InstallationDate: Installed on 2016-08-05 (69 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release i386 (20140417)
NmbdLog:

RelatedPackageVersions:
 dpkg 1.18.4ubuntu1.1
 apt 1.2.12~ubuntu16.04.1
SambaServerRegression: Yes
SmbConfIncluded: Yes
SmbLog:

SourcePackage: samba
Title: package python-samba 2:4.3.9+dfsg-0ubuntu0.16.04.2 failed to install/upgrade: subprocess new pre-removal script returned error exit status 1
UpgradeStatus: Upgraded to xenial on 2016-08-06 (68 days ago)
WindowsFailedConnect: Yes

Revision history for this message
semitego (ssemitegojames) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Nish Aravamudan (nacc) wrote :

This appears to be a syntax error wrt. to python3. Thank you for reporting this bug!

Changed in samba (Ubuntu):
status: New → Incomplete
status: Incomplete → Triaged
importance: Undecided → High
tags: added: bitesize
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.

tags: removed: bitesize xenial
summary: - package python-samba 2:4.3.9+dfsg-0ubuntu0.16.04.2 failed to
- install/upgrade: subprocess new pre-removal script returned error exit
- status 1
+ /usr/bin/pyclean fails with python3
Changed in python-defaults (Ubuntu):
importance: Undecided → High
Revision history for this message
Barry Warsaw (barry) wrote :

It doesn't really make to be running /usr/bin/pyclean with Python 3. That's why we have /usr/bin/py3clean which is part of python3-minimal. samba isn't even ported to Python 3, so why is it trying to run pyclean as Python 3?

(samba is really the last thing keeping Python 2 on desktop, and it's not just us that's blocked on that.)

Revision history for this message
Barry Warsaw (barry) wrote :

*doesn't really make sense to be running

Revision history for this message
Barry Warsaw (barry) wrote :

Oh I missed this bit:

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

Yeah, don't do that! :)

Revision history for this message
Kai Kasurinen (kai-kasurinen) wrote :

system is tweaked to run /usr/bin/python as python3

Changed in samba (Ubuntu):
status: Triaged → Invalid
Changed in python-defaults (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.