R: [mod_python] problem with file download in mod-python 3.0.1

Manera, Villiam vmanera at manord.com
Fri Dec 13 08:58:14 EST 2002


Ok, but on  Fri, 7 Jun 2002 Grisha wrote to me about this problem:

Yes, whatever free time I have I try to spend on the 3.0 version that will
run on Apache 2.0. Probably the simplest way to tackle this one is for
someone to add the publisher patch to the FAQ, at least for the time
being.

Grisha

So I hope that in mod-python 3.0.2 a patch for this problem will be added

Villiam Manera
-----Messaggio originale-----
Da: Brian Hawthorne [mailto:brianh at exelixis.com]
Inviato: giovedì 12 dicembre 2002 20.27
A: Manera, Villiam
Cc: Mod_python at modpython.org
Oggetto: Re: [mod_python] problem with file download in mod-python 3.0.1


i'm not sure what the point is of wrapping the field object like this.
why not just use the field object itself as the value for the file upload
arg?  i cut this part out of my publisher because it seemed unnecessary.

brian hawthorne


On Thu, 12 Dec 2002, Manera, Villiam wrote:

> I'm testing mod-python 3.0.1 with apache 2.0.43 and python 2.2.2
> 
> I've founded a older problem in file download (from python 2.1 to 2.2)
> 
> the workaround is still the same:
> 
> in publisher.py:
> 
>  class File:
>      """ Like a file, but also has headers and filename
>      """
>      def __init__(self, field):
>          # steal all the file-like methods
>          for m in dir(field.file):            
> 		 self.__dict__[m] = getattr(field.file, m)
>  
>          self.headers = field.headers
>          self.filename = field.filename
> ======================workaround
> ==============================================
>  class File:
>      """ Like a file, but also has headers and filename
>      """
>      def __init__(self, field):
>          # steal all the file-like methods
>          #for m in dir(field.file):    #dont' work
>          for m in self.sim_methods(field.file):
>              self.__dict__[m] = getattr(field.file, m)
>  
>          self.headers = field.headers
>          self.filename = field.filename
>     
> 	#new--------	
>      def sim_methods(self,obj):
>          from types import BuiltinMethodType   
>          return filter(lambda s, t=obj:
>             type(getattr(t, s)) == BuiltinMethodType, dir(obj))
>  
>  
> I hope it will be put in place
> 
> regards
> 
> Villiam Manera
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://www.modpython.org/mailman/listinfo/mod_python
> 




More information about the Mod_python mailing list