From 5658b8ab8bc2bdb4c1b4629d970c087fab3264a2 Mon Sep 17 00:00:00 2001 From: Ryan Howard Date: Tue, 24 Sep 2024 12:29:05 -0400 Subject: [PATCH] fix(hardware): Fix the pressure sensor log from growing infinitely (#16338) # Overview When looking at another bug I saw that this log was growing forever and this will eventually fill up the diskspace on the robot which is very bad. ## Test Plan and Hands on Testing We can check that this file stays in the <1k range but honestly it would have shown up in bugs of the disk filling up. ## Changelog ## Review requests ## Risk assessment Super low risk, doesn't effect the user at all. this is just a debugging log. --- hardware/opentrons_hardware/sensors/sensor_driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/opentrons_hardware/sensors/sensor_driver.py b/hardware/opentrons_hardware/sensors/sensor_driver.py index ac40ddf0c11..84780695e66 100644 --- a/hardware/opentrons_hardware/sensors/sensor_driver.py +++ b/hardware/opentrons_hardware/sensors/sensor_driver.py @@ -243,7 +243,7 @@ def __init__( async def __aenter__(self) -> None: """Create a csv heading for logging pressure readings.""" - self.data_file = open(self.data_file, "a") + self.data_file = open(self.data_file, "w") self.csv_writer = csv.writer(self.data_file) self.csv_writer.writerows([self.file_heading, self.sensor_metadata])