Ticket #3441 (closed defect: fixed)
[REGRESSION FIX] gdal_retile.py broken with python 2.X; Restore original output of print statements
| Reported by: | rouault | Owned by: | rouault |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.7.2 |
| Component: | Utilities | Version: | 1.7.0 |
| Severity: | normal | Keywords: | python script |
| Cc: |
Description
Several issues :
1) Major : The 2to3.py conversion script introduced an incompatible form of print statement for python 2.X on gdal_retile.py 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 : gdal_retile.py 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) 0 Python 3.X : >>> a = 1 >>> b = 2 >>> print(a/b) 0.5
3) Minor : the conversion script transformed " print 'a', param " into " print('a', param) " which has not the same output
Change History
Note: See
TracTickets for help on using
tickets.
