Opened 7 years ago

Last modified 7 years ago

#6927 closed defect

band.ComputeStatistics() fails with callback arguments — at Version 1

Reported by: Sam Gillingham Owned by: hobu
Priority: normal Milestone: 2.2.1
Component: PythonBindings Version: 2.2.0
Severity: normal Keywords:
Cc:

Description (last modified by Sam Gillingham)

In GDAL 2.2.0, the following code now fails:

def GDALProgressFunc(value, string, extra):
    print(value)

ds = gdal.Open(sys.argv[1], gdal.GA_Update)
band = ds.GetRasterBand(1)
band.ComputeStatistics(False, GDALProgressFunc, 0)

This used to work in 2.1.3. Runs fine if you remove the last 2 arguments. I suspect this is a result of the new typemap for this introduced in [36845] which doesn't mention these extra parameters, but I could well be wrong.

Change History (1)

comment:1 by Sam Gillingham, 7 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.