cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Python API V2 Error: ValueError Timeout

Python API V2 Error: ValueError Timeout

jasonoh
Explorer | Level 3
Go to solution

Hello,

 

I'm trying to use the Python API (v 8.5.0) from Pythonista on iOS (latest, on iPad Pro), and when I try to invoke any commands on the dbx object returned from dropbox.Dropbox('TOKEN'), e.g. files_upload, I get the following error:

 

Traceback (most recent call last):
  File "/var/containers/Bundle/Application/5EF5E379-FBDE-4C83-BE7B-D5D77464A370/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/urllib3/util/timeout.py", line 125, in _validate_timeout
    float(value)
TypeError: float() argument must be a string or a number, not 'Timeout'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/private/var/mobile/Containers/Shared/AppGroup/E4C7B551-D492-40EB-A6E8-D6FA77EB9421/Pythonista3/Documents/mobile_blogger/mobile_blogger.py", line 235, in <module>
    main()
  File "/private/var/mobile/Containers/Shared/AppGroup/E4C7B551-D492-40EB-A6E8-D6FA77EB9421/Pythonista3/Documents/mobile_blogger/mobile_blogger.py", line 228, in main
    mb.sync_to_dropbox(results['filename'], results['draft'], file)
  File "/private/var/mobile/Containers/Shared/AppGroup/E4C7B551-D492-40EB-A6E8-D6FA77EB9421/Pythonista3/Documents/mobile_blogger/mobile_blogger.py", line 134, in sync_to_dropbox
    self._dbx.files_upload(output, full_path)
  File "/private/var/mobile/Containers/Shared/AppGroup/E4C7B551-D492-40EB-A6E8-D6FA77EB9421/Pythonista3/Documents/site-packages/dropbox/base.py", line 2076, in files_upload
    f,
  File "/private/var/mobile/Containers/Shared/AppGroup/E4C7B551-D492-40EB-A6E8-D6FA77EB9421/Pythonista3/Documents/site-packages/dropbox/dropbox.py", line 234, in request
    timeout=timeout)
  File "/private/var/mobile/Containers/Shared/AppGroup/E4C7B551-D492-40EB-A6E8-D6FA77EB9421/Pythonista3/Documents/site-packages/dropbox/dropbox.py", line 325, in request_json_string_with_retry
    timeout=timeout)
  File "/private/var/mobile/Containers/Shared/AppGroup/E4C7B551-D492-40EB-A6E8-D6FA77EB9421/Pythonista3/Documents/site-packages/dropbox/dropbox.py", line 409, in request_json_string
    timeout=timeout,
  File "/var/containers/Bundle/Application/5EF5E379-FBDE-4C83-BE7B-D5D77464A370/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/requests/sessions.py", line 512, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/var/containers/Bundle/Application/5EF5E379-FBDE-4C83-BE7B-D5D77464A370/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/requests/sessions.py", line 469, in request
    resp = self.send(prep, **send_kwargs)
  File "/var/containers/Bundle/Application/5EF5E379-FBDE-4C83-BE7B-D5D77464A370/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/requests/sessions.py", line 577, in send
    r = adapter.send(request, **kwargs)
  File "/var/containers/Bundle/Application/5EF5E379-FBDE-4C83-BE7B-D5D77464A370/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/requests/adapters.py", line 377, in send
    timeout=timeout
  File "/var/containers/Bundle/Application/5EF5E379-FBDE-4C83-BE7B-D5D77464A370/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/urllib3/connectionpool.py", line 547, in urlopen
    timeout_obj = self._get_timeout(timeout)
  File "/var/containers/Bundle/Application/5EF5E379-FBDE-4C83-BE7B-D5D77464A370/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/urllib3/connectionpool.py", line 303, in _get_timeout
    return Timeout.from_float(timeout)
  File "/var/containers/Bundle/Application/5EF5E379-FBDE-4C83-BE7B-D5D77464A370/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/urllib3/util/timeout.py", line 155, in from_float
    return Timeout(read=timeout, connect=timeout)
  File "/var/containers/Bundle/Application/5EF5E379-FBDE-4C83-BE7B-D5D77464A370/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/urllib3/util/timeout.py", line 98, in __init__
    self._connect = self._validate_timeout(connect, 'connect')
  File "/var/containers/Bundle/Application/5EF5E379-FBDE-4C83-BE7B-D5D77464A370/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/urllib3/util/timeout.py", line 128, in _validate_timeout
    "int or float." % (name, value))
ValueError: Timeout value connect was Timeout(connect=30, read=30, total=None), but it must be an int or float.

 

I'm using the requests library (2.18.4), so it's not that... Running the same calls from desktop doesn't produce the above error.

 

Any insight would be greatly appreciated!

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution
This error is based on the interaction between certain versions of both requests and urllib3. I recommend uninstalling both and reinstalling requests and its dependencies in order to get compatible versions.

View solution in original post

1 Reply 1

Greg-DB
Dropbox Staff
Go to solution
This error is based on the interaction between certain versions of both requests and urllib3. I recommend uninstalling both and reinstalling requests and its dependencies in order to get compatible versions.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?