python-frontmatter icon indicating copy to clipboard operation
python-frontmatter copied to clipboard

Allow pathlib in types

Open verhovsky opened this issue 1 year ago • 1 comments

I did this:

from pathlib import Path
import frontmatter

markdown_file = Path("build") / "foo.md"
loaded = frontmatter.load(markdown_file)

What I got

Argument of type "Path" cannot be assigned to parameter "fd" of type "str | IOBase" in function

The code works, you just have to fix the types.

verhovsky avatar May 16 '24 13:05 verhovsky

(title should say os.PathLike, not pathlib)

merwok avatar May 16 '24 14:05 merwok