[mod_python] [SPAM] Is this related to not having support to upload a file??

Alberto Ruiz el_z0rr07 at yahoo.com
Tue Apr 4 00:52:19 EDT 2006


I apologyze for sending this email again, but my server is under   a DDOS attack and I'm not sure if this email went through.  If it  did can somebody please forward me or post the replies again.  I  had to subscribe again to the mailing list with a different account.     Thanks. 
  
  Like I mentioned in earlier threads, this code used to work in a Debian
  system, but now it doesn't work on FreeBSD with modpython 2.7.11.
  I'm getting the following error.
  
  Mod_python error: "PythonHandler mod_python.publisher"
  
  Traceback (most recent call last):
  
    File "/usr/local/lib/python2.4/site-packages/mod_python/apache.py",
  line 193, in Dispatch
      result = object(req)
  
    File "/usr/local/lib/python2.4/site-packages/mod_python/publisher.py",
  line 106, in handler
      val = File(field)
  
    File "/usr/local/lib/python2.4/site-packages/mod_python/publisher.py",
  line 322, in __init__
      for m in field.file.__methods__:
  
  AttributeError: 'file' object has no attribute '__methods__'
  
  
  
  It is hard to pin point the problem, since it doesn't show where in my
  code is happening. But my guess is that it is somewhere in this code
  snippet:
  
  for p in photo:
  phpath='/data/webroot/propman/propphotos/'
  F= open(phpath+str("tempprop"+id+"-"+p.name[-1:]+p.filename[-4:]),'wb')
  F.write(p.file.read())
  F.flush()
  os.system("convert "+phpath+str("tempprop"+id
  +"-"+p.name[-1:]+p.filename[-4:])+" -resize 400x300 "+phpath
  +""+str("prop"+id+"-"+p.name[-1:]+p.filename[-4:]))
  com="convert "+phpath+str("tempprop"+id
  +"-"+p.name[-1:]+p.filename[-4:])+" -resize 80x60 "+phpath
  +"thm"+str("prop"+id+"-"+p.name[-1:]+p.filename[-4:])
  R.write("\n\n"+com+"\n\n")
  os.system(com)
  if p.name[-1:]=="1":
  com="convert "+phpath+str("tempprop"+id
  +"-"+p.name[-1:]+p.filename[-4:])+" -resize 220x165\! "+phpath
  +"bthm"+str("prop"+id+"-"+p.name[-1:]+p.filename[-4:])
  R.write("\n\n"+com+"\n\n")
  os.system(com)
  
  Sorry about the indentation, it got missed up while pasting in the
  email.
  
  My guess is in 'p.file.read()
  
  How do I implemented for 2.7.11? or do I need to configure my Apache
  conf file.
  
  
			
---------------------------------
Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20060403/17f0c95e/attachment.html


More information about the Mod_python mailing list