python3 in /usr/local/bin can cause python3 packages to fail to install

Bug #1682934 reported by Brian Kelly
152
This bug affects 28 people
Affects Status Importance Assigned to Milestone
python2.7 (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Fix Released
Undecided
Unassigned
Zesty
Fix Committed
Undecided
Unassigned
python3.5 (Debian)
Fix Released
Unknown
python3.5 (Ubuntu)
Fix Released
High
Unassigned
Xenial
Fix Released
High
Brian Murray
Zesty
Fix Released
High
Brian Murray

Bug Description

[Impact]
An upgrade of python3.5 will fail if someone has installed a different version of python3.5 in their path e.g. in /usr/local/bin. This is because the postinst scripts do not specify the complete path to python3.5.

[Test Case]
1) Ensure the version of python3.5 from the release pocket is installed
2) Install python3 using the instructions at https://passingcuriosity.com/2015/installing-python-from-source/
3) Confirm that python3.5 from /usr/local/bin/ is being used / the default
4) Upgrade to a newer version of python3.5 from -proposed

Observe the following Traceback:

Setting up python3.5-minimal (3.5.3-1) ...
Traceback (most recent call last):
  File "/usr/lib/python3.5/py_compile.py", line 6, in <module>
    import importlib._bootstrap_external
  File "/usr/lib/python3.5/importlib/__init__.py", line 57, in <module>
    import types
  File "/usr/lib/python3.5/types.py", line 166, in <module>
    import functools as _functools
  File "/usr/lib/python3.5/functools.py", line 23, in <module>
    from weakref import WeakKeyDictionary
  File "/usr/lib/python3.5/weakref.py", line 12, in <module>
    from _weakref import (
ImportError: cannot import name '_remove_dead_weakref'
dpkg: error processing package python3.5-minimal (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python3-minimal:
 python3-minimal depends on python3.5-minimal (>= 3.5.3-1~); however:
  Package python3.5-minimal is not configured yet.

dpkg: error processing package python3-minimal (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 python3.5-minimal
 python3-minimal

With the version of python3.5 from -proposed this Traceback will not be encountered.

[Regression Potential]
It's possible I missed a postinst script so other python3.5 binary packages should be installed to ensure they are all fixed e.g. python3.5-dbg.

[Original Description]
Got this error while using "Transmageddon Video Transcoder" and again while updating 16.10 to 17.04.

Seems to have something to do with needing that Python3 version for Teletext decoding in media that is in transport stream format (.ts).

ProblemType: PackageDistroRelease: Ubuntu 17.04
Package: python3 3.5.1-4
ProcVersionSignature: Ubuntu 4.10.0-19.21-generic 4.10.8
Uname: Linux 4.10.0-19-generic x86_64
ApportVersion: 2.20.4-0ubuntu4
Architecture: amd64
Date: Fri Apr 14 19:27:33 2017
ErrorMessage: pre-dependency problem - not installing python3
InstallationDate: Installed on 2015-05-01 (714 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Release amd64 (20150422)
RelatedPackageVersions:
 dpkg 1.18.10ubuntu2
 apt 1.4SourcePackage: python3-defaults
Title: package python3 3.5.1-4 failed to install/upgrade: pre-dependency problem - not installing python3
UpgradeStatus: Upgraded to zesty on 2017-04-14 (0 days ago)

Revision history for this message
Brian Kelly (betwixt) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python3-defaults (Ubuntu):
status: New → Confirmed
tags: removed: need-duplicate-check
Revision history for this message
Dave Kuhlman (dkuhlman) wrote :
Download full text (4.8 KiB)

I attempted to upgrade to Ubuntu 17.04 zesty. That seems to have failed. Now, when I do `sudo aptitude full-upgrade`, I get the following error messages:

# =====================================================================
The following packages will be upgraded:
  python3
The following partially installed packages will be configured:
  gedit python3-minimal python3-uno python3.5 python3.5-minimal
  rhythmbox-plugin-magnatune rhythmbox-plugins ubuntu-gnome-desktop
1 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/8,696 B of archives. After unpacking 0 B will be used.
Do you want to continue? [Y/n/?]
Setting up python3.5-minimal (3.5.3-1) ...
Traceback (most recent call last):
  File "/usr/lib/python3.5/py_compile.py", line 6, in <module>
    import importlib._bootstrap_external
  File "/usr/lib/python3.5/importlib/__init__.py", line 57, in <module>
    import types
  File "/usr/lib/python3.5/types.py", line 166, in <module>
    import functools as _functools
  File "/usr/lib/python3.5/functools.py", line 23, in <module>
    from weakref import WeakKeyDictionary
  File "/usr/lib/python3.5/weakref.py", line 12, in <module>
    from _weakref import (
ImportError: cannot import name '_remove_dead_weakref'
dpkg: error processing package python3.5-minimal (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python3-minimal:
 python3-minimal depends on python3.5-minimal (>= 3.5.3-1~); however:
  Package python3.5-minimal is not configured yet.

dpkg: error processing package python3-minimal (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                Errors were encountered while processing:
 python3.5-minimal
 python3-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)
Setting up python3.5-minimal (3.5.3-1) ...
Traceback (most recent call last):
  File "/usr/lib/python3.5/py_compile.py", line 6, in <module>
    import importlib._bootstrap_external
  File "/usr/lib/python3.5/importlib/__init__.py", line 57, in <module>
    import types
  File "/usr/lib/python3.5/types.py", line 166, in <module>
    import functools as _functools
  File "/usr/lib/python3.5/functools.py", line 23, in <module>
    from weakref import WeakKeyDictionary
  File "/usr/lib/python3.5/weakref.py", line 12, in <module>
    from _weakref import (
ImportError: cannot import name '_remove_dead_weakref'
dpkg: error processing package python3.5-minimal (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python3-minimal:
 python3-minimal depends on python3.5-minimal (>= 3.5.3-1~); however:
  Package python3.5-minimal is not configured yet.

dpkg: error processing package python3-minimal (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3.5:
 python3.5 depends on python3.5-minimal (= 3.5.3-1); however:
  Package python3.5-minimal is not configured yet.

dpkg: error proc...

Read more...

Revision history for this message
Brian Murray (brian-murray) wrote :

How did you go about upgrading from 16.10 to 17.04? If you used ubuntu-release-upgrader please include the logs in /var/log/dist-upgrade/ so I can better sort out how things went awry.

Revision history for this message
Brian Kelly (betwixt) wrote : Re: [Bug 1682934] Re: package python3 3.5.1-4 failed to install/upgrade: pre-dependency problem - not installing python3

On 18/04/2017 21:48, Brian Murray wrote:
> How did you go about upgrading from 16.10 to 17.04? If you used ubuntu-
> release-upgrader please include the logs in /var/log/dist-upgrade/ so I
> can better sort out how things went awry.
>

The upgrade was from the GUI following a regular update. I followed the
'new version is available' route and accepted the defaults at each stage
of warnings about removing old packages.

There are 5.8Mb of files under /var/log/dist-upgrade on my machine, do
you need them all? I ask because 'broadband' here means 0.1Mb/s so it's
a long upload for me!

Brian.

Revision history for this message
Brian Murray (brian-murray) wrote :

On Wed, Apr 19, 2017 at 03:09:41PM -0000, Brian Kelly wrote:
> On 18/04/2017 21:48, Brian Murray wrote:
> > How did you go about upgrading from 16.10 to 17.04? If you used ubuntu-
> > release-upgrader please include the logs in /var/log/dist-upgrade/ so I
> > can better sort out how things went awry.
> >
>
> The upgrade was from the GUI following a regular update. I followed the
> 'new version is available' route and accepted the defaults at each stage
> of warnings about removing old packages.
>
> There are 5.8Mb of files under /var/log/dist-upgrade on my machine, do
> you need them all? I ask because 'broadband' here means 0.1Mb/s so it's
> a long upload for me!

The sub-directories should be about previous release upgrades, so those
won't be necessary. You could confirm you are uploading the right log
files by looking at the 'main.log' file and checking the date in it in
addition to looking for the right releases in lines with PreCacheOpen
and PostInitialUpdate.

The file 'apt-clone_system_state.tar.gz' may not necessary so you can
skip that in your initial upload.

--
Brian Murray

Revision history for this message
Dave Kuhlman (dkuhlman) wrote : Re: package python3 3.5.1-4 failed to install/upgrade: pre-dependency problem - not installing python3

This comment pertains to the bug report/comment by my above, and *not* to the bug originally reported by Brian Kelly, I believe.

I upgraded 4 machine. Two of those machines had Python 3 installed under /usr/local (from source). The other two did not have Python 3 installed under /usr/local. The two machines with Python 3 at /usr/local failed during the upgrade; the two that did not have Python 3 under /usr/local did not fail.

So, I removed Python 3 from /usr/local/bin and /usr/local/lib. Now, I can run `sudo aptitude full-upgrade` without failures.

Is it possible that this means that there is some Python script that is run during the install/upgrade than has "#!/usr/bin/env python3" at the top and that is being run as:

    $ ./somescript.py

instead of as:

    $ python3 ./somescript.py

Although, since "local" does not seem to show up in the traceback, I'm not sure ...

Revision history for this message
Brian Kelly (betwixt) wrote : Re: [Bug 1682934] Re: package python3 3.5.1-4 failed to install/upgrade: pre-dependency problem - not installing python3
Download full text (3.4 KiB)

Hopefully I've attached the right files you need.

At the moment, I can't run updates because the same error pops up. At
boot I get a red 'STOP' icon in the top right corner of the menu bar and
if I try to update I get a message telling me the "Package system is
broken". Following the instruction to run "apt-get install -f" results
in a list of 'no longer needed' files then:
"The following additional packages will be installed: python3"
"The following packages will be upgraded: python3"
"1 to upgrade, 0 to newly install, 0 to remove and 10 not to upgrade."
"10 not fully installed or removed"
"Need to get 0B/8,696 B of archives"
"After this operation 0B of additional disk space will be needed"

After continuing, this is the dialog:

Do you want to continue? [Y/n] y
Setting up python3.5-minimal (3.5.3-1) ...
Traceback (most recent call last):
   File "/usr/lib/python3.5/py_compile.py", line 6, in <module>
     import importlib._bootstrap_external
   File "/usr/lib/python3.5/importlib/__init__.py", line 57, in <module>
     import types
   File "/usr/lib/python3.5/types.py", line 166, in <module>
     import functools as _functools
   File "/usr/lib/python3.5/functools.py", line 23, in <module>
     from weakref import WeakKeyDictionary
   File "/usr/lib/python3.5/weakref.py", line 12, in <module>
     from _weakref import (
ImportError: cannot import name '_remove_dead_weakref'
dpkg: error processing package python3.5-minimal (--configure):
  subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python3-minimal:
  python3-minimal depends on python3.5-minimal (>= 3.5.3-1~); however:
   Package python3.5-minimal is not configured yet.

dpkg: error processing package python3-minimal (--configure):
  dependency problems - leaving unconfigured
No apport report written because the error message indicates it's a
follow-up error from a previous failure.
                             Errors were encountered while processing:
  python3.5-minimal
  python3-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)
brian@VideoEd-Linux:~$

I hope this is helpful. I have not tried removing python references from
/usr/local as Dave Kuhlman tried but unless any other ideas come up,
I'll try that shortly.

Brian Kelly.

On 19/04/2017 16:37, Brian Murray wrote:
> On Wed, Apr 19, 2017 at 03:09:41PM -0000, Brian Kelly wrote:
>> On 18/04/2017 21:48, Brian Murray wrote:
>>> How did you go about upgrading from 16.10 to 17.04? If you used ubuntu-
>>> release-upgrader please include the logs in /var/log/dist-upgrade/ so I
>>> can better sort out how things went awry.
>>>
>>
>> The upgrade was from the GUI following a regular update. I followed the
>> 'new version is available' route and accepted the defaults at each stage
>> of warnings about removing old packages.
>>
>> There are 5.8Mb of files under /var/log/dist-upgrade on my machine, do
>> you need them all? I ask because 'broadband' here means 0.1Mb/s so it's
>> a long upload for me!
>
> The sub-directories should be about previous release upgrades, so those
> won't be necessary. You could confirm you are uploading the right log
>...

Read more...

Revision history for this message
Brian Murray (brian-murray) wrote : Re: package python3 3.5.1-4 failed to install/upgrade: pre-dependency problem - not installing python3

In Brian Kelley's report we can see the following in main.log:

4 2017-04-14 13:27:43,632 INFO python version: '3.5.2+ (default, Sep 22 2016, 12:18:14) 5 [GCC 6.2.0 20160927]'

This matches the output of sys.version on my yakkety system:

 $ python3
Python 3.5.2+ (default, Sep 22 2016, 12:18:14)
[GCC 6.2.0 20160927] on linux

Revision history for this message
Brian Murray (brian-murray) wrote :

I tested installing python3 using the instructions at https://passingcuriosity.com/2015/installing-python-from-source/ and sure enough I received the same Traceback.

Setting up python3.5-minimal (3.5.3-1) ...
Traceback (most recent call last):
  File "/usr/lib/python3.5/py_compile.py", line 6, in <module>
    import importlib._bootstrap_external
  File "/usr/lib/python3.5/importlib/__init__.py", line 57, in <module>
    import types
  File "/usr/lib/python3.5/types.py", line 166, in <module>
    import functools as _functools
  File "/usr/lib/python3.5/functools.py", line 23, in <module>
    from weakref import WeakKeyDictionary
  File "/usr/lib/python3.5/weakref.py", line 12, in <module>
    from _weakref import (
ImportError: cannot import name '_remove_dead_weakref'
dpkg: error processing package python3.5-minimal (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python3-minimal:
 python3-minimal depends on python3.5-minimal (>= 3.5.3-1~); however:
  Package python3.5-minimal is not configured yet.

dpkg: error processing package python3-minimal (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 python3.5-minimal
 python3-minimal

Once I removed /usr/local/bin/python3.5 I was then able to fix the upgrade via 'sudo apt-get -f install'.

Revision history for this message
Brian Kelly (betwixt) wrote : Re: [Bug 1682934] Re: package python3 3.5.1-4 failed to install/upgrade: pre-dependency problem - not installing python3

I too removed the references from /usr/local/lib and also from
/usr/local/bin and ran the 'sudo apt-get -f install' and it fixed
everything, including re-installing and configuring Python 3.5.

I suspect I caused the problem by manually installing Python to get
around the missing library problem I got when trying to run
'Transmageddon' so it points to a Python installer issue rather than
Ubuntu per se.

Interestingly if I type 'python' in a Terminal window it says I have
version 2.7.13 installed, even after the fix and update. Typing
'python3' says 3.5.3 is installed with a slightly earlier date than the
2.7 version.

Brian.

On 26/04/2017 00:31, Brian Murray wrote:
> I tested installing python3 using the instructions at
> https://passingcuriosity.com/2015/installing-python-from-source/ and
> sure enough I received the same Traceback.
>
> Setting up python3.5-minimal (3.5.3-1) ...
> Traceback (most recent call last):
> File "/usr/lib/python3.5/py_compile.py", line 6, in <module>
> import importlib._bootstrap_external
> File "/usr/lib/python3.5/importlib/__init__.py", line 57, in <module>
> import types
> File "/usr/lib/python3.5/types.py", line 166, in <module>
> import functools as _functools
> File "/usr/lib/python3.5/functools.py", line 23, in <module>
> from weakref import WeakKeyDictionary
> File "/usr/lib/python3.5/weakref.py", line 12, in <module>
> from _weakref import (
> ImportError: cannot import name '_remove_dead_weakref'
> dpkg: error processing package python3.5-minimal (--configure):
> subprocess installed post-installation script returned error exit status 1
> dpkg: dependency problems prevent configuration of python3-minimal:
> python3-minimal depends on python3.5-minimal (>= 3.5.3-1~); however:
> Package python3.5-minimal is not configured yet.
>
> dpkg: error processing package python3-minimal (--configure):
> dependency problems - leaving unconfigured
> No apport report written because the error message indicates its a followup error from a previous failure.
> Errors were encountered while processing:
> python3.5-minimal
> python3-minimal
>
> Once I removed /usr/local/bin/python3.5 I was then able to fix the
> upgrade via 'sudo apt-get -f install'.
>

Revision history for this message
Adam Conrad (adconrad) wrote : Re: package python3 3.5.1-4 failed to install/upgrade: pre-dependency problem - not installing python3

The problem here is that python's postinst scripts call python without a qualified path:

(base)adconrad@nosferatu:~/py/python3.5-3.5.3$ rgrep '@PVER@ -E'
debian/libPVER-testsuite.postinst.in: @PVER@ -E -S /usr/lib/@PVER@/py_compile.py $files
debian/libPVER-testsuite.postinst.in: @PVER@ -E -S -O /usr/lib/@PVER@/py_compile.py $files
debian/PVER-dbg.postinst.in: @PVER@ -E -S /usr/lib/@PVER@/py_compile.py $files
debian/PVER-dbg.postinst.in: @PVER@ -E -S -O /usr/lib/@PVER@/py_compile.py $files
debian/PVER-venv.postinst.in: @PVER@ -E -S /usr/lib/@PVER@/py_compile.py $files
debian/PVER-venv.postinst.in: @PVER@ -E -S -O /usr/lib/@PVER@/py_compile.py $files
debian/PVER-minimal.postinst.in: @PVER@ -E -S /usr/lib/@PVER@/py_compile.py $files
debian/PVER-minimal.postinst.in: @PVER@ -E -S -O /usr/lib/@PVER@/py_compile.py $files
debian/PVER.postinst.in: @PVER@ -E -S /usr/lib/@PVER@/py_compile.py $files
debian/PVER.postinst.in: @PVER@ -E -S -O /usr/lib/@PVER@/py_compile.py $files

All of those should have /usr/bin prepended to make sure we're getting the *right* python. Odds are this same bug is in all python versions (or, at least, all python3 versions), given they likely share common packaging, as evidenced by the magic @PVER@ substitution.

summary: - package python3 3.5.1-4 failed to install/upgrade: pre-dependency
- problem - not installing python3
+ python3 in /usr/local/bin can cause python3 packages to fail to install
Changed in python3-defaults (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → High
Matthias Klose (doko)
affects: python3-defaults (Ubuntu) → python3.5 (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python3.5 - 3.5.3-3

---------------
python3.5 (3.5.3-3) unstable; urgency=medium

  * Update symbols files.

 -- Matthias Klose <email address hidden> Wed, 07 Jun 2017 16:23:48 -0700

Changed in python3.5 (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python2.7 (Ubuntu):
status: New → Confirmed
Steve Langasek (vorlon)
Changed in python3.5 (Ubuntu Xenial):
assignee: nobody → Matthias Klose (doko)
Matthias Klose (doko)
no longer affects: python2.7 (Ubuntu Yakkety)
no longer affects: python3.5 (Ubuntu Yakkety)
Revision history for this message
Chris Halse Rogers (raof) wrote : Proposed package upload rejected

An upload of python3.5 to xenial-proposed has been rejected from the upload queue for the following reason: "Bug# 1682934 is missing SRU testcase/impact/regresison potential; all bugs are missing a Zesty upload which is requried before we could release the Xenial update.".

Changed in python3.5 (Debian):
status: Unknown → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python2.7 - 2.7.14~rc1-3ubuntu1

---------------
python2.7 (2.7.14~rc1-3ubuntu1) artful; urgency=medium

  * Regenerate the _PyFPE breaks list for Ubuntu.

 -- Matthias Klose <email address hidden> Tue, 05 Sep 2017 20:19:52 +0200

Changed in python2.7 (Ubuntu):
status: Confirmed → Fix Released
Changed in python3.5 (Ubuntu Xenial):
status: New → In Progress
assignee: Matthias Klose (doko) → Brian Murray (brian-murray)
importance: Undecided → High
Changed in python3.5 (Ubuntu Zesty):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Brian Murray (brian-murray)
description: updated
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Brian, or anyone else affected,

Accepted python3.5 into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python3.5/3.5.3-1ubuntu0~17.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-zesty to verification-done-zesty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-zesty. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in python3.5 (Ubuntu Zesty):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-zesty
Changed in python3.5 (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed-xenial
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Brian, or anyone else affected,

Accepted python3.5 into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python3.5/3.5.2-2ubuntu0~16.04.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Brian Murray (brian-murray) wrote :

I tried recreating the bug as described in the description and py_compile.py in the version of python3.5 on Xenial does not import _remove_dead_weakref so there is not Traceback when trying to reinstall python3.5 after installing python3.5 in /usr/local/bin. However, its still possible to verify the fix by confirming that the file /var/lib/dpkg/python3.5.postinst and other postinst scripts now use the full path to python3.5 when calling py_compile.py e.g.:

bdmurray@clean-xenial-amd64:/var/lib/dpkg/info$ grep "py_compile.py" *.postinst
python2.7-minimal.postinst: python2.7 -E -S /usr/lib/python2.7/py_compile.py $files
python2.7-minimal.postinst: python2.7 -E -S -O /usr/lib/python2.7/py_compile.py $files
python2.7.postinst: python2.7 -E -S /usr/lib/python2.7/py_compile.py $files
python2.7.postinst: python2.7 -E -S -O /usr/lib/python2.7/py_compile.py $files
python3.5-minimal.postinst: /usr/bin/python3.5 -E -S /usr/lib/python3.5/py_compile.py $files
python3.5-minimal.postinst: /usr/bin/python3.5 -E -S -O /usr/lib/python3.5/py_compile.py $files
python3.5.postinst: /usr/bin/python3.5 -E -S /usr/lib/python3.5/py_compile.py $files
python3.5.postinst: /usr/bin/python3.5 -E -S -O /usr/lib/python3.5/py_compile.py $files

We can see this is fixed for python3.5 but not python2.7 so setting to verification-done for xenial.

tags: added: verification-done-xenial
removed: verification-needed-xenial
Revision history for this message
Brian Murray (brian-murray) wrote :

I followed the test case in the bug description and installed python version 3.5.1 in /usr/local/bin and did receive the traceback from the description when reinstalling python3.5. I then modified my /etc/apt/sources.list file to enable -proposed ran 'apt-get update' and then installed python3.5 from zesty-proposed.

Get:1 http://archive.ubuntu.com/ubuntu zesty-proposed/main amd64 libpython3.5 amd64 3.5.3-1ubuntu0~17.04.1 [1,372 kB]
Get:2 http://archive.ubuntu.com/ubuntu zesty-proposed/main amd64 python3.5 amd64 3.5.3-1ubuntu0~17.04.1 [175 kB]
Get:3 http://archive.ubuntu.com/ubuntu zesty-proposed/main amd64 libpython3.5-stdlib amd64 3.5.3-1ubuntu0~17.04.1 [2,167 kB]
Get:4 http://archive.ubuntu.com/ubuntu zesty-proposed/main amd64 python3.5-minimal amd64 3.5.3-1ubuntu0~17.04.1 [1,635 kB]
Get:5 http://archive.ubuntu.com/ubuntu zesty-proposed/main amd64 libpython3.5-minimal amd64 3.5.3-1ubuntu0~17.04.1 [529 kB]
Fetched 5,877 kB in 1s (3,560 kB/s)
(Reading database ... 229111 files and directories currently installed.)
Preparing to unpack .../libpython3.5_3.5.3-1ubuntu0~17.04.1_amd64.deb ...
Unpacking libpython3.5:amd64 (3.5.3-1ubuntu0~17.04.1) over (3.5.3-1ubuntu0~17.04.0) ...
Preparing to unpack .../python3.5_3.5.3-1ubuntu0~17.04.1_amd64.deb ...
Unpacking python3.5 (3.5.3-1ubuntu0~17.04.1) over (3.5.3-1ubuntu0~17.04.0) ...
Preparing to unpack .../libpython3.5-stdlib_3.5.3-1ubuntu0~17.04.1_amd64.deb ...
Unpacking libpython3.5-stdlib:amd64 (3.5.3-1ubuntu0~17.04.1) over (3.5.3-1ubuntu0~17.04.0) ...
Preparing to unpack .../python3.5-minimal_3.5.3-1ubuntu0~17.04.1_amd64.deb ...
Unpacking python3.5-minimal (3.5.3-1ubuntu0~17.04.1) over (3.5.3-1ubuntu0~17.04.0) ...
Preparing to unpack .../libpython3.5-minimal_3.5.3-1ubuntu0~17.04.1_amd64.deb ...
Unpacking libpython3.5-minimal:amd64 (3.5.3-1ubuntu0~17.04.1) over (3.5.3-1ubuntu0~17.04.0) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu2) ...
Processing triggers for bamfdaemon (0.5.3+17.04.20170406-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for libc-bin (2.24-9ubuntu2.2) ...
Processing triggers for man-db (2.7.6.1-2) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu5) ...
Setting up libpython3.5-minimal:amd64 (3.5.3-1ubuntu0~17.04.1) ...
Setting up libpython3.5-stdlib:amd64 (3.5.3-1ubuntu0~17.04.1) ...
Setting up python3.5-minimal (3.5.3-1ubuntu0~17.04.1) ...
Setting up python3.5 (3.5.3-1ubuntu0~17.04.1) ...
Setting up libpython3.5:amd64 (3.5.3-1ubuntu0~17.04.1) ...
Processing triggers for libc-bin (2.24-9ubuntu2.2) ...

No traceback!

tags: added: verification-done-zesty
removed: verification-needed-zesty
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python3.5 - 3.5.3-1ubuntu0~17.04.1

---------------
python3.5 (3.5.3-1ubuntu0~17.04.1) zesty; urgency=medium

  * Explicitly use the system python for byte compilation in postinst scripts.
    (LP: #1682934)

 -- Brian Murray <email address hidden> Thu, 14 Sep 2017 15:58:41 -0700

Changed in python3.5 (Ubuntu Zesty):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for python3.5 has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python3.5 - 3.5.2-2ubuntu0~16.04.3

---------------
python3.5 (3.5.2-2ubuntu0~16.04.3) xenial; urgency=medium

  * Explicitly use the system python for byte compilation in postinst scripts.
    (LP: #1682934)

 -- Brian Murray <email address hidden> Thu, 14 Sep 2017 15:51:06 -0700

Changed in python3.5 (Ubuntu Xenial):
status: Fix Committed → Fix Released
tags: added: id-59690d2a51b99cb84a07b129
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python2.7 (Ubuntu Xenial):
status: New → Confirmed
Changed in python2.7 (Ubuntu Zesty):
status: New → Confirmed
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Brian, or anyone else affected,

Accepted python2.7 into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python2.7/2.7.13-2ubuntu0.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-zesty to verification-done-zesty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-zesty. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in python2.7 (Ubuntu Zesty):
status: Confirmed → Fix Committed
tags: added: verification-needed-zesty
removed: verification-done-zesty
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Brian, or anyone else affected,

Accepted python2.7 into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python2.7/2.7.12-1ubuntu0~16.04.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in python2.7 (Ubuntu Xenial):
status: Confirmed → Fix Committed
tags: added: verification-needed-xenial
removed: verification-done-xenial
Revision history for this message
Matthias Klose (doko) wrote :

verified the python2.7 uploads for xenial and zesty

tags: added: verification-done verification-done-xenial verification-done-zesty
removed: verification-needed verification-needed-xenial verification-needed-zesty
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python2.7 - 2.7.12-1ubuntu0~16.04.3

---------------
python2.7 (2.7.12-1ubuntu0~16.04.3) xenial-proposed; urgency=medium

  * Some performance improvements: LP: #1638695.
    - Build the _math.o object file without -fPIC for static builds.
  * Rename md5_* functions to _Py_md5_*. Closes: #868366. LP: #1734109.
  * Explicitly use the system python for byte compilation in postinst scripts.
    LP: #1682934.
  * Fix issue #22636: Avoid shell injection problems with
    ctypes.util.find_library(). LP: #1512068.

 -- Matthias Klose <email address hidden> Mon, 04 Dec 2017 15:50:18 +0100

Changed in python2.7 (Ubuntu Xenial):
status: Fix Committed → Fix Released
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.