Opened 11 years ago

Closed 11 years ago

#4366 closed defect (fixed)

gdaltest.post_reason() lacks a 'frames' argument

Reported by: etourigny Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: svn-trunk
Severity: normal Keywords: ogr, autotest
Cc:

Description

ogr_feature.py fails tests 3,8,9, and 10. Also there seems to be an error in the call to gdaltest.post_reason, frames argument should be removed.

$  ./ogr_feature.py 
  TEST: ogr_feature_cp_1 ... success
  TEST: ogr_feature_cp_2 ... success
  TEST: ogr_feature_cp_3 ... fail (blowup)
Traceback (most recent call last):
  File "../pymod/gdaltest_python2.py", line 37, in run_func
    result = func()
  File "./ogr_feature.py", line 238, in ogr_feature_cp_3
    if not check( dst_feature, 'field_integerlist', '(3:10,20,30)' ):
  File "./ogr_feature.py", line 116, in check
    frames = 3 )
TypeError: post_reason() got an unexpected keyword argument 'frames'
  TEST: ogr_feature_cp_4 ... success
  TEST: ogr_feature_cp_5 ... success
  TEST: ogr_feature_cp_6 ... success
  TEST: ogr_feature_cp_7 ... success
  TEST: ogr_feature_cp_8 ... fail (blowup)
Traceback (most recent call last):
  File "../pymod/gdaltest_python2.py", line 37, in run_func
    result = func()
  File "./ogr_feature.py", line 443, in ogr_feature_cp_8
    if not check( dst_feature, 'field_integerlist', [10, 20, 30] ):
  File "./ogr_feature.py", line 116, in check
    frames = 3 )
TypeError: post_reason() got an unexpected keyword argument 'frames'
  TEST: ogr_feature_cp_9 ... fail (blowup)
Traceback (most recent call last):
  File "../pymod/gdaltest_python2.py", line 37, in run_func
    result = func()
  File "./ogr_feature.py", line 487, in ogr_feature_cp_9
    if not check( dst_feature, 'field_reallist', [123.5, 567.0] ):
  File "./ogr_feature.py", line 116, in check
    frames = 3 )
TypeError: post_reason() got an unexpected keyword argument 'frames'
  TEST: ogr_feature_cp_10 ... fail (blowup)
Traceback (most recent call last):
  File "../pymod/gdaltest_python2.py", line 37, in run_func
    result = func()
  File "./ogr_feature.py", line 531, in ogr_feature_cp_10
    if not check( dst_feature, 'field_stringlist', ['abc', 'def'] ):
  File "./ogr_feature.py", line 116, in check
    frames = 3 )
TypeError: post_reason() got an unexpected keyword argument 'frames'
  TEST: ogr_feature_cleanup ... success

Test Script: ogr_feature
Succeeded: 7
Failed:    4 (4 blew exceptions)
Skipped:   0
Expected fail:0

removing the frames argument:

$  ./ogr_feature.py 
  TEST: ogr_feature_cp_1 ... success
  TEST: ogr_feature_cp_2 ... success
  TEST: ogr_feature_cp_3 ... failure
    line 115: did not get value (3:10,20,30) for field field_integerlist, got None.
  TEST: ogr_feature_cp_4 ... success
  TEST: ogr_feature_cp_5 ... success
  TEST: ogr_feature_cp_6 ... success
  TEST: ogr_feature_cp_7 ... success
  TEST: ogr_feature_cp_8 ... failure
    line 115: did not get value [10, 20, 30] for field field_integerlist, got None.
  TEST: ogr_feature_cp_9 ... failure
    line 115: did not get value [123.5, 567.0] for field field_reallist, got None.
  TEST: ogr_feature_cp_10 ... failure
    line 115: did not get value ['abc', 'def'] for field field_stringlist, got None.
  TEST: ogr_feature_cleanup ... success

Test Script: ogr_feature
Succeeded: 7
Failed:    4 (4 blew exceptions)
Skipped:   0
Expected fail:0

Change History (6)

comment:1 by Even Rouault, 11 years ago

Summary: ogr_feature.py autotest failsgdaltest.post_reason() lacks a 'frames' argument

My guess is that Frank has extended gdaltest.post_reason() to accept an optional frames argument, but has not yet committed his updated pymod/gdalautotest.py

And the error you get comes from the fact that you need to regenerate the Python bindings after latest Frank's changes

comment:2 by etourigny, 11 years ago

I thought as much, so I went to swig/python and regenerated the python bindings, still same error.

I tried:

cd swig/python; make clean; make install
and 
cd swig/python; make clean;  python setup.py build; python setup.py install

comment:3 by Even Rouault, 11 years ago

You must issue "make generate" so that swig refreshes the generated .cpp and .py files.

comment:4 by etourigny, 11 years ago

That worked, thanks. Just saw that command in wiki:GdalOgrInPython

comment:5 by warmerdam, 11 years ago

Sorry about the frames problem. I have committed the change it relates to (r23469).

comment:6 by etourigny, 11 years ago

Resolution: fixed
Status: newclosed

No problem, I'll close this bug then.

Note: See TracTickets for help on using tickets.