From 320da054b999ff4d0d5879278c5f7d201d71a8e9 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Mon, 15 Dec 2025 10:00:50 +0200 Subject: [PATCH] Support pathlib.Path in Parse.parsefile --- src/fypp.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fypp.py b/src/fypp.py index c6d0154..e20995d 100755 --- a/src/fypp.py +++ b/src/fypp.py @@ -244,6 +244,9 @@ def parsefile(self, fobj): Args: fobj (str or file): Name of a file or a file like object. ''' + if isinstance(fobj, pathlib.Path): + fobj = str(fobj) + if isinstance(fobj, str): if fobj == STDIN: self._includefile(None, sys.stdin, STDIN, os.getcwd())