Skip to content

Commit 913a1b0

Browse files
authored
Use data extraction filter (#820)
* specify data extraction filter * wrap extractall call
1 parent 8573235 commit 913a1b0

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/scout_apm/core/agent/manager.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,14 @@ def download_package(self):
231231
return True
232232

233233
def untar(self):
234-
t = tarfile.open(self.package_location, "r")
235-
t.extractall(self.destination)
234+
try:
235+
t = tarfile.open(self.package_location, "r")
236+
# https://docs.python.org/3.12/library/tarfile.html#extraction-filters
237+
t.extractall(path=self.destination, filter="data")
238+
except Exception as e:
239+
logger.error(
240+
f"Error extracting {self.package_location} to {self.destination}: {e}"
241+
)
236242

237243
def full_url(self):
238244
return "{root_url}/{core_agent_full_name}.tgz".format(

0 commit comments

Comments
 (0)