Nick
nick at dd.revealed.net
Mon Jan 24 12:45:34 EST 2005
While I don't use the publisher handler anymore, I agree with these guys. It *is* essentially correct behavior for python, but it is also non-intuitive and a stumbling block for new users. I don't believe getting rid of the publisher handler is a solution, because it's a good starting place, simple to understand, and particularly useful to some folks. It's a good way to understand how mod_python works, in terms of an example of how to write handlers. Maybe the solution is just to document the behavior and explain WHY that happens. As a relatively experienced Python user before mod_python, it only took a short time to track this down and understand the problem, but it seems like a lot of users are new to both Python and mod_python. Secondarily, make an import function available separate from the Python import facilities that implements something like what is done in Vampire and/or mp_servlets, while leaving the default mechanism intact. Nick Daniel Popowich wrote: > I agree with Nicolas that this is a "bug". Perhaps not a bug in the > classic sense: something not working as advertised, but a design > issue so gnarly, that it smells like bug. > > Thank you Jorey for your detailed email, but I have to disagree with > you when you wrote: > > This is consistent with normal Python behaviour, where an > interpreter loads modules from the current directory or > PYTHONPATH. [1] > > I came to mod_python after *many* years of intensive python > programming and as a newbie to mod_python was caught by this issue for > days. The way mod_python imports files all at the same root level is > very UN-pythonic. After much hair-pulling I finally realized I needed > to roll my own for mpservlets.
|