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
xfoxhack
9 months agoNew member | Level 2
unknown tag 'banned_member'
Hello,
I am encountering an issue with the Dropbox Python SDK. While trying to create a shared link with settings, I am receiving "Traceback (most recent call last):
File "C:\Users\Administrator\OneDrive\Desktop\TRYOFFICE\XFOX\xfoxgo.py", line 17, in <module>
shared_link_metadata = dbx.sharing_create_shared_link_with_settings(dropbox_file_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\dropbox\base.py", line 4584, in sharing_create_shared_link_with_settings
r = self.request(
^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\dropbox\dropbox_client.py", line 347, in request
deserialized_result = stone_serializers.json_compat_obj_decode(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\stone\backends\python_rsrc\stone_serializers.py", line 977, in json_compat_obj_decode
return decoder.json_compat_obj_decode_helper(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\stone\backends\python_rsrc\stone_serializers.py", line 563, in json_compat_obj_decode_helper
return self.decode_union(data_type, obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\stone\backends\python_rsrc\stone_serializers.py", line 658, in decode_union
tag, val = self.decode_union_dict(data_type, obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\stone\backends\python_rsrc\stone_serializers.py", line 676, in decode_union_dict
raise bv.ValidationError("unknown tag '%s'" % tag)
stone.backends.python_rsrc.stone_validators.ValidationError: unknown tag 'banned_member'
- ЗдравкоLegendary | Level 20
Hi xfoxhack,
Unfortunately, the type of API error you meet, is not yet included in Dropbox Python SDK supported error types for that call. Since there is not any additional error type fields (it's type void), as a workaround, you can catch the type 'ValidationError' and compare the content literally. In such a way you can introduce some support (as a patch) for that error in your application till official support if any.
Additional hack might be to put on top of your source (before any other Dropbox related method execution) on global place something like:
from dropbox import sharing as s s.CreateSharedLinkWithSettingsError._banned_member = s.bv.Void() s.CreateSharedLinkWithSettingsError._tagmap['banned_member' ] = s.CreateSharedLinkWithSettingsError._banned_member
Good luck.
- Greg-DBDropbox Staff
This error would occur because the user's account is currently banned from creating links.
As Здравко noted, the Dropbox Python SDK is not currently updated to handle that particular error properly, so it raises a ValidationError instead, but I'll ask the team to fix that up.
About Discuss Dropbox Developer & API
Make connections with other developers
795 PostsLatest Activity: 11 days 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!