rvagg/node-pygmentize-bundled — pull request #6 by ChrisWren (2013-09-07 18:11:51+00:00)
Title: Added support for Python 3 Fixes #5

After some research, I discovered that there had to be a way of running two separate sets of pygmentize code for the different python major versions. There is a code conversion tool called [2to3](http://docs.python.org/2/library/2to3.html) which the ruby pygmentize wrapper uses, but it was taking too long to convert the code during installation, and didn't cover the use case of a user having different python versions for different terminal sessions ie. someone who develops python code and has to use different versions for different projects.

The solution I landed on was having a python 2 and python 3 compatible version of pygmentize in the vendor folder and when node-pygmentize-bundled is run, determine the python version and use that version of pygmentize.

The only thing I wasn't clear on was why this code would have the python version logged to `stderr` instead of `stdout`. I was seeing the `error` being null, yet seeing this odd result:

```js
nodeExec('python -V', function (error, stdout, stderr) {
// Outputs python version
console.log(stderr);
// Outputs null
console.log(error);
}
```

I have verified on OSX and Windows that this solution works by running my test suite for [grunt-pages](https://github.com/CabinJS/grunt-pages)(which is dependent on node-pygmentize-bundled) on both python versions.