[f2py] Cannot unmarshal code objects in restricted execution mode

John Sutterfield <jsutterfield484-/[email protected]> Wed, 24 Nov 2010 11:12:35 -0800 (PST)
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
Good day,
I have a fair amount of fortran code that handles array data and i need to re use this code to avoid a total re-write. I am encountering the following error  below when trying to execute and use the .pyd modle in python. "cannot unmarshal code objects in restricted execution mode". Here is the fortran subroutine:
 
C FILE: ARRAY.F
      SUBROUTINE FOO(A,N)
C
C     add 2 to each element
C
      INTEGER N,J
      REAL*8 A(N)
      DO J=1,N
         A(J) = A(J) + 2
      ENDDO
      END
C END OF FILE ARRAY.F
 
Here is the signature file:
 
!    -*- f90 -*-
! Note: the context of this file is case sensitive.
python module arraycens2 ! in 
    interface  ! in :arraycens2
        subroutine foo(a,n) ! in :arraycens2:arraycens2.f90
            real*8 dimension(n) , intent(in,out,copy) :: a
            integer optional,check(len(a)>=n),depend(a) , intent(in) :: n=len(a)
        end subroutine foo
    end interface 
end python module arraycens2
! This file was auto-generated with f2py (version:2).
! See http://cens.ioc.ee/projects/f2py2e/
 
and here is the python code:
 
import arraycens2
print arraycens2.foo.__doc__
x = [2,3,4]
a = arraycens2.foo(x)
print a
 
I am on a Vista32 machine running python 2.6.5, r265:79096. Your help would be greatly appreciated. Thank you.
 
-- John

_______________________________________________
f2py-users mailing list
f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]
http://cens.ioc.ee/mailman/listinfo/f2py-users