Opened 14 years ago

Closed 14 years ago

#3441 closed defect (fixed)

[REGRESSION FIX] broken with python 2.X; Restore original output of print statements

Reported by: Even Rouault Owned by: Even Rouault
Priority: normal Milestone: 1.7.2
Component: Utilities Version: 1.7.0
Severity: normal Keywords: python script


Several issues :

1) Major : The conversion script introduced an incompatible form of print statement for python 2.X on that prevent execution from the python parser.

Namely : " print 'a', " with the comma at the end to prevent new line output. The python 3.X equivalent is " print('a', end=' ') " which is unrecognized by python 2.X.

2) Minor : did not work with Python 3.X because of change in semantic in division of integer variables.

Python 2.X :
>>> a = 1
>>> b = 2
>>> print(a/b)

Python 3.X :
>>> a = 1
>>> b = 2
>>> print(a/b)

3) Minor : the conversion script transformed " print 'a', param " into " print('a', param) " which has not the same output

Change History (1)

comment:1 by Even Rouault, 14 years ago

Resolution: fixed
Status: newclosed

Fixed in trunk (r18952, r18954) and in branches/1.7 (r18953, r18955)

Add testing of in autotest infrastructure in trunk (r18958, r18959)

Note: See TracTickets for help on using tickets.