jim-easterbrook / python-gphoto2

Python interface to libgphoto2
GNU Lesser General Public License v3.0
374 stars 59 forks source link

TypeError: gp_camera_capture expected 3 arguments, got 4 #6

Closed codebuk closed 9 years ago

codebuk commented 9 years ago

Hi - the API specifies 4 arguments . I have check the swig *.i files but with my limited knowledge cannot see any issues.

I have changed swig to version 3.0.2 which works ok with the latest source. . I might change back to a pre 2.0.11 of swig and see if that helps. Any other ideas?

bash-4.2$ python trigger-image-to-disk.py 
ERROR: gphoto2: (ptp2/eos_directory) storage 0xffffffff, but handle 0x00000000?
ERROR: gphoto2: (camera_canon_eos_update_capture_target) did not get capture destination propdesc?
Traceback (most recent call last):
  File "trigger-image-to-disk.py", line 46, in <module>
    sys.exit(main())
  File "trigger-image-to-disk.py", line 38, in main
    gp.check_result(gp.gp_camera_capture(camera, gp.GP_CAPTURE_IMAGE , "dddd.cr2", context))
  File "/usr/lib64/python2.7/site-packages/gphoto2/lib/gphoto2_camera.py", line 782, in gp_camera_capture
    return _gphoto2_camera.gp_camera_capture(*args)
TypeError: gp_camera_capture expected 3 arguments, got 4
bash-4.2$ swig -v
Must specify an input file. Use -help for available options.
bash-4.2$ swig -version

SWIG Version 3.0.2

Compiled with g++ [x86_64-unknown-linux-gnu]

Configured options: +pcre

Please see http://www.swig.org for reporting bugs and further information
bash-4.2$
jim-easterbrook commented 9 years ago

Try 'pydoc gphoto2.gp_camera_capture' to see what parameters it expects.

Don't forget this bit of the README: "Note that there is one major difference between the Python and C APIs. C functions that use a pointer parameter to return a value (and often do some memory allocation) such as gp_camera_new() have Python equivalents that create the required pointer and return it in a list with the gphoto2 error code."