Closed svenevs closed 7 years ago
That should be a doc fix, I think. We need to send out bytes if we're writing to disk, and we can't assume the file-like thing will do more than write bytes, so we're stuck encoding. I wrote the first version of this for 2.7, so there are clearly still some two-isms lying around.
Should be fixed now. I had BytesIO
in the README, but forgot to update it in the real docs. Thanks for catching.
There's a problem and/or misleading documentation where
frontmatter.dump
is concerned. I figured I'd give a full example, but the easy fix for you is to just saySo I'm using
frontmatter
to parse and re-write some things. It goes something like thisIt's because you do
fd.write(content.encode(encoding))
, andencode
is going to return abytes
, andStringIO
gets mad about that in python3.I can think of a number of different ways to potentially allow for both, but honestly looking at the rest of your library I think you are much better equipped to decide what the correct action is :wink: