Skip to content

Commit

Permalink
To avoid having the empty file being generated and the download works…
Browse files Browse the repository at this point in the history
… on both the versions of xml files
  • Loading branch information
sugan89 committed Jul 25, 2024
1 parent 8280bf9 commit b304e46
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/pe2loaddata/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,8 @@ def headless(
# Download index file to output directory
try:
bucket, index_file_key = index_file.split(f"s3://")[1].split("/",1)
index_file = output_path + "/Index.xml"
with open(index_file, "wb") as f:
s3.download_fileobj(bucket, index_file_key, f)
index_file = os.path.join(output_path, "Index.xml")
s3.download_file(bucket, index_file_key, index_file)
except botocore.exceptions.ClientError as error:
print('Index.xml not found. Looking for Index.idx.xml file')
try:
Expand Down

0 comments on commit b304e46

Please sign in to comment.