Skip to content

Commit ab1579f

Browse files
author
Kazuki Suzuki Przyborowski
committed
Small update
1 parent 5ada45b commit ab1579f

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

pywwwget.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2594,7 +2594,7 @@ def upload_file_to_sftp_file(sftpfile, url):
25942594
if(haveparamiko):
25952595
def upload_file_to_sftp_string(sftpstring, url):
25962596
sftpfileo = BytesIO(sftpstring)
2597-
sftpfile = upload_file_to_sftp_files(ftpfileo, url)
2597+
sftpfile = upload_file_to_sftp_files(sftpfileo, url)
25982598
sftpfileo.close()
25992599
return sftpfile
26002600
else:
@@ -2704,7 +2704,7 @@ def upload_file_to_pysftp_file(sftpfile, url):
27042704
if(havepysftp):
27052705
def upload_file_to_pysftp_string(sftpstring, url):
27062706
sftpfileo = BytesIO(sftpstring)
2707-
sftpfile = upload_file_to_pysftp_files(ftpfileo, url)
2707+
sftpfile = upload_file_to_pysftp_file(sftpfileo, url)
27082708
sftpfileo.close()
27092709
return sftpfile
27102710
else:

pywwwgetmini.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,10 @@ def download_file_from_http_file(url, headers=None, usehttp=__use_http_lib__):
332332
if usehttp == 'requests' and haverequests:
333333
if username and password:
334334
response = requests.get(
335-
rebuilt_url, headers=headers, auth=(username, password), stream=True
335+
rebuilt_url, headers=headers, auth=(username, password), timeout=(5, 30)), stream=True
336336
)
337337
else:
338-
response = requests.get(rebuilt_url, headers=headers, stream=True)
338+
response = requests.get(rebuilt_url, headers=headers, timeout=(5, 30)), stream=True)
339339
response.raw.decode_content = True
340340
shutil.copyfileobj(response.raw, httpfile)
341341

@@ -505,7 +505,7 @@ def upload_file_to_sftp_file(sftpfile, url):
505505
if(haveparamiko):
506506
def upload_file_to_sftp_string(sftpstring, url):
507507
sftpfileo = BytesIO(sftpstring)
508-
sftpfile = upload_file_to_sftp_files(ftpfileo, url)
508+
sftpfile = upload_file_to_sftp_files(sftpfileo, url)
509509
sftpfileo.close()
510510
return sftpfile
511511
else:
@@ -618,7 +618,7 @@ def upload_file_to_pysftp_file(sftpfile, url):
618618
if(havepysftp):
619619
def upload_file_to_pysftp_string(sftpstring, url):
620620
sftpfileo = BytesIO(sftpstring)
621-
sftpfile = upload_file_to_pysftp_files(ftpfileo, url)
621+
sftpfile = upload_file_to_pysftp_file(sftpfileo, url)
622622
sftpfileo.close()
623623
return sftpfile
624624
else:

pywwwgetold.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5985,7 +5985,7 @@ def upload_file_to_sftp_file(sftpfile, url):
59855985
if(haveparamiko):
59865986
def upload_file_to_sftp_string(sftpstring, url):
59875987
sftpfileo = BytesIO(sftpstring)
5988-
sftpfile = upload_file_to_sftp_files(ftpfileo, url)
5988+
sftpfile = upload_file_to_sftp_files(sftpfileo, url)
59895989
sftpfileo.close()
59905990
return sftpfile
59915991
else:
@@ -6271,7 +6271,7 @@ def upload_file_to_pysftp_file(sftpfile, url):
62716271
if(havepysftp):
62726272
def upload_file_to_pysftp_string(sftpstring, url):
62736273
sftpfileo = BytesIO(sftpstring)
6274-
sftpfile = upload_file_to_pysftp_files(ftpfileo, url)
6274+
sftpfile = upload_file_to_pysftp_file(sftpfileo, url)
62756275
sftpfileo.close()
62766276
return sftpfile
62776277
else:

0 commit comments

Comments
 (0)