Skip to content

Commit dcd5ef0

Browse files
committed
Formatting post-rebase (dep upgrade tweaked it?)
1 parent bef6af3 commit dcd5ef0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/galaxy/files/sources/util.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,15 @@ def _download_s3_file(s3_url: str, target_path: StrPath, headers: Optional[dict]
121121
response = requests.get(s3_url, headers=headers or {}, timeout=DEFAULT_SOCKET_TIMEOUT, stream=True)
122122
response.raise_for_status()
123123

124-
with open(target_path, 'wb') as f:
124+
with open(target_path, "wb") as f:
125125
for chunk in response.iter_content(chunk_size=CHUNK_SIZE):
126126
f.write(chunk)
127127
return
128128

129129
# For raw S3 URLs, try s3fs with different access patterns
130130
log.debug(f"Using s3fs for S3 URL: {s3_url}")
131131
import s3fs
132+
132133
s3_path = s3_url[5:] # Remove 's3://' prefix
133134

134135
# Try different S3 access methods in order of preference
@@ -142,8 +143,8 @@ def _download_s3_file(s3_url: str, target_path: StrPath, headers: Optional[dict]
142143
for method_name, fs_factory in access_methods:
143144
try:
144145
fs = fs_factory()
145-
with fs.open(s3_path, 'rb') as s3_file:
146-
with open(target_path, 'wb') as local_file:
146+
with fs.open(s3_path, "rb") as s3_file:
147+
with open(target_path, "wb") as local_file:
147148
while True:
148149
chunk = s3_file.read(CHUNK_SIZE)
149150
if not chunk:

0 commit comments

Comments
 (0)