Issue #14239 has been updated by akr (Akira Tanaka).


normalperson (Eric Wong) wrote:

>  Agreed.  I assume this includes IO.read/binread/readlines/...?

I intent this ticket is just for the open method.

For other methods, nobu already added warnings for
File.read("|echo a"), etc.
But the warning is not produced for IO.read("|echo a").

```
% ruby -e 'IO.read("|echo a")'
% ruby -e 'File.read("|echo a")'
-e:1: warning: IO.read called on File to invoke external command
```

I feel this is an acceptable warning behavior.
If it is not good enough, please open a new ticket.

----------------------------------------
Bug #14239: warn open("|...")
https://bugs.ruby-lang.org/issues/14239#change-69017

* Author: akr (Akira Tanaka)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Recently we found open("|...") is tend to be misused.

Many people uses this method without concerning that it can run a process.

I think it should be deprecated.

So, I propose that ruby warns open("|...").
(and remove this process invoking feature in long term)



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

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>