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 6B0D819E005C for ; Fri, 18 Dec 2015 12:43:01 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 78B12B5D8BF for ; Fri, 18 Dec 2015 13:15:08 +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 D2E8718CC7E7 for ; Fri, 18 Dec 2015 13:15:08 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id DF8E212079B; Fri, 18 Dec 2015 13:14:01 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from mail-io0-f181.google.com (mail-io0-f181.google.com [209.85.223.181]) by neon.ruby-lang.org (Postfix) with ESMTPS id 632A312074F for ; Fri, 18 Dec 2015 13:13:27 +0900 (JST) Received: by mail-io0-f181.google.com with SMTP id o67so77669246iof.3 for ; Thu, 17 Dec 2015 20:13:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:message-id:subject:mime-version:content-type; bh=ULzDGV7+IRdhLqrhfPdqBavxduoMAOGQVzzCYX7DY2Y=; b=UoDUn+Jvii45a3trHpDurfN/REfq/v0b8G62QiBdrNrmcPb1a1exqs9h3Rl74fUKI2 de1J2xkBnXZ/DBnMImbKhk4MjbQX//wgWfYgay/Pue+ug+HWafbCrc15D86XcPW+WbNJ VOmU9KEjCEheHF80DI6H7Acj9OWIDEyfjU88CKpOr2eBu0iz9xQ79+Rku7MgBA8FdN4f DhllDOkhXyX96ihqi2RPLi62EY3dXDLTV8t0zEAN5jL+wftNOlK0XMMB2LSMllmxYzuT HmjE33fZ6rhTZE/bK3ghDgLuF7E9NzQ4wBMcIriZuAm5SAe5dVAnfUdBH19jhjI+0xea IefQ== X-Received: by 10.107.47.66 with SMTP id j63mr2168435ioo.168.1450412006221; Thu, 17 Dec 2015 20:13:26 -0800 (PST) Received: from Josephe-Jones (75-166-130-47.hlrn.qwest.net. [75.166.130.47]) by smtp.gmail.com with ESMTPSA id jc1sm1978325igb.7.2015.12.17.20.13.25 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Dec 2015 20:13:25 -0800 (PST) Date: Thu, 17 Dec 2015 21:13:24 -0700 From: Joseph Jones To: Ruby developers Cc: Message-ID: X-Mailer: BoxerFree 6.0.4 (321) X-Boxer-Generated: true X-Boxer-IsLike: true MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="567387e4_7c58fd05_16c" X-ML-Name: ruby-core X-Mail-Count: 72344 Subject: [ruby-core:72344] [Ruby trunk - Feature #8544] OpenURI should open 'file://' URIs 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" --567387e4_7c58fd05_16c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Joseph Jones liked your message with Boxer. On December 12, 2015 at 09:30= :03 MST, bokov.vlad=40gmail.com wrote:Issue =238544 has been updated by V= lad Bokov.I think the difference in =23relative=3F =23absolute=3F behavio= ur also points that absolute URI with =22file://=22 should be =22open=22-= able=60> URI.parse('file:///root').absolute=3F=3D> false> URI.parse('/roo= t').absolute=3F=3D> true=60----------------------------------------=46eat= ure =238544: OpenURI should open 'file://' URIshttps://bugs.ruby-lang.org= /issues/8544=23change-55497* Author: Silas Davis* Status: Open* Priority:= Normal* Assignee: ----------------------------------------The following = code prints the contents of '/tmp/file.txt':require 'open-uri'open('/tmp/= file.txt').read =7B=7Cf=7C puts f.read =7Dwhich although useful should pr= obably fail since a unix file path is not a URI, and therefore might shie= ld data problems in a systemHowever the following should produce the same= output and is a URI, but fails:open('file:///tmp/file.txt').read =7B=7Cf= =7C puts f.read =7DI note that the documentation for open-uri does explai= n that it is a wrapper for http, https, and ftp, but to deserve its name = it should open such URIs as specified in this R=46C: http://tools.ietf.or= g/html/rfc1630. This coupled with the fact that it already does open file= s, but not by a URI specification.-- https://bugs.ruby-lang.org/ --567387e4_7c58fd05_16c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Joseph Jones liked your message with Boxer.


= On December 12, 2015 at 09:30:03 MST, bokov.vlad=40gmail.com wrote:
<= blockquote type=3D=22cite=22 style=3D=22border-left-style:solid;border-wi= dth:1px;margin-left:0px;padding-left:10px;=22>Issue =238544 has been upda= ted by Vlad Bokov.


I think the difference in =23relative= =3F =23absolute=3F behaviour also points that absolute URI with =22file:/= /=22 should be =22open=22-able
=60> URI.parse('file:///root').absolu= te=3F
=3D> false
> URI.parse('/root').absolute=3F
=3D> tru= e=60

----------------------------------------
=46eature =23= 8544: OpenURI should open 'file://' URIs
https://bugs.ruby-lang.org/= issues/8544=23change-55497

* Author: Silas Davis
* Status= : Open
* Priority: Normal
* Assignee:
-------------------= ---------------------
The following code prints the contents of '/tm= p/file.txt':

require 'open-uri'
open('/tmp/file.txt').rea= d =7B=7Cf=7C puts f.read =7D

which although useful should prob= ably fail since a unix file path is not a URI, and therefore might shield= data problems in a system

However the following should produc= e the same output and is a URI, but fails:

open('file:///tmp/f= ile.txt').read =7B=7Cf=7C puts f.read =7D

I note that the docu= mentation for open-uri does explain that it is a wrapper for http, https,= and ftp, but to deserve its name it should open such URIs as specified i= n this R=46C: http://tools.ietf.org/html/rfc1630. This coupled with the f= act that it already does open files, but not by a URI specification.




--
https://bugs.ruby-lang.org/
--567387e4_7c58fd05_16c--