Skip to content

Commit 09491c0

Browse files
committed
change some open fn encoding to utf-8
1 parent 588b22e commit 09491c0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

request_llms/bridge_moonshot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __converter_file(self, user_input: str):
3131
files.append(f)
3232
for file in files:
3333
if file.split('.')[-1] in ['pdf']:
34-
with open(file, 'r') as fp:
34+
with open(file, 'r', encoding='utf8') as fp:
3535
from crazy_functions.crazy_utils import read_and_clean_pdf_text
3636
file_content, _ = read_and_clean_pdf_text(fp)
3737
what_ask.append({"role": "system", "content": file_content})

themes/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def minimize_js(common_js_path):
2929
os.remove(old_min_js)
3030
# use rjsmin to minimize `common_js_path`
3131
c_jsmin = rjsmin.jsmin
32-
with open(common_js_path, "r") as f:
32+
with open(common_js_path, "r", encoding='utf-8') as f:
3333
js_content = f.read()
3434
if common_js_path == "themes/common.js":
3535
js_content = inject_mutex_button_code(js_content)
@@ -38,7 +38,7 @@ def minimize_js(common_js_path):
3838
sha_hash = hashlib.sha256(minimized_js_content.encode()).hexdigest()[:8]
3939
minimized_js_path = common_js_path + '.min.' + sha_hash + '.js'
4040
# save to minimized js file
41-
with open(minimized_js_path, "w") as f:
41+
with open(minimized_js_path, "w", encoding='utf-8') as f:
4242
f.write(minimized_js_content)
4343
# return minimized js file path
4444
return minimized_js_path

0 commit comments

Comments
 (0)