Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fk/issue 31 #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/motuclient/motu_utils/motu_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ def dl_2_file(dl_url, fh, block_size=65535, isADownloadRequest=None, **options):

# download file
temp = None
size = -1
if not fh.startswith("console"):
temp = open(fh, 'w+b')

Expand All @@ -384,7 +385,6 @@ def dl_2_file(dl_url, fh, block_size=65535, isADownloadRequest=None, **options):

log.info('File type: %s' % headers['Content-Type'])
# check if a content length (size of the file) has been send
size = -1
if "Content-Length" in headers:
try:
# it should be an integer
Expand Down Expand Up @@ -472,6 +472,7 @@ def none_function(sizeRead):
log.trace(' . processor: %s' % processor)
log.trace(' . python : %s' % sys.version.replace("\n", " "))
log.trace(' . client : %s' % get_client_version())
raise e

finally:
m.close()
Expand Down