diff --git a/src/logfile_parser/swainlab_parser.py b/src/logfile_parser/swainlab_parser.py
index d53779ab97aebaf2bf1a51cc2ebbb1ffcdb3f0d7..b7f49c694dd0a0e6b9f6b327e62e5bac50979d79 100644
--- a/src/logfile_parser/swainlab_parser.py
+++ b/src/logfile_parser/swainlab_parser.py
@@ -104,7 +104,7 @@ class HeaderEndNotFound(Exception):
 
 def extract_header(filepath: Path):
     """Extract content of log file before the experiment starts."""
-    with (filepath, "r", errors="ignore", encoding = 'unicode_escape') as f:
+    with open(filepath, "r", errors="ignore", encoding = 'unicode_escape') as f:
         try:
             header = ""
             for _ in range(MAX_NLINES):