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-ASN: AS4713 221.184.0.0/13 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 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 8C2BA1F462 for ; Fri, 24 May 2019 12:10:29 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 26981120AD9; Fri, 24 May 2019 21:10:22 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 05B1D120AFB for ; Fri, 24 May 2019 21:10:19 +0900 (JST) Received: by filter0145p3las1.sendgrid.net with SMTP id filter0145p3las1-24412-5CE7DF2B-26 2019-05-24 12:10:19.666940164 +0000 UTC m=+67468.129539577 Received: from herokuapp.com (unknown [35.175.245.114]) by ismtpd0001p1iad1.sendgrid.net (SG) with ESMTP id L-sdOOGfTym-cQTCNoX10w for ; Fri, 24 May 2019 12:10:19.601 +0000 (UTC) Date: Fri, 24 May 2019 12:10:19 +0000 (UTC) From: nobu@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 68306 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15873 X-Redmine-Issue-Author: AlexGascon 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+3ektTtZVXgZtbJPXwqo7p86jCsvYTW4BziO5VrOiP1jaExDuJQpZ?= =?us-ascii?Q?PPzQ+ycOemdfinSUvxoouhHwuOUaREWBm5PWwsJ?= =?us-ascii?Q?4wnj9c=2FW=2F9KFSRVl51VpdGfTSpa64=2FsdZkqM+oq?= =?us-ascii?Q?1+S7ktO9mwntmtsCQt0UdEYubNkDZbuzBughbPL?= =?us-ascii?Q?BZk3zopfEa2vhEXnXNhKn0TeQqWtKh7sn2Q=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 92822 Subject: [ruby-core:92822] [Ruby trunk Bug#15873] FrozenError when using OpenURI.open 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 #15873 has been updated by nobu (Nobuyoshi Nakada). Does it occur even if the body is `"Random information".dup`? ---------------------------------------- Bug #15873: FrozenError when using OpenURI.open https://bugs.ruby-lang.org/issues/15873#change-78194 * Author: AlexGascon (Alex Gascon) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux] * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- I just updated from Ruby 2.5.1 to 2.6.3 and I encountered a strange problem on a part that was working fine previously. It's on a Rails application, and on one of the tests I'm stubbing (using [webmock](https://github.com/bblimke/webmock)) an HTTP request that we perform to an external URL. However, when trying to access the information by using OpenURI I get a `FrozenError`. The following block represents a minimal reproducible example of the problem that I'm experiencing ``` ruby stub_request(:get, "https://files.lol/certificate_doc.pdf").to_return(status: 200, body: "Random information", headers: {}) file_content = open("https://files.lol/certificate_doc.pdf") FrozenError: can't modify frozen String from /home/alex/.rbenv/versions/2.6.3/lib/ruby/2.6.0/open-uri.rb:357:in `clear' ``` -- https://bugs.ruby-lang.org/