We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
RCR
8 years agoExplorer | Level 3
Python SDK constant errors
Trying to make a small app that will read a pair of files from a dropbox folder and compile a small database from them. Just getting started, following the sample but I keep getting errors of differe...
- 8 years agoIt looks like the ValueError issue is fixed in requests v2.17.1, so please update to that and let me know if you're still seeing any issues.
Greg-DB
Dropbox Staff
Thanks for writing in. Note that the first error is because non-root paths should start with a '/'. So, your path there should be "/testFolder", not "testFolder". The root path is identified by the empty path "".
The second error did start occurring with recent changes to the requests dependency. We're looking into that. As a workaround though, you can downgrade to requests v2.15.1.
The second error did start occurring with recent changes to the requests dependency. We're looking into that. As a workaround though, you can downgrade to requests v2.15.1.
RCR
8 years agoExplorer | Level 3
Thanks! By downgrading I have managed to run some of the API functions, but now I have another problem.
The app I started using has App Folder permissions (set to 'testFolder') and from what I can tell, the path used for endpoints is relative to that folder. So, if I want to list the contents of 'testFolder' I actually pass an empty path, correct?
Now, the issue is that I get an empty 'entries' array when I try to list the contents of 'testFolder' even though there is a file there.
I tested listing the contents of 'testFolder' with an app with 'Full Dropbox' permissions and it does list the file.
Any idea what could be the issue?
- Greg-DB8 years agoDropbox StaffThat's correct, if your app has the "app folder" permission, everything your app does or "sees" is relative to the app folder itself. You would use "" to refer to the app folder itself, since it's your app's root, or "/subfolder", etc. to refer to something inside your app folder.
From your first paragraph, it sounds like "testFolder" is your app folder itself, so to list its contents you would use a path parameter of "". In your second paragraph, it sounds like you may be trying to specify "testFolder", which wouldn't be necessary. If you're still not seeing the expected results, please share the code and output.
Also, note that the full Dropbox version wouldn't be looking at the same files if you pass the same path string. I.e., using the path "/testFolder" would list the following folders, as seen on the Dropbox web site, for the respective permissions:
- full Dropbox: /testFolder
- app folder: /Apps/<app folder name>/testFolder- Greg-DB8 years agoDropbox StaffIt looks like the ValueError issue is fixed in requests v2.17.1, so please update to that and let me know if you're still seeing any issues.
- scps9507078 years agoExplorer | Level 4
Same problem still meet after upgrading requests to 2.18.1
>>> import dropbox >>> dbx = dropbox.Dropbox(' my token') >>> dbx.users_get_current_account() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/scps950707/.local/lib/python2.7/site-packages/dropbox/base.py", line 3277, in users_get_current_account None, File "/home/scps950707/.local/lib/python2.7/site-packages/dropbox/dropbox.py", line 239, in request timeout=timeout) File "/home/scps950707/.local/lib/python2.7/site-packages/dropbox/dropbox.py", line 330, in request_json_string_with_retry timeout=timeout) File "/home/scps950707/.local/lib/python2.7/site-packages/dropbox/dropbox.py", line 414, in request_json_string timeout=timeout, File "/home/scps950707/.local/lib/python2.7/site-packages/requests/sessions.py", line 549, in post return self.request('POST', url, data=data, json=json, **kwargs) File "/home/scps950707/.local/lib/python2.7/site-packages/requests/sessions.py", line 502, in request resp = self.send(prep, **send_kwargs) File "/home/scps950707/.local/lib/python2.7/site-packages/requests/sessions.py", line 612, in send r = adapter.send(request, **kwargs) File "/home/scps950707/.local/lib/python2.7/site-packages/requests/adapters.py", line 440, in send timeout=timeout File "/home/scps950707/.local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 587, in urlopen timeout_obj = self._get_timeout(timeout) File "/home/scps950707/.local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 302, in _get_timeout return Timeout.from_float(timeout) File "/home/scps950707/.local/lib/python2.7/site-packages/requests/packages/urllib3/util/timeout.py", line 154, in from_float return Timeout(read=timeout, connect=timeout) File "/home/scps950707/.local/lib/python2.7/site-packages/requests/packages/urllib3/util/timeout.py", line 94, in __init__ self._connect = self._validate_timeout(connect, 'connect') File "/home/scps950707/.local/lib/python2.7/site-packages/requests/packages/urllib3/util/timeout.py", line 127, in _validate_timeout "int, float or None." % (name, value)) ValueError: Timeout value connect was Timeout(connect=30, read=30, total=None), but it must be an int, float or None.
adium-theme-ubuntu==0.3.4 backports.shutil-get-terminal-size==1.0.0 backports.shutil-which==3.5.1 beautifulsoup4==4.4.1 ccsm==0.9.12.2 certifi==2017.4.17 chardet==3.0.4 colorama==0.3.7 compizconfig-python==0.9.12.2 configparser==3.5.0 decorator==4.0.11 defer==1.0.6 Django==1.10.5 django-dbbackup==3.1.3 django-storages==1.6 dropbox==7.3.1 enum34==1.1.6 flake8==3.3.0 futures==3.0.5 html5lib==0.999 idna==2.5 iso-639==0.4.5 iso3166==0.8 lxml==3.5.0 mccabe==0.6.1 mysqlclient==1.3.10 pathlib2==2.2.1 psutil==5.1.3 pycodestyle==2.3.1 pycryptodome==3.4.5 pyflakes==1.5.0 Pygments==2.1 pygobject==3.20.0 python-apt==1.1.0b1 python-debian==0.1.27 pytz==2017.2 requests==2.18.1 scandir==1.4 singledispatch==3.4.0.3 six==1.10.0 streamlink==0.3.2 the**bleep**==3.14 typing==3.6.1 ubuntu-cleaner==1.0.4 unity-lens-photos==1.0 urllib3==1.21.1
- RCR8 years agoExplorer | Level 3
Sorry I wasn't clear. Let me try again.
I have a folder called 'testFolder' and two apps. The folder itself has 1 PDF file.
For the app with access to a single folder, (set to 'testFolder' in the app settings), the following produces an empty list of entries:for entry in dbx.files_list_folder('').entries: print(entry.name)
Now, for the app with full access, the following produces a list with the one entry for the PDF file:
for entry in dbx.files_list_folder('/Apps/testFolder').entries: print(entry.name)
These two operations are supposed to be accessing the same folder, are they not?
Thank you for your help so far- Greg-DB8 years agoDropbox StaffThanks for clarifying. Yes, those two should give you the same listing.
Make sure both apps are linked to the same account though. You can use users_get_current_account to check that.
If you're still getting unexpected results, feel free to open a ticket with the specific code and output from the affected account and we'll be happy to look into it specifically for you:
https://www.dropbox.com/developers/contact
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 3 hours agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!