Opened 10 years ago

Closed 10 years ago

#3395 closed defect (fixed)

python install fails on (my) ubuntu 8.04

Reported by: Even Rouault Owned by: hobu
Priority: normal Milestone: 1.7.2
Component: PythonBindings Version: 1.7.0
Severity: normal Keywords:
Cc: hobu


The linking of fails with python 2.4 and 2.5 because get_gdal_config('prefix') returns a unicode string ( for example u'/home/even/gdal' ), which once appended to the gcc command line is expanded to / h o m e / e v e n / g d a l (spaces between each character), thus the failure.

the decode('ascii') in p.stdout.readline().decode('ascii') is necessary for python 3.X, since p.stdout.readline() returns content in python 3.x, thus decode('ascii') returns a unicode string. So my fix consists in only appending decode('ascii') for python 3.X and removing it for python 2.X.

The strange thing is that the fix is not necessary on all platforms running python 2.x

(The failure was unseen until recently since when I introduced python 3.x compatibility, the try except first tried with 'import popen2' and only fell back to 'import subprocess' with python 3.x)

Change History (2)

comment:1 Changed 10 years ago by Even Rouault

Fixed in trunk in r18765 and branches/1.7 in r18766

comment:2 Changed 10 years ago by Even Rouault

Milestone: 1.7.2
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.