rapp-project / rapp-platform

RAPP Platform is a collection of ROS nodes and back-end processes that aim to deliver ready-to-use generic services to robots
Other
28 stars 20 forks source link

Web services: setNoiseProfile service crashes when the file argument is of different type #334

Closed etsardou closed 8 years ago

etsardou commented 8 years ago

The call:

response = self.ch.setNoiseProfile(3, 'nao_wav_1_ch')

and I get

Traceback (most recent call last):
  File "./denoise_profile_tests.py", line 49, in test_setNoiseProfile_wrongFileInputType
    response = self.ch.setNoiseProfile(3, 'nao_wav_1_ch')
  File "/home/manos/rapp_platform/rapp-platform-catkin-ws/src/rapp-api/python/RappCloud/RappPlatformApi.py", line 120, in setNoiseProfile
    response = self.svc_caller.call(msg)
  File "/home/manos/rapp_platform/rapp-platform-catkin-ws/src/rapp-api/python/RappCloud/Service/RappPlatformService.py", line 153, in call
    cloudResponseDic = self.__controller.run_job()
  File "/home/manos/rapp_platform/rapp-platform-catkin-ws/src/rapp-api/python/RappCloud/ServiceController/ServiceControllerSync.py", line 69, in run_job
    files = self._service.req.make_files()
  File "/home/manos/rapp_platform/rapp-platform-catkin-ws/src/rapp-api/python/RappCloud/CloudMsgs/SetNoiseProfile.py", line 43, in make_files
    return [File(self.audiofile, postfield='file')]
  File "/home/manos/rapp_platform/rapp-platform-catkin-ws/src/rapp-api/python/RappCloud/Objects/File.py", line 43, in __init__
    self.__path = path.expanduser(path.realpath(filepath))
  File "/usr/lib/python2.7/posixpath.py", line 382, in realpath
    path, ok = _joinrealpath('', filename, {})
  File "/usr/lib/python2.7/posixpath.py", line 388, in _joinrealpath
    if isabs(rest):
  File "/usr/lib/python2.7/posixpath.py", line 61, in isabs
    return s.startswith('/')
AttributeError: 'int' object has no attribute 'startswith'
klpanagi commented 8 years ago

This issue is related to the python-platform-api

References https://github.com/rapp-project/rapp-api/issues/20 To prevent passing wrong data types for the requests.