Hi Dane,
I know little about Python nor Dango. My first suspicion would be that
it is thread-related. Does Django use threads? I'm also not sure about
`prolog=Prolog()`. I don't know how that matches to SWI-Prolog's C API.
The way it works though is that a process can only create one Prolog
system using PL_initialise(), which typically stays there the remainder
of the life of the process. Cleanup (PL_cleanup() is at best incomplete.
After initializing it, it may be used in the thread that initialized it.
You must make sure this thread never dies (i.e., you typically use the
process main thread). If you want to use it from a different thread you
need to attach a new Prolog engine to the thread.
I fear this isn't really an answer. It may help you and/or the developer
of the pyswi interface to sort out what happens.
Cheers --- Jan
> returnHttpResponse(X)
>
> |
>
> the code of 'test.prolog' :
> |
> father(michael,john).
> father(michael,gina).
> |
>
> error in the browser :
> |
>
>
> WindowsErrorat /planning/onTest/
>
> exception:access violation reading 0x00000020
>
> RequestMethod: GET
> RequestURL:
http://localhost:8000/planning/onTest/
> Django Version: 1.7.3
> Exception Type: WindowsError
> Exception Value:
>
> exception: access violation reading 0x00000020
>
> Exception Location: C:\Python27\lib\site-packages\pyswip\prolog.py
> in __call__, line 94
> Python Executable: C:\Python27\python.exe
> Python Version: 2.7.8
>
>
> |
> and the message in the console :
> |
> ExceptionAttributeError:'swipl_qid'in<bound method
> _QueryWrapper.__del__ of <pyswip.prolog._QueryWrapper objectat
> 0x037AB7D8>>ignored
> |
>
> I've tried to debug and I've found that the code never execute the
> line :
> |
> self.swipl_fid =PL_open_foreign_frame()
>
> |
> I've tried to read the docs about
> |
> |PL_open_foreign_frame()
> |
> |
> but I don't really understand what the problem may be.
> Anyone can help me to understand and ... solve my problem
> Thanks
> Fred
>
> --
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
swi-prolog+...@googlegroups.com
> <mailto:
swi-prolog+...@googlegroups.com>.
> Visit this group at
https://groups.google.com/group/swi-prolog.
> For more options, visit
https://groups.google.com/d/optout.