Opened 4 months ago

Closed 4 months ago

Last modified 4 months 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 Changed 4 months ago by Sam Gillingham

Description: modified (diff)

comment:2 Changed 4 months ago by Even Rouault

Resolution: fixed
Status: newclosed

In 39125:

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

comment:3 Changed 4 months ago by Even Rouault

In 39126:

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

comment:4 Changed 4 months ago by Even Rouault

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