[mod_python] http://www.modpython.org/pipermail/mod_python/2003-November/003888.html

Gregory (Grisha) Trubetskoy grisha at modpython.org
Thu Nov 6 12:01:59 EST 2003


The publisher makes this decision. It's not a simple decision to make
because a dot also serves as package.module separator in Python, so the
publisher has to make an intelligent guess on what you meant.

E.g. if you have

AddHandler mod_python .py .blah

Wheh you ask for main.blah, the publisher will drop the blah as the
extension and import module main. If you ask for main.bleh, it will assume
you meant module bleh in package main.

If you have

SetHandler mod_python

Then there is no initial list of suffixes to look at. Actually there *is*
(imp.get_suffixes()), but the publisher wasn't doing it, so in the
particular instance sited earlier in this thread, the documentation was
right and the publisher was wrong, and I think we fixed it correctly this
time for the next release.

Grisha


On Thu, 6 Nov 2003, Stian [iso-8859-1] S?iland wrote:

> On 2003-11-04 05:25:41, Jim Peterson wrote:
>
> > A URL http://www.mysite.com/hello.py/say would return ?I am saying NOTHING?.
> >
> > A URL http://www.mysite.com/hello.py/say?what=hello would return ?I am
> > saying hello?.
> > I would have hit exactly the same problem if I hadn't just seen your thread.
>
> I have been wondering myself, too, what decides if .py is required or
> not? I agree that with SetHandler, .py suffix should not be required (to
> get nicer URLs), ALTHOUGH it should still work.
>
> --
> Stian S?iland               Work toward win-win situation. Win-lose
> Trondheim, Norway           is where you win and the other lose.
> http://www.soiland.no/      Lose-lose and lose-win are left as an
>                             exercise to the reader.  [Limoncelli/Hogan]
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


More information about the Mod_python mailing list