Bug#864599: python-minimal: pyclean, pycompile and pyversions: Error when /usr/bin/python is python3
Am 11.06.2017 um 12:35 schrieb Piotr Ozarowski: > Control: severity 864599 wishlist > > [Matthias Julius, 2017-06-11] > > /usr/bin/python is not something you should be changing via alternatives Why not? Can there be no legitimate reason for wanting python3 to be the default python? >> File "/usr/bin/pyclean", line 63 >> except (IOError, OSError), e: >> ^ >> SyntaxError: invalid syntax > > if you want Python 3 version of these scripts, use py3compile / py3clean This is not the point. Debconf's install script is apparently using them and they fail if python3 is the default. This makes debconf uninstallable. I don't think this is a bug in debconf. >> #! /usr/bin/python2 >> >> helped. They are apparently not compatible with python3. > > I'm not a fan of python2 - we'll not change /usr/bin/python to > something else than Python 2.X so there's no need to change shebangs. python-policy 2.4.1 says: "Python scripts that require the default Python 2 version should specify python2 as the interpreter name." While that does not say "must" it is still a strong recommendation. And I would also consider that good practice - especially if the fix is so easy. So while this is no policy violation, to me it is more than a "nice to have". But, I will leave it up to you to decide on the proper severity.
Bug#864599: python-minimal: pyclean, pycompile and pyversions: Error when /usr/bin/python is python3
Control: severity 864599 wishlist [Matthias Julius, 2017-06-11] > After setting /usr/bin/python to point to python3 via alternatives the > next update of debconf failed with: /usr/bin/python is not something you should be changing via alternatives > File "/usr/bin/pyclean", line 63 > except (IOError, OSError), e: > ^ > SyntaxError: invalid syntax if you want Python 3 version of these scripts, use py3compile / py3clean > #! /usr/bin/python2 > > helped. They are apparently not compatible with python3. I'm not a fan of python2 - we'll not change /usr/bin/python to something else than Python 2.X so there's no need to change shebangs. /usr/bin/python2 symlink is provided only to workaround damage done by one other distro.
Bug#864599: python-minimal: pyclean, pycompile and pyversions: Error when /usr/bin/python is python3
Package: python-minimal Version: 2.7.13-2 Severity: normal Dear Maintainer, After setting /usr/bin/python to point to python3 via alternatives the next update of debconf failed with: File "/usr/bin/pyclean", line 63 except (IOError, OSError), e: ^ SyntaxError: invalid syntax and File "/usr/bin/pycompile", line 35, in from debpython.version import SUPPORTED, debsorted, vrepr, \ File "/usr/share/python/debpython/version.py", line 24, in from ConfigParser import SafeConfigParser ImportError: No module named 'ConfigParser' pyversions also fails with: File "/usr/bin/pyversions", line 20 except IOError, msg: ^ SyntaxError: invalid syntax Changing the first line of all scripts to #! /usr/bin/python2 helped. They are apparently not compatible with python3. Best regards, Matthias -- System Information: Debian Release: 9.0 APT prefers testing APT policy: (500, 'testing') Architecture: amd64 (x86_64) Kernel: Linux 4.9.0-2-amd64 (SMP w/1 CPU core) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages python-minimal depends on: ii dpkg 1.18.24 ii python2.7-minimal 2.7.13-2 Versions of packages python-minimal recommends: ii python 2.7.13-2 python-minimal suggests no packages. -- debconf information excluded