byorgey / BlogLiterately

Command-line tool for formatting and publishing blog posts.
GNU General Public License v3.0
19 stars 4 forks source link

Better handling of invalid characters #15

Open heades opened 9 years ago

heades commented 9 years ago

I just installed BlogLiterately v0.7.1.7. It built and installed just fine, but when I try to post a new post to my blog, I get an error:

BlogLiterately --blog=http://blog.metatheorem.org/xmlrpc.php --user=heades --password="..." --title="Categorical Proof Theory of Dualized Type Theory: Filtered Categories" post.bl

BlogLiterately: user error (Error calling metaWeblog.newPost: Error -32700: parse error. not well formed)

Any ideas about this?

byorgey commented 9 years ago

Yikes. Thanks for the report. I'll try to look into it soon, though I don't have very much time at the moment (teaching two classes and finishing my dissertation!). If you happen to have the time and inclination to do a bit of source diving and pinpoint more exactly where things are going wrong, or even figure out what exactly it is that it can't parse, that would help a lot.

heades commented 9 years ago

Thanks a lot Brent. I should have a little time this weekend to take a look at it. I will post more info. then. Good luck on finishing up!

byorgey commented 9 years ago

Thanks Harley!

heades commented 9 years ago

Okay, so I found time this morning to dig around and see if I could see what's going on.

The problem turns out to be something that was annoying to debug.

I had a hidden control character in the file I was trying to post.

It was ' ' :-) That is, the ascii character 23 which is called "End transmission block." It turns out the the XML-RPC server doesn't like these in the post description.

I guess a fix would be to remove control characters before posting, but I am not sure. Everything works out when the character is removed.

heades commented 9 years ago

You might also be wondering how I got the control characters in there to begin with. I had a post I was writing directly on wordpress, and I copied the content -- when viewing in text mode instead of visual -- into a file to use with BlogLiterately. It turns out that wordpress adds these characters.

byorgey commented 9 years ago

Thanks for looking into this, Harley. Glad you got it to work. Moving forward I agree there ought to be some better way of handling this, e.g. removing invalid characters, or at the very least giving a sensible error message that gives the user a better indication of what is wrong. I've edited the title of this ticket to reflect that.

heades commented 9 years ago

No problem. I am glad you agree, and I agree with the issue title change. :-)