Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ftp downloading for older python versions #81

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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))

Check warning on line 441 in trollsched/satpass.py

View check run for this annotation

Codecov / codecov/patch

trollsched/satpass.py#L441

Added line #L441 was not covered by tests
f = None

if f is not None:
try:
if sys.version_info < (2, 7, 10):
f.ssl_version = ssl.PROTOCOL_SSLv23

Check warning on line 447 in trollsched/satpass.py

View check run for this annotation

Codecov / codecov/patch

trollsched/satpass.py#L446-L447

Added lines #L446 - L447 were not covered by tests
f.login("anonymous", "guest")
logger.debug("Logged in")
except ftplib.error_perm:
Expand Down