[modwsgi] Re: mime types

2008-10-03 Thread Graham Dumpleton
2008/10/3 Garito <[EMAIL PROTECTED]>: > > Hi! > Is there any way to do that mod_wsgi use apache mime types? > > If you go to /etc/mime.types and add some mime types mod_wsgi works ok > with them but if you add them as apache configuration via AddType it > doesn't work > > One of my main goals (as

[modwsgi] Off on a trip again. Help on mod_wsgi may be a bit spotty for a week.

2008-10-03 Thread Graham Dumpleton
I'm off on a trip for a week. I'll have easy Internet access when away, but whether I will be allowed to use it is a different matter. So, I will try and keep up with emails, but not sure how I'll go. I'll probably be off air at least now for a couple of days as will get shot if I try and read e

[modwsgi] Re: mime types

2008-10-03 Thread Garito
This could be perfect for my needs but I can't use read_mime_types without problems If I put from mimetypes import read_mime_types, add_type add_type('text/yanged-page-template', 'ypt') read_mime_types(self._url) where self._url is the absolute path to the file it returns the whole list of m

[modwsgi] Re: mime types

2008-10-03 Thread Garito
I have a class that maps the filesystem. What I want to do is determine the mime type of an url For example: If the mod_wsgi application starts at /home/myuser/mod_wsgiApplication and there are a file at /home/mysuer/mod_wsgiApplication/file1.ypt I want my application respond with (text/yan

[modwsgi] Re: mime types

2008-10-03 Thread Graham Dumpleton
2008/10/3 Garito <[EMAIL PROTECTED]>: > > This could be perfect for my needs but I can't use read_mime_types > without problems > > If I put > > from mimetypes import read_mime_types, add_type > add_type('text/yanged-page-template', 'ypt') > > > read_mime_types(self._url) > > where self._url is th

[modwsgi] Re: mod_wsgi on Python 3.0 (was Re: Python 2.6 and migration warnings flag for Python 3.0.)

2008-10-03 Thread Brian Smith
Toshio Kuratomi wrote: > > > PATH_INFO: '/â\x82¬.html' > > > > This is what Brian and I need to see.  I think that he and I both > > think this is incorrect.  However, after Brian's last message I'm > > unsure of whether it should be  '%E2%82%AC.html' or > > b'\xe2\x82\xac.html'.  I'm pretty s

[modwsgi] Re: mime types

2008-10-03 Thread Graham Dumpleton
2008/10/3 Garito <[EMAIL PROTECTED]>: > > Hi Graham! > I go to /etc/mime.types and I add > > text/yanged-page-template ypt > > Then in my wsgi module I use guess_type python function to determine > the mime type of an object and all goes as expected > > But if I delete this mime type from /etc/mi

[modwsgi] Re: mime types

2008-10-03 Thread Garito
Hi Graham! I go to /etc/mime.types and I add text/yanged-page-template ypt Then in my wsgi module I use guess_type python function to determine the mime type of an object and all goes as expected But if I delete this mime type from /etc/mime.types and add it to my site configuration via AddTyp

[modwsgi] mime types

2008-10-03 Thread Garito
Hi! Is there any way to do that mod_wsgi use apache mime types? If you go to /etc/mime.types and add some mime types mod_wsgi works ok with them but if you add them as apache configuration via AddType it doesn't work One of my main goals (as you could deduce) is to put the mod_wsgi configuration

[modwsgi] Re: mime types

2008-10-03 Thread Graham Dumpleton
2008/10/3 Graham Dumpleton <[EMAIL PROTECTED]>: > 2008/10/3 Garito <[EMAIL PROTECTED]>: >> >> Hi! >> Is there any way to do that mod_wsgi use apache mime types? >> >> If you go to /etc/mime.types and add some mime types mod_wsgi works ok >> with them but if you add them as apache configuration via

[modwsgi] Re: threading.local

2008-10-03 Thread Graham Dumpleton
H, I think I know why. It is very interesting that no one has noticed or commented on this behaviour before, although I also suspect I know why. In mod_wsgi at the C code level, a new thread state object is created for each request, with it being destroyed at the end of the request. The thre

[modwsgi] Re: threading.local

2008-10-03 Thread Graham Dumpleton
One possibility is that although you think you are using daemon mode, you aren't, and that Apache compiled with worker MPM. This can occur if you don't have WSGIProcessGroup directive set properly to refer to daemon process group setup using WSGIDaemonProcess. Post the mod_wsgi bits of the Apache

[modwsgi] Re: threading.local

2008-10-03 Thread William Dode
> I'll look if i can reproduce this with the code of _threading_local With _threading_local it works (python implementation) import _threading_local class MyLoc(_threading_local.local): [Fri Oct 03 11:47:08 2008] [error] init [Fri Oct 03 11:47:08 2008] [error] pid: 2091 id: 3067888900 id.__dict

[modwsgi] Re: threading.local

2008-10-03 Thread William Dode
Maybe more clear : #!/usr/bin/python import cgi import threading import sys import os class MyLoc(threading.local): def __init__(self): print >> sys.stderr , 'init' myloc = MyLoc() def application(environ, start_response): status = '200 OK' myloc.i = 0 print >> sys.stde

[modwsgi] Re: threading.local

2008-10-03 Thread Graham Dumpleton
2008/10/3 William Dode <[EMAIL PROTECTED]>: > > On 02-10-2008, Graham Dumpleton wrote: >> >> 2008/10/3 William Dode <[EMAIL PROTECTED]>: >>> >>> Hi, >>> >>> In daemon mode, with threads=1 : >>> >>> def application(environ, start_response): >>> >>>status = '200 OK' >>>output = "con= %s" % c

[modwsgi] Re: threading.local

2008-10-03 Thread William Dode
On 02-10-2008, Graham Dumpleton wrote: > > 2008/10/3 William Dode <[EMAIL PROTECTED]>: >> >> Hi, >> >> In daemon mode, with threads=1 : >> >> def application(environ, start_response): >> >>status = '200 OK' >>output = "con= %s" % cgi.escape(repr(pool.connection())) >>loc = threading.lo