Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6927 closed defect (fixed)

band.ComputeStatistics() fails with callback arguments

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 (4)

comment:1 by Sam Gillingham, 7 years ago

Description: modified (diff)

comment:2 by Even Rouault, 7 years ago

Resolution: fixed
Status: newclosed

In 39125:

Python bindings: fix 2.2 regression preventing use of callback function in Band.ComputeStatistics() (fixes #6927)

comment:3 by Even Rouault, 7 years ago

In 39126:

Python bindings: fix 2.2 regression preventing use of callback function in Band.ComputeStatistics() (fixes #6927)

comment:4 by Even Rouault, 7 years ago

Milestone: 2.2.1
Note: See TracTickets for help on using tickets.