File handle name

merge-requests/30/head
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: if handle_domain not in allowed_domains:
allowed_domains.append(handle_domain) allowed_domains.append(handle_domain)
except OSError as ex: except OSError as ex:
print('EX: failed to read ' + following_filename + print('EX: set_broch_mode failed to read ' +
' ' + str(ex)) following_filename + ' ' + str(ex))
break break
# write the allow file # write the allow file

View File

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