Alwrity - Bug fixes

This commit is contained in:
AjaySi
2024-04-12 17:36:37 +05:30
parent cf6516eeee
commit e3c3c03729
18 changed files with 81 additions and 81 deletions

View File

@@ -109,7 +109,7 @@ def save_blog_to_file(blog_content, blog_title, blog_meta_desc, blog_tags, blog_
# Write to the file
try:
with open(blog_output_path, "w") as f:
with open(blog_output_path, "w", encoding="utf-8") as f:
f.write(blog_frontmatter)
f.write(blog_content)
except Exception as e:

View File

@@ -19,7 +19,7 @@ def save_generated_image(img_generation_response, image_dir):
try:
response = requests.get(generated_image_url, stream=True)
response.raise_for_status()
with open(generated_image_filepath, "wb") as image_file:
with open(generated_image_filepath, "wb", encoding="utf-8") as image_file:
image_file.write(response.content)
except requests.exceptions.RequestException as e:
logger.error(f"Failed to get generated image content: {e}")