File handle name

main
Bob Mottram 2024-07-13 13:06:28 +01:00
parent 7aa32a99e8
commit 97a4beee60
2 changed files with 5 additions and 4 deletions

View File

@ -1647,8 +1647,8 @@ def set_broch_mode(base_dir: str, domain_full: str, enabled: bool) -> None:
if handle_domain not in allowed_domains:
allowed_domains.append(handle_domain)
except OSError as ex:
print('EX: failed to read ' + following_filename +
' ' + str(ex))
print('EX: set_broch_mode failed to read ' +
following_filename + ' ' + str(ex))
break
# write the allow file

View File

@ -803,8 +803,9 @@ def html_edit_blog(media_instance: bool, translate: {},
dir_str = data_dir(base_dir)
if os.path.isfile(dir_str + '/newpost.txt'):
try:
with open(dir_str + '/newpost.txt', 'r', encoding='utf-8') as file:
edit_blog_text = '<p>' + file.read() + '</p>'
with open(dir_str + '/newpost.txt', 'r',
encoding='utf-8') as fp_blog:
edit_blog_text = '<p>' + fp_blog.read() + '</p>'
except OSError:
print('EX: html_edit_blog unable to read ' +
dir_str + '/newpost.txt')