python2.3 not installable

Bug #58062 reported by Liam Bedford
12
Affects Status Importance Assigned to Milestone
python2.3 (Ubuntu)
Fix Released
Undecided
Matthias Klose

Bug Description

Binary package hint: python2.3

In edgy, python2.3 is not installable (and once you try to install it, you
can't remove the package either, without editting the prerm script):
$ sudo apt-get install python2.3
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  python2.3-doc python2.3-profiler
Recommended packages:
  python2.3-cjkcodecs python2.3-iconvcodec python2.3-japanese-codecs
The following NEW packages will be installed:
  python2.3
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/2800kB of archives.
After unpacking 9613kB of additional disk space will be used.
Selecting previously deselected package python2.3.
(Reading database ... 225960 files and directories currently installed.)
Unpacking python2.3 (from .../python2.3_2.3.5-14_i386.deb) ...
Setting up python2.3 (2.3.5-14) ...
pycentral: pycentral rtinstall: installed runtime python2.3 not found
pycentral rtinstall: installed runtime python2.3 not found
dpkg: error processing python2.3 (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 python2.3
E: Sub-process /usr/bin/dpkg returned an error code (1)

I'm using
deb http://us.archive.ubuntu.com/ubuntu edgy main restricted universe multiverse
in sources.list, and
$ apt-cache policy python2.3
python2.3:
  Installed: 2.3.5-14
  Candidate: 2.3.5-14
  Version table:
 *** 2.3.5-14 0
        500 http://us.archive.ubuntu.com edgy/universe Packages
        100 /var/lib/dpkg/status

Tags: edgy
Revision history for this message
Dorneles Tremea (dtremea) wrote :

Same thing here, but with 2.3.5-15ubuntu1... :-(

I added "set -x" in the beginning of "/var/lib/dpkg/info/python2.3.postinst"
and then tried to install it again. The output is the following:

[snipped correct behavior]
+ grep -sq ^byte-compile[^#]*optimize /etc/python/debian_config
+ [ -z ]
+ [ != noninteractive ]
+ echo Linking and byte-compiling packages for runtime python2.3...
Linking and byte-compiling packages for runtime python2.3...
+ dpkg -s python2.3
+ awk /^Version:/ {print $2}
+ version=2.3.5-15ubuntu1
+ [ -x /usr/share/python/runtime.d/pycentral.rtinstall ]
+ /usr/share/python/runtime.d/pycentral.rtinstall rtinstall python2.3 2.3.5-15ubuntu1
pycentral: pycentral rtinstall: installed runtime python2.3 not found
pycentral rtinstall: installed runtime python2.3 not found
dpkg: error processing python2.3 (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 python2.3
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Forest Bond (forest-bond) wrote :

Similar result here, but I can't uninstall python2.3. I see virtually the same error message.

magilus (magilus)
Changed in python2.3:
status: Unconfirmed → Confirmed
Revision history for this message
Bruno Rocha Coutinho (bruno-r-coutinho) wrote :

/usr/share/python/runtime.d/pycentral.rtinstall is a script that does some checks and
run

pycentral rtinstall python2.3

Looking pycentral code this message is sent by this function:

def check_args(self, global_options):
        if len(self.args) != 1:
            self._option_parser.print_help()
            sys.exit(1)
        self.rtname = self.args[0]
        if self.rtname[-8:] == '-minimal':
            self.rtname = self.rtname[:-8]
        self.runtime = None
        for rt in get_installed_runtimes():
            if rt.name == self.rtname:
                self.runtime = rt
                break
        if not self.runtime:
            self.error('installed runtime %s not found' % self.rtname)
        return self.errors_occured

Revision history for this message
Bruno Rocha Coutinho (bruno-r-coutinho) wrote :

Running pycentral by hand:

Python 2.4.3 (#2, Aug 25 2006, 17:37:59)
[GCC 4.1.2 20060817 (prerelease) (Ubuntu 4.1.1-11ubuntu1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import fnmatch, glob, os, re, sys, time
>>> from optparse import OptionParser
>>>
>>> sys.path[0:0] = ['/usr/share/python', '/usr/share/pycentral-data']
>>> import pyversions
>>>
>>> try:
... SetType = set
... except NameError:
... import sets
...
>>> program = os.path.basename(sys.argv[0])
>>>
>>> print program

>>> shared_base = '/usr/share/pycentral/'
>>> req_pycentral_version = '0.5'
>>> program=pycentral #this was get from a print in pycentral
>>> shared_base = '/usr/share/pycentral/'
>>> req_pycentral_version = '0.5'

The first line of main(), call parse_options() so I will simulate it:
>>> args = ['rtinstall', '/usr/bin/python2.3'] #from a print in pycentral
>>> global_options={'help': None, 'verbose': None} #from a print in pycentral
>>> print global_options
{'help': None, 'verbose': None}
>>> args=['rtinstall', '/usr/bin/python2.3'] #from a print in pycentral
>>> action_name = args[0]
>>> print action_name
rtinstall
>>> del args[0] #line 1248
>>> matching_actions=['rtinstall'] #from a print in pycentral
>>> action_name = matching_actions[0]
>>> print action_name
rtinstall

printing action after line 1260 gives:
<__main__.ActionRuntimeInstall instance at 0xa7d744cc>

Then, after some testing main() call action.check_args().

Revision history for this message
Bruno Rocha Coutinho (bruno-r-coutinho) wrote : In ActionRuntimeInstall.check_args()

Line 937 is:
self.rtname = self.args[0]

printing self.rtname in pycentral gives:
/usr/bin/python2.3

line 941 calls get_installed_runtimes(), so I will look into it:

installed_runtimes is None, so the if statement will be executed:
>>> import fnmatch, glob, os, re, sys, time
>>> from optparse import OptionParser
>>> sys.path[0:0] = ['/usr/share/python', '/usr/share/pycentral-data']
>>> import pyversions
>>> try:
... SetType = set
... except NameError:
... import sets
... SetType = sets.Set
... set = sets.Set
...
>>> shared_base = '/usr/share/pycentral/'
>>> req_pycentral_version = '0.5'

>>> import glob
>>> default_version = pyversions.default_version(version_only=True)
>>> print default_version
2.4
>>> supported = pyversions.supported_versions()
>>> print supported
['python2.4']

why python 2.3 isn't here?

>>> for_aux = glob.glob('/usr/bin/python[0-9].[0-9]') # simulating line 197
>>> print for_aux
['/usr/bin/python2.3', '/usr/bin/python2.4']
>>> interp='/usr/bin/python2.3'
>>> if_aux=os.path.basename(interp) # simulating line 198
>>> print if_aux
python2.3

oops python2.3 isn't in supported, continue...

>>> interp='/usr/bin/python2.4'
>>> if_aux=os.path.basename(interp)
>>> print if_aux
python2.4

now, line 199 will not be executed

after pasted PythonRuntime class code:
>>> rt = PythonRuntime('python' + version,version,'/usr/bin/python' + version,'/usr/lib/python' + version)
>>> print rt.name
python2.4
>>> print rt.version
2.4
>>> print rt.short_name
2.4
>>> print rt.interp
/usr/bin/python2.4
>>> print rt.prefix
/usr/lib/python2.4/

So get_installed_runtimes() will return only a 2.4 python runtime that will be rejected by the if statement in line 942 and ptcentral will print installed runtime python2.3 not found

Revision history for this message
Bruno Rocha Coutinho (bruno-r-coutinho) wrote :

if I comment lines 198 and 199 in pycentral, the package can be installed and removed without errors.

Revision history for this message
Alex Muntada (alex.muntada) wrote :

An easier fix is to temporarily add ", python2.3" (note the comma) to the "supported-versions" entry in /usr/share/python/debian_defaults:

$ cat /usr/share/python/debian_defaults
[DEFAULT]
default-version = python2.4
supported-versions = python2.4, python2.3

Unfortunately, the installation/removal of python2.3 package does not add/remove the proper supported-versions value on the file above.

Since I don't know very much about python packages I can't tell for sure, but may be changing that file before executing pycentral should fix the bug.

HTH

Revision history for this message
Alex Muntada (alex.muntada) wrote :

Duplicate of bug #56779

Revision history for this message
Bruno Rocha Coutinho (bruno-r-coutinho) wrote :

Even after the install is done, python2.3 isn't added to supported-versions in /usr/share/python/debian_defaults .

Revision history for this message
Matthias Klose (doko) wrote :

fixed in 0.5.6ubuntu2.

Changed in python2.3:
assignee: nobody → doko
status: Confirmed → 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.