Skip to content

Commit cba078d

Browse files
author
Kazuki Suzuki Przyborowski
committed
Update pyarchivefile.py
1 parent 3df065c commit cba078d

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

pyarchivefile.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9795,12 +9795,7 @@ def download_file_from_internet_file(url, headers=geturls_headers_pyfile_python_
97959795
return download_file_from_sftp_file(url)
97969796
elif(urlparts.scheme == "tcp" or urlparts.scheme == "udp"):
97979797
outfile = MkTempFile()
9798-
use_auth = False
9799-
if(urlparts.username is not None and urlparts.password is not None):
9800-
use_auth = True
9801-
username = unquote(urlparts.username) if urlparts.username is not None else None
9802-
password = unquote(urlparts.password) if urlparts.password is not None else None
9803-
returnval = recv_to_fileobj(outfile, urlparts.hostname, urlparts.port, urlparts.scheme, require_auth=use_auth, expected_user=username, expected_pass=password)
9798+
returnval = recv_via_url(outfile, url, recv_to_fileobj)
98049799
if(not returnval):
98059800
return False
98069801
outfile.seek(0, 0)
@@ -9858,13 +9853,10 @@ def upload_file_to_internet_file(ifp, url):
98589853
else:
98599854
return upload_file_to_sftp_file(ifp, url)
98609855
elif(urlparts.scheme == "tcp" or urlparts.scheme == "udp"):
9861-
use_auth = False
9862-
if(urlparts.username is not None and urlparts.password is not None):
9863-
use_auth = True
9864-
username = unquote(urlparts.username) if urlparts.username is not None else None
9865-
password = unquote(urlparts.password) if urlparts.password is not None else None
98669856
ifp.seek(0, 0)
9867-
returnval = send_from_fileobj(ifp, urlparts.hostname, urlparts.port, urlparts.scheme, auth_user=username, auth_pass=password)
9857+
returnval = send_via_url(ifp, url, send_from_fileobj)
9858+
if(not returnval):
9859+
return False
98689860
return returnval
98699861
else:
98709862
return False

0 commit comments

Comments
 (0)