Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix getting pandoc version number #638
The issue in #621 was that pandoc produces output that's not in the locale encoding. It may be using UTF-8 in all cases, but I don't think that really matters. The version number which we're trying to get is probably always going to be made up of ascii characters.
So the change here tells subprocess not to decode the output, so we get bytes back from it. Then we take the first line, and decode that ourselves to get the version number. The bytes.splitlines() method already copes with the different newline conventions, so we don't need subprocess to handle that.