eyeseast / python-frontmatter

Parse and manage posts with YAML (or other) frontmatter
http://python-frontmatter.rtfd.io
MIT License
329 stars 43 forks source link

Allow pathlib in types #116

Open verhovsky opened 4 months ago

verhovsky commented 4 months ago

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.

merwok commented 4 months ago

(title should say os.PathLike, not pathlib)