pyblosxom.cgi should prepend, not append, to sys.path

seanh <[email protected]> Sun, 14 Apr 2013 13:03:55 +0200
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <20130414110355.GA7249@kaeru>
Hey, setting up pyblosxom using CGI on a shared UNIX server. I appended
to sys.path in pyblosxom.cgi to add the python-markdown lib (for
pyblosxom's markdown plugin), just as it does to add the config.py file:

sys.path.append("/arpa/s/seanh/pyblosxom/blog/")
sys.path.append("/arpa/s/seanh/python-markdown")

but this resulted in python-markdown crashing. I found out that the
reason was that there was a different python module also called
"markdown" installed by someone else system-wide, and the path to this
module was before the path to my python-markdown module on sys.path.

So I've now changed the two lines in my pyblosxom.cgi to this:

sys.path.insert(0, "/arpa/s/seanh/pyblosxom/blog/")
sys.path.insert(0, "/arpa/s/seanh/python-markdown")

and it works. Changing the first line wasn't necessary to fix my
markdown plugin problem but I changed it anyway just to be safe.

I wonder if the CGI deployment instructions and default pyblosxom.cgi
file should be changed to use insert instead of append? It seems safer

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter