ekalinin/nodeenv — pull request #107 by jessedhillon (2014-11-08 17:36:29+00:00)
Title: Makes `get_last_stable_node_version` more Pythonic

Hi, thanks for your work making nodeenv. Please consider this patch, which uses Python to download and parse the index from `http://nodejs.org/dist/latest/` and find the latest version. The way you were doing it before made undocumented and unnecessary assumptions about the shell environment: for example, I have `GREP_OPTIONS="--colour=always"` defined in my working environment, which adds color information to the matched output.

Your previous code was not filtering out color terminal codes from the output and thus the requested URL would have terminal codes in it -- obviously leading to a 404 when attempting to fetch the latest version of Node. In general, there is no reason why this code should spawn a subprocess just to download and parse an HTML page. There are other instances where you are launching `curl` in the same way and you could do it more efficiently (and less prone to shell environment mixups like this) by using straight Python.

Hope this helps, thanks again for all your work!

Jesse