Skip to content

Commit 9cdebdd

Browse files
Fix for _get_retry_request_callable so chunked uploads continu… (#485)
1 parent 40f5541 commit 9cdebdd

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

HISTORY.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
Release History
44
---------------
55

6+
Next Release
7+
++++++++
8+
- Fixed bug in `_get_retry_request_callable` introduced in release 2.7.0 which caused chunked uploads to fail
9+
610
2.7.0 (2020-01-16)
711
++++++++
8-
- Fixed bug in get_admin_events function which caused errors when the optional event_types parameter was omitted.
12+
- Fixed bug in `get_admin_events` function which caused errors when the optional `event_types` parameter was omitted.
913
- Add marker based pagination for listing users.
1014
- Added support for more attribute parameters when uploading new files and new versions of existing files.
1115
- Combined preflight check and lookup of accelerator URL into a single request for uploads.

boxsdk/session/session.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,11 @@ def _get_retry_request_callable(self, network_response, attempt_number, request,
437437
# pylint:disable=unused-argument
438438
data = kwargs.get('data', {})
439439
grant_type = None
440-
if 'grant_type' in data:
441-
grant_type = data['grant_type']
440+
try:
441+
if 'grant_type' in data:
442+
grant_type = data['grant_type']
443+
except TypeError:
444+
pass
442445
code = network_response.status_code
443446
if (code in (202, 429) or code >= 500) and grant_type != self._JWT_GRANT_TYPE:
444447
return partial(

0 commit comments

Comments
 (0)