Skip to content

Commit 7f46165

Browse files
committed
FIX: in write_to_s3 for unneeded add_path
1 parent ab4f5eb commit 7f46165

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/pyrad_proc/pyrad/io/write_data.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
import csv
5656
import os
5757

58-
from urllib.parse import urlparse
5958
from warnings import warn
6059
import smtplib
6160
from email.message import EmailMessage
@@ -134,10 +133,9 @@ def write_to_s3(fname, basepath, s3endpoint, s3bucket, s3path="", s3accesspolicy
134133
warn("Saving to S3 failed...")
135134
return
136135

137-
add_path = s3endpoint.replace(urlparse(s3endpoint).netloc, "").split("///")[1]
138136
if not s3endpoint.startswith("https://"): # add prefix
139137
s3endpoint = f"https://{s3endpoint}"
140-
endpoint_raw = s3endpoint.replace(add_path, "").replace("https://", "")
138+
endpoint_raw = s3endpoint.replace("https://", "")
141139
if s3path:
142140
if not s3path.endswith("/"):
143141
s3path += "/"

0 commit comments

Comments
 (0)