[Zope] Zope lockups using an External Method

Dieter Maurer dieter@handshake.de
Sun, 9 Sep 2001 19:48:56 +0200 (CEST)


Adam Warner writes:
 > .... Zopes locks in External Method ....
 > I execute this DTML Document:
 > 
 > <dtml-var "Doc2PDF(Karl_Le_Quesne)">
 > 
 > (Karl_Le_Quesne is the id of the Word Document in the Zope Database. For
 > some reason I need to remove the .doc extension. It seems that objects
 > can't have a full stop in them?)
Object ids can have '.' in them. However, you cannot directly use such
ids as names in Python expressions, you need to use
"_.getitem('name.with.dot')".

 > ....
 > 	thefile=open('aaa123','w')
 > 	thefile.write(inputdoc.data)
 > 	thefile.close
This is a bit dangerous, although probably not your problem...

   "OFS.Image.File.data" is a string, as long has the file
   is sufficiently small. It becomes an object for larger files.
   Use "str(inputdoc.data)" instead.

 > 	# Run wvPDF on the document
 > 	os.system('wvPDF aaa123 aaa123.pdf')
 > 
 > 	return
If you call the external method directly (from the Web)
and you do not return a value, some browsers do not
recognize the end of the request.
Return, e.g. "Done".

 > aaa123 is a word document. Can anyone see what has gone wrong?
Not yet...

 > ...
 > Before the external command wvPDF is run I can confirm that the word
 > document (named aaa123) is sitting in the directory /var/tmp/xxxxxxxxx/.
 > I can manually run wvPDF as user www-data.
On the file created by the external method?

I would use "ps" to analyse what process plays havoc.
After I had identified the process, I might use
"gdb" or "strace" to find out what it does....


Dieter