Skip to content

Commit

Permalink
FIX: in write_to_s3 for unneeded add_path
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfidan committed Jan 30, 2025
1 parent ab4f5eb commit 7f46165
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/pyrad_proc/pyrad/io/write_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
import csv
import os

from urllib.parse import urlparse
from warnings import warn
import smtplib
from email.message import EmailMessage
Expand Down Expand Up @@ -134,10 +133,9 @@ def write_to_s3(fname, basepath, s3endpoint, s3bucket, s3path="", s3accesspolicy
warn("Saving to S3 failed...")
return

add_path = s3endpoint.replace(urlparse(s3endpoint).netloc, "").split("///")[1]
if not s3endpoint.startswith("https://"): # add prefix
s3endpoint = f"https://{s3endpoint}"
endpoint_raw = s3endpoint.replace(add_path, "").replace("https://", "")
endpoint_raw = s3endpoint.replace("https://", "")
if s3path:
if not s3path.endswith("/"):
s3path += "/"
Expand Down

0 comments on commit 7f46165

Please sign in to comment.