File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
cms/server/admin/handlers Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -621,15 +621,12 @@ def post(self, dataset_id):
621621 temp_file = io .BytesIO ()
622622 with zipfile .ZipFile (temp_file , "w" ) as zip_file :
623623 for testcase in dataset .testcases .values ():
624- # Get input, output file path
625- with self .service .file_cacher .get_file (testcase .input ) as f :
626- input_path = f .name
627- with self .service .file_cacher .get_file (testcase .output ) as f :
628- output_path = f .name
629- zip_file .write (
630- input_path , input_template % testcase .codename )
631- zip_file .write (
632- output_path , output_template % testcase .codename )
624+ # Copy input file
625+ with zip_file .open (input_template % testcase .codename , 'w' ) as fout :
626+ self .service .file_cacher .get_file_to_fobj (testcase .input , fout )
627+ # Copy output file
628+ with zip_file .open (output_template % testcase .codename , 'w' ) as fout :
629+ self .service .file_cacher .get_file_to_fobj (testcase .output , fout )
633630
634631 self .set_header ("Content-Type" , "application/zip" )
635632 self .set_header ("Content-Disposition" ,
You can’t perform that action at this time.
0 commit comments