box-python-sdk icon indicating copy to clipboard operation
box-python-sdk copied to clipboard

IndexError raised from get_thumbnail_representation

Open DaveSawyer opened this issue 4 years ago • 2 comments

  • [ ] I have checked that the SDK documentation doesn't solve my issue.
  • [ ] I have checked that the API documentation doesn't solve my issue.
  • [ ] I have searched the Box Developer Forums and my issue isn't already reported (or if it has been reported, I have attached a link to it, for reference).
  • [ ] I have searched Issues in this repo and my issue isn't already reported.

Description of the Issue

If a file is old and has no representations or if you ask for dimensions that are not available, the SDK crashes with an index error. It assumes there will always be at least one representation returned.

Steps to Reproduce

Included unit test in patch that shows the error if you pass unexpected dimensions

Expected Behavior

0 bytes returned

Error Message, Including Stack Trace

  url = representation[0]['content']['url_template']

E IndexError: list index out of range

Screenshots

Versions Used

Python SDK: 2.12 Python: 3.7

DaveSawyer avatar May 01 '21 23:05 DaveSawyer

Hi @DaveSawyer ,

Thanks for submitting this Issue! We will address it in our next sprint (SDK-1677)!

@PJSimon

PJSimon avatar May 02 '21 04:05 PJSimon

Great! I look forward to switching from the thumbnail API to the representations API in the next release of Box Drive

DaveSawyer avatar May 04 '21 17:05 DaveSawyer

This issue has been automatically marked as stale because it has not been updated in the last 30 days. It will be closed if no further activity occurs within the next 7 days. Feel free to reach out or mention Box SDK team member for further help and resources if they are needed.

stale[bot] avatar Dec 19 '22 20:12 stale[bot]

This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box Python SDK and feel free to open another PR/issue at any time.

stale[bot] avatar Dec 27 '22 06:12 stale[bot]