That's because stf.rpartition was added in Python 2.5.  It's not available 
yet in Jython.  STAX uses Jython 2.1, not Python to run Python code in a 
STAX script.  The Jython developers are currently working on beta releases 
for Jython 2.5.  Sometime after Jython 2.5 GAs, we plan to update STAX to 
include Jython 2.5, not Jython 2.1.

 See "Appendix F: Jython and CPython Differences" in the STAX User's Guide 
for more information.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




Stephan Lips <stephan.l...@gmail.com> 
03/11/2009 03:23 PM

To
staf-users@lists.sourceforge.net
cc

Subject
[staf-users] python built-in method not recognized?






Hi there,

the following little test of python's built-in str.rpartition appears to 
not be recognized when running this through a STAX script, as the below 
error suggests.  Any idea what I'm missing to get this to execute as 
expected?

Thanks,

- Stephan



    <function name="rpartition">
        <sequence>
            <script>
                str = 'c:/foo/bar/hi.tere'
                segments = str.rpartition('/')
            </script>
            <message>segments[0]</message>
            <message>segments[2]</message>
        </sequence>


20090311-15:20:52    STAXPythonEvaluationError signal raised. Terminating 
job. 

===== Element Information =====

<script>str = 'c:/foo/bar/hi.tere'
segments = str.rpartition('/')
</script>

===== Python Error Information =====

com.ibm.staf.service.stax.STAXPythonEvaluationException: Traceback 
(innermost last):
  File "<pyExec string>", line 2, in ?
AttributeError: 'string' object has no attribute 'rpartition'

===== Call Stack for STAX Thread 1 =====

[
  Block: main
  Sequence: 18/18
  Function: rpartition
  Sequence: 1/3
]

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to