pyversions.py generates wrong output with version_only option
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-central (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: python-central
On Ubuntu 6.10 running pyversions -vd should return '2.4' but it returns 'in/python2.4'
this also affects post-install configurations with pycentral.
the pyversions.py script is installed in two locations and two versions (!?):
/usr/share/
/usr/share/
Both can be fixed this way:
* search location of this text:
def default_
global _default_version
if not _default_version:
if version_only:
return _default_
else:
return _default_version
* replace the line:
return _default_
* with this line:
return _default_
Is this the right place to post this bugreport/fix? This was my first one.
Changed in python-central: | |
status: | New → Fix Committed |
This occurs if /usr/bin/python is a symbolic link whose target is an absolute path, not just "python2.x". It's not on my system, but apparently it can be.
Another, related, issue is that update-alternatives may make /usr/bin/python a link to /etc/alternativ es/python, which, in turn, is a link to /usr/bin/python2.x. The original function does not cater for such circumstances.
I believe the attached patch fixes both issues, but I haven't tested it (beyond verifying that the results are as correct as before on my own box).