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

Add filename for failed or incomplete downloads #44

Open
orangebromeliad opened this issue Oct 4, 2019 · 0 comments
Open

Add filename for failed or incomplete downloads #44

orangebromeliad opened this issue Oct 4, 2019 · 0 comments
Assignees

Comments

@orangebromeliad
Copy link

orangebromeliad commented Oct 4, 2019

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

@orangebromeliad orangebromeliad changed the title Add filename for failed or cinomplete downloads Add filename for failed or incomplete downloads Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants