GNU bug report logs - #32329
call-with-input-file and call-with-output-file should use textual ports

Previous Next

Package: guile;

Reported by: Göran Weinholt <goran <at> weinholt.se>

Date: Tue, 31 Jul 2018 07:45:01 UTC

Severity: normal

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 32329-done <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: Göran Weinholt <goran <at> weinholt.se>
Cc: 32329-done <at> debbugs.gnu.org
Subject: Re: bug#32329: call-with-input-file and call-with-output-file should
 use textual ports
Date: Thu, 02 Aug 2018 10:44:58 -0400
Hi Göran,

Göran Weinholt <goran <at> weinholt.se> writes:

> the call-with-input-file and call-with-output-file procedures in (rnrs
> io simple) should open textual ports. In Guile 2.2.4, they open binary
> ports:
>
>   (define (call-with-input-file filename proc)
>     (call-with-port (open-file-input-port filename) proc))
>
>   (define (call-with-output-file filename proc)
>     (call-with-port (open-file-output-port filename) proc))
>
> Changing the inner calls to open-input-file and open-output-file is
> sufficient to fix this bug.
>
> A consequence of using binary ports here is that the I/O is not
> transcoded, so UTF-8 data is corrupted.

Fixed in commit 4c91de3e45e7c98d5b7c484509fe5c59bd70f9fd on the
'stable-2.2' branch.  Thanks!

       Mark




This bug report was last modified 6 years and 299 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.