I expect it to return a new collaboration object, since the call is succeeding. I confirmed many times the ownership is transferred successfully.
The API is returning a 204 instead of a 200, which seems to be breaking the SDK.
Adding collab
Updated collab
Traceback (most recent call last):
File "./box_reorg_test.py", line 43, in <module>
main()
File "./box_reorg_test.py", line 33, in main
_ = src_collab.update_info(CollaborationRole.OWNER)
File "/Users/my_username/workspace/box-scripts/venv/lib/python3.7/site-packages/boxsdk/util/api_call_decorator.py", line 71, in call
return method(*args, **kwargs)
File "/Users/my_username/workspace/box-scripts/venv/lib/python3.7/site-packages/boxsdk/object/collaboration.py", line 61, in update_info
return super(Collaboration, self).update_info(data=data)
File "/Users/my_username/workspace/box-scripts/venv/lib/python3.7/site-packages/boxsdk/util/api_call_decorator.py", line 71, in call
return method(*args, **kwargs)
File "/Users/my_username/workspace/box-scripts/venv/lib/python3.7/site-packages/boxsdk/object/base_object.py", line 127, in update_info
box_response = self._session.put(url, data=json.dumps(data), params=params, headers=headers, **kwargs)
File "/Users/my_username/workspace/box-scripts/venv/lib/python3.7/site-packages/boxsdk/session/session.py", line 121, in put
return self.request('PUT', url, **kwargs)
File "/Users/my_username/workspace/box-scripts/venv/lib/python3.7/site-packages/boxsdk/session/session.py", line 157, in request
response = self._prepare_and_send_request(method, url, **kwargs)
File "/Users/my_username/workspace/box-scripts/venv/lib/python3.7/site-packages/boxsdk/session/session.py", line 400, in _prepare_and_send_request
self._raise_on_unsuccessful_request(network_response, request)
File "/Users/my_username/workspace/box-scripts/venv/lib/python3.7/site-packages/boxsdk/session/session.py", line 332, in _raise_on_unsuccessful_request
network_response=network_response,
boxsdk.exception.BoxAPIException: Message: Non-json response received, while expecting json response.
Status: 204
Code: None
Request ID: None
Headers: {'Date': 'Mon, 27 Jul 2020 23:16:54 GMT', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000', 'Cache-Control': 'no-cache, no-store', 'BOX-REQUEST-ID': '065305bafe80ff3870567b8c931b5d5aa'}
URL: https://api.box.com/2.0/collaborations/27688108163
Method: PUT
Context Info: None
Description of the Issue
When I try to call update_info on a collaboration, the SDK throws an exception, although the call succeeds.
The method I'm using: https://github.com/box/box-python-sdk/blob/master/docs/usage/collaboration.md#edit-a-collaboration
Steps to Reproduce
I am attempting to set a new owner on a folder, according to: https://developer.box.com/guides/folders/single/change-owner/
Note that this WORKS as intended. The post to update_info is succeeding, it is the response
that fails.
My code:
Expected Behavior
I expect it to return a new collaboration object, since the call is succeeding. I confirmed many times the ownership is transferred successfully.
The API is returning a 204 instead of a 200, which seems to be breaking the SDK.
Error Message, Including Stack Trace
Versions Used
Python SDK: boxsdk 2.6.0
Python: 3.7.2