R: R: [mod_python] problem in file download

Christopher Sean Hilton chris at vindaloo.com
Thu Jun 6 17:54:26 EST 2002


On Thu, Jun 06, 2002 at 12:01:27PM +0200, Johnny Morano wrote:
> On Thursday 06 June 2002 11:45, you wrote:
> >
> > so I thonk is a bug of mod-python on windows?
> >
> > I currently use mod python 2.7.6 for python 2.2 and apache 1.3
> 
> well, i use mod_python 2.7.8 compiled for python 2.1 and apache 1.3.24
> maybe that is the problem
> 

His problem is that python 2.2 does not include the __methods__ attribute 
for classes but the publisher.py code which actually handles the file inload 
depends on it. If he downgrades from python 2.2 to python 2.1 he'll have the 
__methods__ attribute of the file class. Someone needs to address this in 
the mod_python code however:

        for m in field.file.__methods__:
            self.__dict__[m] = getattr(field.file, m)

        self.headers = field.headers
        self.filename = field.filename

doesn't work in python 2.2 because __methods__ doesn't exist. The code 
appears to be trying to make local copies of all of the methods in the 
object that gets passed to the user. I had this problem in Unix (FreeBSD) 
two weeks ago and downgrading my python from 2.2 to 2.1 solved it. A google 
search on python, __methods__, 2.1 and 2.2 will yield more information.

Chris

-- 
Chris Hilton                                 chilton-at-vindaloo-dot-com
------------------------------------------------------------------------
                "All I was doing was trying to get home from work!"
                                                 -- Rosa Parks



More information about the Mod_python mailing list