Do not manually create a directory in the zip file
authorKarl O. Pinc <kop@karlpinc.com>
Sat, 5 Oct 2024 00:45:37 +0000 (19:45 -0500)
committerKarl O. Pinc <kop@karlpinc.com>
Sat, 5 Oct 2024 00:45:37 +0000 (19:45 -0500)
It seems that directories are created automatically, when "at=" paths
contain directories.  Since ZipFile.mkdir() does not exist until
Python 3.11, forgo manually creating the directory.

src/pgwui_sql/views/sql.py

index 007dfe6f65541f145d54e0a84f1a038b4f9f9ce1..c000e7f67c75ba986aac527f922bde35ad17eca4 100644 (file)
@@ -335,8 +335,6 @@ class SQLResultsHandler(pgwui_core.core.SessionDBHandler):
         # Optimized to minimize RAM usage
         null_rep = self.uf['null_rep']
         self.open_tfile()
-        if self.uf['download_as'] == MANY_FILES_VALUE:
-            self.zip_fd.mkdir(self.dl_filename)
         writer = self.write_sql()
 
         nextset = True