From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,SPF_PASS,T_DKIM_INVALID,T_RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id B15D0209FD for ; Tue, 6 Jun 2017 22:36:08 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 3C8F3120719; Wed, 7 Jun 2017 07:36:06 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id A635512068F for ; Wed, 7 Jun 2017 07:36:03 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=WIwfQ1Kzx4budv66Ge6Z0FGffoE=; b=yIbKnOtFq3HeFBSZ37 ADvJlQB5dzu9ZZuDnhzRNW3hP+8EJJLn6WE6uEsKNbqVAjQMgqDiYLaSFWDkSTr7 k4qzsf38xBukWveodr2Fc7XYI3R7c2SbSg4k+ERL78NztTCWgy8HTX7Cu0me9rZJ 5uGqkBc7kYhTVufRksa23P6kc= Received: by filter0600p1mdw1.sendgrid.net with SMTP id filter0600p1mdw1-17887-59372E42-31 2017-06-06 22:35:46.504620733 +0000 UTC Received: from herokuapp.com (ec2-54-205-129-33.compute-1.amazonaws.com [54.205.129.33]) by ismtpd0004p1iad1.sendgrid.net (SG) with ESMTP id CRqKJSVKSdOvLhqLUCTXrg for ; Tue, 06 Jun 2017 22:35:46.659 +0000 (UTC) Date: Tue, 06 Jun 2017 22:35:46 +0000 From: hsbt@ruby-lang.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56624 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13636 X-Redmine-Issue-Author: fanantoxa X-Redmine-Issue-Assignee: kou X-Redmine-Sender: hsbt 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS7h35O42JD7qRwX80NXO7AIiYgwKc4Kbg2G1l B4/4PFIjRLQmoppyn9yzNPAM43GRyNNXEx5DouuYM066+qXeZxX41vn1O8r9nC/05Wrd7QR+HE0+eg YaqVFTGwShPlzufXR8G58nk8amodY7hxIEcZPunDO9d+lSwajuLlp1BWjQ== X-ML-Name: ruby-core X-Mail-Count: 81595 Subject: [ruby-core:81595] [Ruby trunk Bug#13636][Assigned] REXML::Document.parse_stream doesn't handle when closing tag not provided 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 #13636 has been updated by hsbt (Hiroshi SHIBATA). Status changed from Open to Assigned Assignee set to kou (Kouhei Sutou) Target version set to 2.5 ---------------------------------------- Bug #13636: REXML::Document.parse_stream doesn't handle when closing tag not provided https://bugs.ruby-lang.org/issues/13636#change-65295 * Author: fanantoxa (Anton Sivakov) * Status: Assigned * Priority: Normal * Assignee: kou (Kouhei Sutou) * Target version: 2.5 * ruby -v: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux] * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- I've tried to use REXML for parsing but got unexpected behavior: Here is example: ~~~ ruby require 'rexml/document' require 'rexml/streamlistener' class Handler include REXML::StreamListener end xml1 = StringIO.new("test") xml2 = StringIO.new("test") xml3 = StringIO.new("test") handler = Handler.new REXML::Document.parse_stream(xml1, handler) # => nil REXML::Document.parse_stream(xml2, handler) # => REXML::ParseException: Missing end tag for 'item' (got "body") REXML::Document.parse_stream(xml3, handler) # => nil ~~~ Actualy XML: "test" is broken so it's expected to get: ~~~ ruby REXML::ParseException.new( "Missing end tag for body") ~~~ I can't rely on REXML parse since I'm not getting exception when XML data structure not valid. -- https://bugs.ruby-lang.org/