From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id AFF301F4B4 for ; Wed, 13 Jan 2021 15:19:39 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 896BD120AF6; Thu, 14 Jan 2021 00:18:49 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 84532120AE3 for ; Thu, 14 Jan 2021 00:18:47 +0900 (JST) Received: by filterdrecv-p3iad2-577c7fd65d-fxqdn with SMTP id filterdrecv-p3iad2-577c7fd65d-fxqdn-16-5FFF0F84-31 2021-01-13 15:19:32.511296984 +0000 UTC m=+73261.150027528 Received: from herokuapp.com (unknown) by ismtpd0033p1mdw1.sendgrid.net (SG) with ESMTP id u14RUfF7RSC8JylHxAtteA for ; Wed, 13 Jan 2021 15:19:32.415 +0000 (UTC) Date: Wed, 13 Jan 2021 15:19:32 +0000 (UTC) From: nobu@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 77965 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17517 X-Redmine-Issue-Author: znz X-Redmine-Sender: nobu X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?q8Dly+pU2+3ektTtZVXgZtbJPXwqo7p86jCsvYTW4BxGO7aEiDI2E4lFD2L0H=2F?= =?us-ascii?Q?TrHpugwIC2Wi4hTLkiZiBR7WfvpYOuTafn0FMUC?= =?us-ascii?Q?vUGxQMVT+kZkNHAOPRMKR43Mvz7nagEwjg9FhtX?= =?us-ascii?Q?=2F4UmL7BRJIADbsYyIlISrbipjdPEFnGqoYGdYge?= =?us-ascii?Q?g3hW689ac+0k7cZk+49PJ0rfTqFqINBbjkhAuYk?= =?us-ascii?Q?nsd+MLOb6dJceJtJQ=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 102062 Subject: [ruby-core:102062] [Ruby master Bug#17517] File.expand_path returns us-ascii when both arguments are ascii compat X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #17517 has been updated by nobu (Nobuyoshi Nakada). https://github.com/ruby/ruby/pull/4061 ---------------------------------------- Bug #17517: File.expand_path returns us-ascii when both arguments are ascii compat https://bugs.ruby-lang.org/issues/17517#change-89923 * Author: znz (Kazuhiro NISHIYAMA) * Status: Open * Priority: Normal * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- Is this intentional? ```ruby p __dir__.encoding #=> # p 'hoge'.encoding #=> # p File.expand_path('hoge', __dir__).encoding #=> # ``` ``` % docker run -it --rm ghcr.io/ruby/all-ruby env ALL_RUBY_SINCE=ruby-1.9 ./all-ruby -e 'p File.expand_path("hoge".encode("utf-8"), "/".encode("utf-8")).encoding' ruby-1.9.0-0 -e:1:in `encode': transcoding not supported (from ASCII-8BIT to UTF-8) (ArgumentError) from -e:1:in `
' exit 1 ruby-1.9.0-1 # ruby-1.9.0-2 # ... ruby-1.9.1-p129 # ruby-1.9.1-p243 # ... ruby-1.9.2-preview1 # ruby-1.9.2-preview3 # ... ruby-3.0.0 # ``` -- https://bugs.ruby-lang.org/