Skip to content

Commit

Permalink
Fixed bug in upload where AttributeError was rasied when trying to up…
Browse files Browse the repository at this point in the history
…load file-like objects without a name attribute.
  • Loading branch information
jjjake committed Jan 6, 2017
1 parent f52ff26 commit d98925b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
Release History
---------------

1.2.0 (?)
+++++++++

**Bugfixes**

- Fixed bug in upload where AttributeError was rasied when trying to upload file-like objects without a name attribute.

1.1.0 (2016-11-18)
++++++++++++++++++

Expand Down
5 changes: 4 additions & 1 deletion internetarchive/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,10 @@ def upload_file(self, body,
filename = body
body = open(body, 'rb')
else:
filename = body.name
if key:
filename = key
else:
filename = body.name

size = get_file_size(body)

Expand Down

0 comments on commit d98925b

Please sign in to comment.