Skip to content

Add filename for failed or incomplete downloads #44

@orangebromeliad

Description

@orangebromeliad

Hi team,

I don't know why, but sometimes when I run enaDataGet not all of the files are downloaded. I can usually run the program again and it is fine, however I notice that the error message informs us how much was not downloaded but it doesn't specify which file is incomplete:

Error with FTP transfer: <urlopen error retrieval incomplete: got only 1083805828 out of 3179431281 bytes>

Could a change like this print an error of the exact file which wasn't downloaded properly?:

def get_ftp_file_with_md5_check(ftp_url, dest_dir, md5): try: filename = ftp_url.split('/')[-1] dest_file = os.path.join(dest_dir, filename) urlrequest.urlretrieve(ftp_url, dest_file) return check_md5(dest_file, md5) except Exception as e: sys.stderr.write("Error with FTP transfer: {0}\n".format(e)) sys.stderr.write("Error with FTP transfer occured for file: {}").format(filename)) return False

Thank you,
Tim

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions