Skip to content

Commit fd9f6a8

Browse files
author
Kazuki Suzuki Przyborowski
committed
Update pyarchivefile.py
1 parent 2977359 commit fd9f6a8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pyarchivefile.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9301,10 +9301,10 @@ def download_file_from_http_file(url, headers=None, usehttp=__use_http_lib__):
93019301
if usehttp == 'requests' and haverequests:
93029302
if username and password:
93039303
response = requests.get(
9304-
rebuilt_url, headers=headers, auth=(username, password), stream=True
9304+
rebuilt_url, headers=headers, auth=(username, password), timeout=(5, 30)), stream=True
93059305
)
93069306
else:
9307-
response = requests.get(rebuilt_url, headers=headers, stream=True)
9307+
response = requests.get(rebuilt_url, headers=headers, timeout=(5, 30)), stream=True)
93089308
response.raw.decode_content = True
93099309
shutil.copyfileobj(response.raw, httpfile)
93109310

@@ -9474,7 +9474,7 @@ def upload_file_to_sftp_file(sftpfile, url):
94749474
if(haveparamiko):
94759475
def upload_file_to_sftp_string(sftpstring, url):
94769476
sftpfileo = BytesIO(sftpstring)
9477-
sftpfile = upload_file_to_sftp_files(ftpfileo, url)
9477+
sftpfile = upload_file_to_sftp_files(sftpfileo, url)
94789478
sftpfileo.close()
94799479
return sftpfile
94809480
else:
@@ -9534,7 +9534,7 @@ def download_file_from_pysftp_string(url):
95349534
sftpfile = download_file_from_pysftp_file(url)
95359535
return sftpfile.read()
95369536
else:
9537-
def download_file_from_pyftp_string(url):
9537+
def download_file_from_pysftp_string(url):
95389538
return False
95399539

95409540
if(havepysftp):
@@ -9587,11 +9587,11 @@ def upload_file_to_pysftp_file(sftpfile, url):
95879587
if(havepysftp):
95889588
def upload_file_to_pysftp_string(sftpstring, url):
95899589
sftpfileo = BytesIO(sftpstring)
9590-
sftpfile = upload_file_to_pysftp_files(ftpfileo, url)
9590+
sftpfile = upload_file_to_pysftp_file(ftpfileo, url)
95919591
sftpfileo.close()
95929592
return sftpfile
95939593
else:
9594-
def upload_file_to_pysftp_string(url):
9594+
def upload_file_to_pysftp_string(sftpstring, url):
95959595
return False
95969596

95979597

0 commit comments

Comments
 (0)