File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ def my_get(url, **kwargs):
3939
4040# Kindly provided by our friend WizardLM-30B
4141def my_open (* args , ** kwargs ):
42+ """
43+ Custom open function that modifies the file contents before returning.
44+ """
4245 filename = str (args [0 ])
4346 if filename .endswith ("index.html" ):
4447 with original_open (* args , ** kwargs ) as f :
@@ -59,11 +62,14 @@ def my_open(*args, **kwargs):
5962 b'\n </head>'
6063 )
6164
62- return io .BytesIO (file_contents ) # return bytes
65+ return io .BytesIO (file_contents . decode () ) # return bytes
6366 else :
6467 return original_open (* args , ** kwargs )
6568
6669def my_print (* args , ** kwargs ):
70+ """
71+ Custom print function that modifies the output before printing.
72+ """
6773 if len (args ) > 0 and "To create a public link, set `share=True`" in args [0 ]:
6874 return
6975 else :
You can’t perform that action at this time.
0 commit comments