axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] Axiom crashing in Zope-Plone


From: Hans Peter Wuermli
Subject: [Axiom-developer] Axiom crashing in Zope-Plone
Date: Sat, 25 Sep 2004 17:08:12 +0200
User-agent: KMail/1.6.2

Hi

I wonder if someone with the new Zope-Plone-LatexWiki experience can help me. 

Having been enthusiastic about MathAction I tried to set it up locally on my 
local computer, too, using the ZWiki and LatexWiki files on 
http://page.axiom-developer.org/repository. Strangely enough Axiom is not 
rendered, as the method runCommand() in axiomWrapper.py fails when run from 
inside Zope. Testing the method externally either within a zope.app() or as a 
standalone method, does not produce errors and works as expected. 

I checked with a lot of analoguous situations, first suspecting missing access 
rights, but "wrapping", for example, an executable, a segfaulting executable 
or a psql script run fine, standalone or within zope as external methods.

I can boil down the error to the external method "demo.py" at the end of the 
mail, which is similar to the runCommand() in axiomWrapper.py. 

Zope is version 2.6.4; python used is version 2.2 and it all runs on a Debian 
sarge system.

The exit codes for Popen3 when run from Zope are:

WEXITSTATUS:139 
WIFEXITED: 1

Thank you for any help.

Cheers, H.P.


demo.py:

import os
from popen2 import Popen3


axiomTemplate = r""")set output algebra off
)set output tex on
)set message autoload off
)set quit unprotected
integrate(x**2,x)
)quit
"""

LatexWikiHome = '/usr/lib/zope/lib/python\
/Products/LatexWiki/Extensions/'

axTinput = open ( LatexWikiHome + 'axT.input', 'w' )
axTinput.write(axiomTemplate)
axTinput.close()

cmdLine = r'export AXIOM=/usr/lib/axiom-0.20040831;\
export PATH=$AXIOM/bin:$PATH;\
AXIOMsys < %s ' %(LatexWikiHome + 'axT.input')

def echoWorld():
    """ external method calling Popen3 """
    p = Popen3 (cmdLine, 1, 4096)
    status = p.wait()
    p.tochild.close()
    out = p.fromchild.read()
    p.fromchild.close()
    err = ''
    if p.childerr: err = p.childerr.read(); p.childerr.close()
    error = os.WEXITSTATUS(status) or \
            not os.WIFEXITED(status)
    if not error: return\
           'Output: ' + out +\
           '\nWEXITSTATUS: ' + str(os.WEXITSTATUS(status)) +\
           '\nWIFEXITED:   ' + str(os.WIFEXITED(status))
    else:  return\
           'Error: ' + err +\
           '\nOut: ' + out +\
           '\nWEXITSTATUS:' + str(os.WEXITSTATUS(status)) +\
           '\nWIFEXITED:   ' + str(os.WIFEXITED(status))

# For Zope external testing
print echoWorld()




reply via email to

[Prev in Thread] Current Thread [Next in Thread]