From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 08B0819803F8 for ; Fri, 14 Aug 2015 20:36:47 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 6E349B5D86D for ; Fri, 14 Aug 2015 21:11:49 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 0804C97A826 for ; Fri, 14 Aug 2015 21:11:52 +0900 (JST) X-Virus-Scanned: amavisd-new at nagaokaut.ac.jp Authentication-Results: funfun.nagaokaut.ac.jp (amavisd-new); dkim=fail (1024-bit key) reason="fail (message has been altered)" header.d=sendgrid.me Received: from funfun.nagaokaut.ac.jp ([127.0.0.1]) by funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GCkGU4erZXCu for ; Fri, 14 Aug 2015 21:11:51 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 993A097A836 for ; Fri, 14 Aug 2015 21:11:51 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 061E295241E for ; Fri, 14 Aug 2015 21:11:47 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 0C83512040E; Fri, 14 Aug 2015 21:11:47 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o10.shared.sendgrid.net (o10.shared.sendgrid.net [173.193.132.135]) by neon.ruby-lang.org (Postfix) with ESMTPS id DD2E112003B for ; Fri, 14 Aug 2015 21:11:43 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=rtkWovwWcwAtNvVRyqdSacWM4+E=; b=tick1VXdt6owguaS4+ US2n7Qh/sDGKgpz9jjp2L2x0xv4PCx+G08S4yKOox/LzhB65rycRJA7PBNZ8RRre kipk8F3BxzZJ/d5KU5/DAmDL4FTyufAgMC0mzPuolai0adnarS/aoeqJ6Ut/BVf1 NqbtFeFaGCPmU1GtQ9vegvgCQ= Received: by filter0473p1mdw1.sendgrid.net with SMTP id filter0473p1mdw1.19182.55CDDAFA28 2015-08-14 12:11:38.832638452 +0000 UTC Received: from herokuapp.com (ec2-54-145-140-76.compute-1.amazonaws.com [54.145.140.76]) by ismtpd0001p1iad1.sendgrid.net (SG) with ESMTP id x8eNe9n1QvGqeqrYJJbkXQ for ; Fri, 14 Aug 2015 12:11:38 +0000 (UTC) Date: Fri, 14 Aug 2015 12:11:38 +0000 From: mbrunat@volny.cz To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Redmine-MailingListIntegration-Message-Ids: 44991 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11445 X-Redmine-Issue-Author: michal.brunat X-Redmine-Sender: michal.brunat 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: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS7acRJsrGMrNhtGS+YgUvihe4rpPi1cU12lf4 DfE8WDUEipxq4QLiDZjWEAzWC4jv6dGsilp8xfT1Ayn0Ax+EuWlLGem1K1cn9/2Z8jo1zsZWrtkutb FhkuWwX1R7vv78XBTuH0U2dZAM3cHSz9oOMx X-ML-Name: ruby-core X-Mail-Count: 70389 Subject: [ruby-core:70389] [Ruby trunk - Bug #11445] [Open] Ruby 1.9.3 - StringIO clone method creates new instance but somehow connected with the original instance 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: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11445 has been reported by Michal Brun=C3=A1t. ---------------------------------------- Bug #11445: Ruby 1.9.3 - StringIO clone method creates new instance but som= ehow connected with the original instance https://bugs.ruby-lang.org/issues/11445 * Author: Michal Brun=C3=A1t * Status: Open * Priority: Normal * Assignee:=20 * ruby -v: ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux] * Backport: 1.9.3: UNKNOWN ---------------------------------------- In Ruby 1.9.3 cloned StringIO instance has influence on close state of orig= inal instance: require 'stringio' sio1 =3D StringIO.new( 'abc' ) sio2 =3D sio1.clone sio2.read sio1.pos # =3D> 3, expected 0 sio2.close sio1.closed? # =3D> true, expected false If File is used instead of StringIO, close state is not shared between inst= ances (position is). This behaviour has changed in Ruby 2.0.0 (cloned StringIO instance does not= close original instance). It matters what definition for IO clone is, whether to share attributes (e.= g. pos) and/or state (closed?) but the later is acting differently in 1.9.3= for StringIO and File. --=20 https://bugs.ruby-lang.org/