Subject: bug#32329: closed (Re: bug#32329: call-with-input-file and call-with-output-file should use textual ports)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 02 Aug 2018 14:47:03 +0000

Your bug report

#32329: call-with-input-file and call-with-output-file should use textual ports

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
32329: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=32329
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#32329: call-with-input-file and call-with-output-file should use textual ports
From: Mark H Weaver <[email-masked]>
To: Göran Weinholt <[email-masked]>
Cc: [email-masked]
Date: Thu, 02 Aug 2018 10:44:58 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Göran,

Göran Weinholt <[email-masked]> 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

Subject: call-with-input-file and call-with-output-file should use textual ports
From: Göran Weinholt <[email-masked]>
To: [email-masked]
Date: Tue, 31 Jul 2018 09:14:12 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello schemers,

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.

-- 
Göran Weinholt
Debian developer
73 de SA6CJK