Skip to content

Commit

Permalink
Merge pull request #81 from mraspaud/fix-ftp-dl
Browse files Browse the repository at this point in the history
Fix ftp downloading for older python versions
  • Loading branch information
adybbroe authored Nov 19, 2024
2 parents 9dc25cb + 77cb0f2 commit 5ca54ea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion trollsched/satpass.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import operator
import os
import socket
import ssl
import sys
from datetime import datetime, timedelta
from functools import reduce as fctools_reduce
from tempfile import gettempdir, mkstemp
Expand Down Expand Up @@ -436,11 +438,13 @@ def get_aqua_terra_dumpdata_from_ftp(sat, dump_url):
try:
f = ftplib.FTP_TLS(url.netloc)
except (socket.error, socket.gaierror) as e:
logger.error("cannot reach to %s " % HOST + str(e))
logger.error("cannot reach to %s " % url.netloc + str(e))
f = None

if f is not None:
try:
if sys.version_info < (2, 7, 10):
f.ssl_version = ssl.PROTOCOL_SSLv23
f.login("anonymous", "guest")
logger.debug("Logged in")
except ftplib.error_perm:
Expand Down

0 comments on commit 5ca54ea

Please sign in to comment.