[Python-bugs-list] [ python-Bugs-662701 ] sys.version[:3] gives incorrect version

SourceForge.net noreply@sourceforge.net
Sun, 05 Jan 2003 15:14:30 -0800


Bugs item #662701, was opened at 2003-01-05 18:10
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=662701&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Pearu Peterson (pearu)
Assigned to: Nobody/Anonymous (nobody)
Summary: sys.version[:3] gives incorrect version

Initial Comment:

sys.version[:3] is used in several places [*] for
Python version and in most cases it is OK.
However, when Python is build/installed, say, with
  make all install VERSION=2.2.2
then sys.version[:3] does not represent Python version
correctly anymore. For example, the path to Python Lib
is then
  <prefix>/lib/python2.2.2/
but e.g. distutils finds it as
  <prefix>/lib/python2.2/
which obviously causes either an exception or a silent
incorrect behaviour [**] when trying to use distutils.

Note about fix: I don't have it but simply replacing
sys.version[:3] with
sys.version.split()[0] will not work.

Best regards, Pearu

[*] Running
  grep  "sys.version\[:3\]" {*,*/*,*/*/*}.py
in the Python Lib tree shows 8 matches for Python 2.2.2.

[**] .. e.g. when one has other Python installed with
VERSION=2.2

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2003-01-06 00:14

Message:
Logged In: YES 
user_id=21627

I would suggest that 'make all install VERSION=2.2.2' is not
supported, so this does not need to be fixed.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=662701&group_id=5470