from emotions import hate
mod_python’s publisher handler is really, really frustrating. It utterly collapses in face of Python’s module caching process and it’ll take your sanity along with it. You’ll get “NoneType is not callable, bitch” errors because functions, especially decorated functions based on a global decorator that has to exist across modules because Python’s not that big on singletons or, for that matter, true global scope. You find yourself manually touching code because that’s the only way to force a reload in mod_python.
So that’s how I found myself in mod_python’s internals (thank God it’s written in Python), mucking about with conditionals and contemplating switching to another, more mind-friendly programming language when I struck upon the simplest, most elegant solution: find all instances of cache.reload = 0 and replace the zero with the one. Boom, perma-reload that doesn’t screw up any edge cases between development and production modes.
This is what AutoReload should do. Nobody wants its current, weaker-than-thou semantics. It’s the halfway compromise that everybody hates. And according to Google about five people have ever developed a mod_python application. Python web frameworks seem to implicitly acknowledge mod_python’s failures by not using the recommended publisher handler, implementing a development mode mini-server that restarts constantly, or both.
This problem has currently taken up an entire 20% of my toy wiki project development time. I’ve learned nothing about Python during this time. Grr.
Oh, and the easiest way to learn WSGI is to read its PEP, which could’ve been written with so much fewer words but has yet to exist in such a form.