[Zope] Debugger question and writing on filesystem (QUEST)

Oscar Picasso picasso@videotron.ca
Thu, 23 Mar 2000 11:56:25 -0500


Hi, 

I have a product:

$myzopedir
  Products
    EProduct
      __init__ # empty
      EProduct.py
        class EProduct:
           def writeData(self):
              f = open('/home/oscar/data/test_out.jpg', 'wb')
              f.write(self.data)
              f.close()
              return 'Export succeed'

On Zope, I created a new ZClass, EBook which is Subclassing, CatalogAware,
Image and EProduct, in that order.
I created an instance of EBook which id is 'aid' in a Folder called 'new_test'.
It works fine in Zope except I cannot use my writeData method of my EBook
class because of the following error: 

Error Type: IOError
Error Value: [Errno 13] Permission denied: '/home/oscar/data/test_out.jpg'

I work with Linux and all users have the right to write in /home/oscar/data'.
I even tried to run the method from the interpreter, just changin
f.write(self.data) to f.write('arbitrary string') and it works fine.

**Can you tell me where am I wrong?**

I also tried to use the debugger to understand where I am wrong.
>>>import Zope, ZPublisher
>>>ZPublisher.Zope('/new_test/aid')
***lot of stuff = data of aid***
but :
>>>ZPublisher.Zope('/new_test/aid/writeData')