File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def __converter_file(self, user_input: str):
31
31
files .append (f )
32
32
for file in files :
33
33
if file .split ('.' )[- 1 ] in ['pdf' ]:
34
- with open (file , 'r' ) as fp :
34
+ with open (file , 'r' , encoding = 'utf8' ) as fp :
35
35
from crazy_functions .crazy_utils import read_and_clean_pdf_text
36
36
file_content , _ = read_and_clean_pdf_text (fp )
37
37
what_ask .append ({"role" : "system" , "content" : file_content })
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def minimize_js(common_js_path):
29
29
os .remove (old_min_js )
30
30
# use rjsmin to minimize `common_js_path`
31
31
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 :
33
33
js_content = f .read ()
34
34
if common_js_path == "themes/common.js" :
35
35
js_content = inject_mutex_button_code (js_content )
@@ -38,7 +38,7 @@ def minimize_js(common_js_path):
38
38
sha_hash = hashlib .sha256 (minimized_js_content .encode ()).hexdigest ()[:8 ]
39
39
minimized_js_path = common_js_path + '.min.' + sha_hash + '.js'
40
40
# 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 :
42
42
f .write (minimized_js_content )
43
43
# return minimized js file path
44
44
return minimized_js_path
You can’t perform that action at this time.
0 commit comments