Getting error while running scheme functions through the Python library

35 views
Skip to first unread message

Xabush Semrie

unread,
Jun 18, 2019, 9:52:44 AM6/18/19
to opencog
Hi,

When run a scheme function through the guile shell it runs perfectly fine and I get the expected result. However, running the same function through scheme-eval Python function, I get the following error:

Failed to execute '(parse (append (list (gene-info (mapSymbol (list "MAP2K4" )))) (list ( gene-go-annotation (list "MAP2K4" ) "biological_process cellular_component molecular_function" 1))))' Backtrace: 14 (apply-smob/1 #<catch-closure 7f499ee92700>) 13 (apply-smob/1 #<catch-closure 7f499ee92600>) In ice-9/boot-9.scm: 2312:4 12 (save-module-excursion _) In ice-9/eval-string.scm: 38:6 11 (read-and-eval #<input: string 7f497b0995b0> #:lang_ ) In ice-9/eval.scm: 619:8 10 ( _#(#(#(#(#(#(#(#(#(#(#(#) …) …) …) …) …) …) …) …) …) …)) 626:19 9 (_ #(#(#(#(#(#(#(#(#(#(#(#) …) …) …) …) …) …) …) …) …) …)) 619:8 8 ( _#(#(#(#(#(#(#(#<directory (guile-…>) …) …) …) …) …) …)) In srfi/srfi-1.scm: 640:9 7 (for-each #<procedure 7f499ee92b00 at ice-9/eval.scm:3…> …) 640:9 6 (for-each #<procedure 7f499ee928c0 at ice-9/eval.scm:3…> …) In ice-9/eval.scm: 259:9 5 (_ #(#(#<directory (guile-user) 7f498001a140> #<v…> …) …)) 298:42 4 ( _#(#(#<directory (guile-user) 7f498001a140>) "MAP2…" …)) 155:9 3 (_ #(#(#<directory (guile-user) 7f498001a140>) "MAP2…" …)) In rnrs/records/procedural.scm: 218:2 2 (_ "MAP2K4") In ice-9/boot-9.scm: 751:25 1 (dispatch-exception 0 r6rs:exception (#<r6rs:record:&r…>)) In unknown file: 0 (apply-smob/1 #<catch-closure 7f499ee925c0> # #<r6rs:re…>) ERROR: In procedure apply-smob/1: In procedure #<r6rs:record:&raise-object-wrapper>: Error while printing exception. ABORT: r6rs:exception (/root/atomspace/opencog/cython/opencog/PyScheme.cc:63)

Has anyone had similar issue? The code for the scheme function can be found here.

Joel Pitt

unread,
Jun 18, 2019, 4:40:43 PM6/18/19
to opencog
Hi Xabush,

It'd probably be best to report this error via github, and, if possible ... try to create a minimal example that exhibits the same error.

--
You received this message because you are subscribed to the Google Groups "opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opencog+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at https://groups.google.com/group/opencog.
To view this discussion on the web visit https://groups.google.com/d/msgid/opencog/b7b5b656-3f86-4296-8d12-b9373b02dfcf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Linas Vepstas

unread,
Jun 19, 2019, 12:36:46 AM6/19/19
to opencog
What Joel says.

Are you using rnrs on purpose, or did that just somehow sneak into the code?

--linas

--
You received this message because you are subscribed to the Google Groups "opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opencog+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at https://groups.google.com/group/opencog.
To view this discussion on the web visit https://groups.google.com/d/msgid/opencog/b7b5b656-3f86-4296-8d12-b9373b02dfcf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
cassette tapes - analog TV - film cameras - you

Xabush Semrie

unread,
Jun 20, 2019, 10:35:45 AM6/20/19
to opencog

Are you using rnrs on purpose,

 Yes. I am using (rnrs records) module. I will come up with a minimal reproducible example but I wanted to understand the scheme error message because it looks cryptic to me.

Linas Vepstas

unread,
Jun 20, 2019, 11:42:02 AM6/20/19
to opencog
On Thu, Jun 20, 2019 at 9:35 AM Xabush Semrie <hsam...@gmail.com> wrote:

Are you using rnrs on purpose,

 Yes. I am using (rnrs records) module. I will come up with a minimal reproducible example but I wanted to understand the scheme error message because it looks cryptic to me.

Well, given that the code normally works, my best guess is that the python wrapper accidentally dropped a single-quote, a double-quote, truncated the string in some way, or maybe corrupted a UTF-8 character.

There are some very rare and hard-to-debug cases involving cut-n-paste from a web browser.  Some web browsers sometimes insert .. weird whitespace UTF-8 characters, that (a) are invisible -- they're whitespace, and (b) cause scheme/python/c++/word-processor to mis-behave and act badly.  Its very hard to debug .. because .. its whitespace.  You can find them with tools like hexdump, and search for any non-ascii characters.

Now, guile/python/c++/etc are "100%" UTF-8 safe, and work fine.  But the weird whites-ace means that variable-names or other code might not be what you think it is...

--linas
Reply all
Reply to author
Forward
0 new messages