diff --git a/ogstools/msh2vtu/_cli.py b/ogstools/msh2vtu/_cli.py
index bff6f853471c385e3050f1587ecce2a6e2fb52f6..3974a11080f2d48a75c054c60c3961c6c7e2681b 100644
--- a/ogstools/msh2vtu/_cli.py
+++ b/ogstools/msh2vtu/_cli.py
@@ -68,7 +68,9 @@ def cli() -> int:
         filename=args.filename, dim=args.dim, reindex=args.reindex, log=args.log
     )
 
-    output_basename = args.filename.stem if args.prefix == "" else args.prefix
+    output_basename = (
+        Path(args.filename).stem if args.prefix == "" else args.prefix
+    )
 
     for name, mesh in meshes.items():
         if args.delz: