[Medusa-dev] status_handler + auth_handler combination problem

Sergio Fernandez sfmunoz@teleline.es
Fri Nov 22 18:53:47 2002


When I applied patch I sent in message with Subject:

	"auth_handler.py (auth_handler.handle_request) bug"

I found another problem I couldn't fix. This problem exists in 0.5.2, 0.5.3
and CVS (Nov 22, 2002) versions.

I'm using SuSE 8.0, Python 2.2.

Simple Medusa startup script where you can see the problem could be:

	#!/usr/bin/env python

	import os
	import sys
	import asyncore

	from medusa import http_server
	from medusa import filesys
	from medusa import default_handler
	from medusa import auth_handler
	from medusa import status_handler
	from medusa import logger

	lg = logger.file_logger(sys.stdout)
	hs = http_server.http_server ('',8080,None,lg)

	fs = filesys.os_filesystem('/var/www')
	dh = default_handler.default_handler(fs)

	audh = auth_handler.auth_handler({ 'user':'pass'},dh)
	hs.install_handler (audh)

	sh = status_handler.status_extension([hs])
	aush = auth_handler.auth_handler({'status':'status'},sh)


If you access medusa_host:8080/, you can see it asks you for user/password.
It you applied patch I sent in last e-mail, you can write 'user' as user
and 'pass' as password and get into your pages.

The problem comes when you access http://medusa_host:8080/status (in order
to see your server status).

As you can see in medusa startup script I've sent, user/password is
diferent. In this case user is 'status' and password is 'status'.

If you write when your browser asks, you get the following message:

	The document contained no data.
	Try again later, or contact the server's administrator.

In medusa log you can see:

	error: Server Error: exceptions.AttributeError, fifo instance has no attribute '__getitem__': file: /usr/lib/python2.2/site-packages/medusa/producers.py line: 155
	error: uncaptured python exception, closing channel
	<medusa.http_server.http_channel connected at 0x82558a4 channel#: 1 requests:1> (exceptions.AttributeError:fifo instance has no attribute '__getitem__' [/usr/lib/python2.2/asyncore.py|poll|107] [/usr/lib/python2.2/asyncore.py|handle_write_event|398] [/usr/lib/python2.2/asynchat.py|handle_write|146] [/usr/lib/python2.2/asynchat.py|initiate_send|208] [/usr/lib/python2.2/asynchat.py|refill_buffer|195] [/usr/lib/python2.2/site-packages/medusa/producers.py|more|179] [/usr/lib/python2.2/site-packages/medusa/producers.py|more|203] [/usr/lib/python2.2/site-packages/medusa/producers.py|more|156] [/usr/lib/python2.2/site-packages/medusa/producers.py|more|156] [/usr/lib/python2.2/site-packages/medusa/producers.py|more|155])

Do you have any idea about where the problem comes from? Any hints?


More information about the Medusa-dev mailing list