From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Zefram Newsgroups: gmane.lisp.guile.bugs Subject: bug#22910: read-only setlocale has side effect Date: Fri, 4 Mar 2016 16:48:59 +0000 Message-ID: <20160304164859.GE7946@fysh.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1457110391 6772 80.91.229.3 (4 Mar 2016 16:53:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Mar 2016 16:53:11 +0000 (UTC) To: 22910@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Mar 04 17:53:03 2016 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1absyM-0002GL-Tm for guile-bugs@m.gmane.org; Fri, 04 Mar 2016 17:53:03 +0100 Original-Received: from localhost ([::1]:42328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1absyM-0005Pc-Eq for guile-bugs@m.gmane.org; Fri, 04 Mar 2016 11:53:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1absvT-0000Yx-Fa for bug-guile@gnu.org; Fri, 04 Mar 2016 11:50:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1absvS-0006lF-1c for bug-guile@gnu.org; Fri, 04 Mar 2016 11:50:03 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36847) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1absvR-0006lB-VN for bug-guile@gnu.org; Fri, 04 Mar 2016 11:50:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1absvR-0003yW-Qw for bug-guile@gnu.org; Fri, 04 Mar 2016 11:50:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Zefram Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 04 Mar 2016 16:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22910 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.145711015315214 (code B ref -1); Fri, 04 Mar 2016 16:50:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Mar 2016 16:49:13 +0000 Original-Received: from localhost ([127.0.0.1]:33974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1absuf-0003xK-0b for submit@debbugs.gnu.org; Fri, 04 Mar 2016 11:49:13 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37441) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1absud-0003x9-RO for submit@debbugs.gnu.org; Fri, 04 Mar 2016 11:49:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1absuY-0006am-3t for submit@debbugs.gnu.org; Fri, 04 Mar 2016 11:49:06 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:48463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1absuY-0006af-1E for submit@debbugs.gnu.org; Fri, 04 Mar 2016 11:49:06 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1absuX-0007Dr-2U for bug-guile@gnu.org; Fri, 04 Mar 2016 11:49:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1absuW-0006aC-An for bug-guile@gnu.org; Fri, 04 Mar 2016 11:49:04 -0500 Original-Received: from river6.fysh.org ([2001:41d0:d:20da::2]:54450 helo=river.fysh.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1absuW-0006a1-51 for bug-guile@gnu.org; Fri, 04 Mar 2016 11:49:04 -0500 Original-Received: from zefram by river.fysh.org with local (Exim 4.80 #2 (Debian)) id 1absuR-0004eV-CA; Fri, 04 Mar 2016 16:48:59 +0000 Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7978 Archived-At: A call to setlocale with no second argument is documented to be a read-only operation, querying the current locale configuration. In fact it has a side effect of setting the encoding on primordial ports: $ guile-2.0 -c '(write (port-encoding (current-input-port))) (newline) (setlocale LC_TIME) (write (port-encoding (current-input-port))) (newline)' #f "ANSI_X3.4-1968" Observe that this occurs even if the locale reading operation is for a category unrelated to character encoding. The actual decoding behaviour of read-char is altered in accordance with the reported encoding. Non-primordial ports opened before or after the setlocale call are not affected. -zefram