You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
f'Filepath is {len(outpath+url_set["flnm"][i])} characters long. Filepaths on Windows are limited to 260 characters. Move your working directory closer to the root directory or enable long path support in Windows through the Registry Editor.')
541
+
return
570
542
571
-
exceptException:
572
-
logging.info(f"File {url_set['flnm'][i]} could not be downloaded and was skipped. If this issue persists, check your network connection and check the NEON Data Portal for outage alerts.")
f"File {url_set['flnm'][i]} could not be downloaded. Re-attempting.")
581
+
print(e)
582
+
j=j+1
583
+
time.sleep(5)
584
+
585
+
exceptException:
586
+
logging.info(
587
+
f"File {url_set['flnm'][i]} could not be downloaded and was skipped. If this issue persists, check your network connection and check the NEON Data Portal for outage alerts.")
f'Filepath is {len(file_fullpath_abs)} characters long. Filepaths on Windows are limited to 260 characters. Set the savepath to be closer to the root directory or enable long path support in Windows through the Registry Editor.')
641
+
return
657
642
658
-
exceptException:
659
-
logging.info(f"File {os.path.basename(url)} could not be downloaded and was skipped or partially downloaded. If this issue persists, check your network connection and check the NEON Data Portal for outage alerts.")
f"File {os.path.basename(url)} could not be downloaded. Re-attempting.")
659
+
j=j+1
660
+
time.sleep(5)
661
+
else:
662
+
j=0
663
+
whilej<3:
664
+
try:
665
+
r=requests.get(url, stream=True,
666
+
headers={"X-API-TOKEN": token,
667
+
"accept": "application/json",
668
+
"User-Agent": usera},
669
+
timeout=(10, 120))
670
+
j=j+5
671
+
exceptException:
672
+
logging.info(
673
+
f"File {os.path.basename(url)} could not be downloaded. Re-attempting.")
674
+
j=j+1
675
+
time.sleep(5)
676
+
677
+
withopen(file_fullpath, 'wb') asf:
678
+
forchunkinr.iter_content(chunk_size=chunk_size):
679
+
ifchunk:
680
+
f.write(chunk)
681
+
r.close()
682
+
683
+
exceptExceptionase:
684
+
logging.info(f"File {os.path.basename(url)} could not be downloaded and was skipped or partially downloaded. If this issue persists, check your network connection and check the NEON Data Portal for outage alerts.")
0 commit comments