You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
sparkie127
5 years agoExplorer | Level 3
files_list_folder encoding issue
I've tried to use the sample code provided in other discussions to no avail.
#!/usr/bin/env python
import dropbox
dbx = dropbox.Dropbox("***TOKEN*GOES*HERE***")
myDir = dbx.files_list_folder...
- 5 years ago
This code looks correct, and doesn't fail for me when I plug in my own access token.
Looking at the stack trace, it appears to be failing when making the request, specifically when writing a particular header. The only header here that would be varying though is the Authorization header with your access token. Also, the character it's failing on seems to be the unicode character for an em dash. So, it sounds like your access token string has unicode in it, when it should only contain ASCII. (Perhaps you opened or saved it in a text editor that automatically performed some conversion?)
To fix this, replace any non-ASCII characters in your access token with the correct ASCII character, such as the ASCII dash "-", or just get a new access token and use it as is.
Greg-DB
Dropbox Staff
This code looks correct, and doesn't fail for me when I plug in my own access token.
Looking at the stack trace, it appears to be failing when making the request, specifically when writing a particular header. The only header here that would be varying though is the Authorization header with your access token. Also, the character it's failing on seems to be the unicode character for an em dash. So, it sounds like your access token string has unicode in it, when it should only contain ASCII. (Perhaps you opened or saved it in a text editor that automatically performed some conversion?)
To fix this, replace any non-ASCII characters in your access token with the correct ASCII character, such as the ASCII dash "-", or just get a new access token and use it as is.
sparkie127
5 years agoExplorer | Level 3
That was the problem... My token had a em dash in it... Thank you!!!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,883 PostsLatest Activity: 5 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!