Re: Guile 2.2 bindings: error when printing message object.

Sergey Poznyakoff <[email protected]>
Newsgroups gmane.comp.gnu.mailutils.bugs
Organization GNU.org.ua
Message-ID <[email protected]>
Hi Ricardo,

> I'm the author of GNU Guile Debbugs, a Guile interface to the SOAP
> service of the Debbugs bug tracker.

I'm pleased to meet you.

> I'm trying to use the Guile
> bindings of Mailutils to simplify the task of dealing with emails from
> Debbugs (e.g. to parse multipart messages or to decode Quoted Printable
> strings).

It's a very interesting and promising usage.

> scheme@(guile-user)> (call-with-input-file "bug_32514_message_8.mbox"
> mu-message-from-port)
> $1 = #<message "[email protected]" "Fri Aug 24 06:39" ERROR: In procedure write:
> Wrong type (expecting exact integer): #<closed: file 14ef0e0>

It appears that the port opened by call-with-input-file got closed prior
to being used by mu-message-from-port. That function protects its argument
port by being collected by gc, but that doesn't help when the port is
closed explicitly after calling the function. I will fix it. In the
meantime, please use this workaround:

  (call-with-input-file "bug_32514_message_8.mbox"
    (lambda (port)
      (mu-message-from-port (duplicate-port port "r"))))

Regards,
Sergey
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.