Skip to content

Commit

Permalink
Merge pull request #158 from Haitham-ghaida/fix_data_store
Browse files Browse the repository at this point in the history
Resolve "Too Many Open Files" Error by Managing ZipFS Resources
  • Loading branch information
cmutel authored Nov 23, 2023
2 parents 8055a3d + 5a933df commit 0e575a4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bw2data/data_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ def filepath_processed(self):
return self.dirpath_processed() / self.filename_processed()

def datapackage(self):
return load_datapackage(ZipFS(self.filepath_processed()))
zip_file_path = self.filepath_processed()
with ZipFS(zip_file_path) as zip_fs:
return load_datapackage(zip_fs)

def write(self, data, process=True):
"""Serialize intermediate data to disk.
Expand Down

0 comments on commit 0e575a4

Please sign in to comment.