Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
xfoxhack
2 years 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'
2 Replies
- Здравко2 years agoLegendary | 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_memberGood luck.
- Greg-DB2 years ago
Dropbox Community Moderator
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
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If 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, Facebook or Instagram.
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!