Skip to content

Commit

Permalink
Merge pull request #48 from henilp105/main
Browse files Browse the repository at this point in the history
fix: octet stream encoding
  • Loading branch information
henilp105 authored Jun 26, 2023
2 parents e9fcf03 + 7aa6df6 commit 2a55a8c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions flask/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import math
import semantic_version
from license_expression import get_spdx_licensing
from io import BytesIO
# import validate_package


Expand Down Expand Up @@ -805,8 +806,10 @@ def checkUserUnauthorizedForNamespaceTokenCreation(user_id, namespace_doc):


def extract_fpm_toml(file_obj):
tar = tarfile.open(fileobj=file_obj, mode='r')

binary_stream = BytesIO()
binary_stream.write(file_obj.getbuffer())
binary_stream.seek(0)
tar = tarfile.open(fileobj=binary_stream, mode='r')
fpm_toml_file = None
for file in tar.getmembers():
if file.name == 'fpm.toml':
Expand All @@ -819,7 +822,7 @@ def extract_fpm_toml(file_obj):
extracted_file = tar.extractfile(fpm_toml_file)
toml_data = extracted_file.read()
tar.close()
parsed_toml = toml.loads(toml_data)
parsed_toml = toml.loads(str(toml_data, 'utf-8'))
return parsed_toml

def convert_zip_to_tar(zip_file):
Expand Down

0 comments on commit 2a55a8c

Please sign in to comment.