Ticket #3395 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

python setup.py install fails on (my) ubuntu 8.04

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

Description

The linking of _gdal.so 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

Changed 3 years ago by rouault

Fixed in trunk in r18765 and branches/1.7 in r18766

Changed 3 years ago by rouault

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to 1.7.2
Note: See TracTickets for help on using tickets.