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_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 6EB87209FD for ; Tue, 6 Jun 2017 22:08:14 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 00B32120719; Wed, 7 Jun 2017 07:08:11 +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 63CDF12068F for ; Wed, 7 Jun 2017 07:08:08 +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=mufEr0vK8tJDhsWdBOYoeLNzsGA=; b=o2gvNoS18h3zGyD4TK Vvt9OVr7MwBWRsxursrREalegJwcruTktKrelZ1vt0pEL8u3PXM9tAksVnmdCdYY Ci0b0QkiGqodNDQC/yRPVH6WQO+lg56TD3HF4+kexOp3NJBL+zQtYbSx1d4lRKLH sBue9kNgCUYrTUsRvQ++1BQog= Received: by filter1154p1mdw1.sendgrid.net with SMTP id filter1154p1mdw1-22379-593727C1-C 2017-06-06 22:08:01.085477844 +0000 UTC Received: from herokuapp.com (ec2-54-147-242-40.compute-1.amazonaws.com [54.147.242.40]) by ismtpd0002p1iad1.sendgrid.net (SG) with ESMTP id fsZ8wggoR925nMsMtUMIgg for ; Tue, 06 Jun 2017 22:08:01.035 +0000 (UTC) Date: Tue, 06 Jun 2017 22:08:00 +0000 From: fanantoxa@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56623 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13636 X-Redmine-Issue-Author: fanantoxa X-Redmine-Sender: fanantoxa 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS7iKXKcS8bcikehxysUqMXy1PzbAQga6wAPZ7 5wpSBb7+hoV0Dd2Qd8tfB+JJIYrUX0Ae1AIH/1wGFYtB2FcwScHKSNMzAhiI6IUnZ6Sx33goCdriTJ WWByN5NHokdjk+kWcWs4x1wuxqhC1dFaNhB+r+1GQ8tpIz3zfsoXaeOWcg== X-ML-Name: ruby-core X-Mail-Count: 81594 Subject: [ruby-core:81594] [Ruby trunk Bug#13636] 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 fanantoxa (Anton Sivakov). Expectex to get exeption for xml3 ---------------------------------------- Bug #13636: REXML::Document.parse_stream doesn't handle when closing tag not provided https://bugs.ruby-lang.org/issues/13636#change-65294 * Author: fanantoxa (Anton Sivakov) * Status: Open * Priority: Normal * Assignee: * Target version: * 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/