mirror of
https://github.com/vale981/ablog
synced 2025-03-05 09:11:38 -05:00
add encoding utf-8 with open()
This commit is contained in:
parent
0ab382f4a7
commit
61bc8cc74d
2 changed files with 2 additions and 2 deletions
|
@ -331,7 +331,7 @@ def ablog_post(filename, title=None, **kwargs):
|
||||||
# read the file, and add post directive
|
# read the file, and add post directive
|
||||||
# and save it
|
# and save it
|
||||||
else:
|
else:
|
||||||
with open(filename, 'w') as out:
|
with open(filename, 'w', encoding='utf-8') as out:
|
||||||
post_text = POST_TEMPLATE % pars
|
post_text = POST_TEMPLATE % pars
|
||||||
out.write(post_text)
|
out.write(post_text)
|
||||||
|
|
||||||
|
|
|
@ -655,7 +655,7 @@ def generate_atom_feeds(app):
|
||||||
if not os.path.isdir(parent_dir):
|
if not os.path.isdir(parent_dir):
|
||||||
os.makedirs(parent_dir)
|
os.makedirs(parent_dir)
|
||||||
|
|
||||||
with open(feed_path, 'w') as out:
|
with open(feed_path, 'w', encoding='utf-8') as out:
|
||||||
feed_str = feed.to_string()
|
feed_str = feed.to_string()
|
||||||
try:
|
try:
|
||||||
out.write(feed_str.encode('utf-8'))
|
out.write(feed_str.encode('utf-8'))
|
||||||
|
|
Loading…
Add table
Reference in a new issue