[#73707] [Ruby trunk Misc#12004] Code of Conduct — hanmac@...
Issue #12004 has been updated by Hans Mackowiak.
3 messages
2016/02/05
[#73730] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/07
[#73746] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/09
[#73919] [Ruby trunk Feature#11262] Make more objects behave like "Functions" — Ruby-Lang@...
Issue #11262 has been updated by J旦rg W Mittag.
3 messages
2016/02/22
[#74019] [Ruby trunk Bug#12103][Rejected] ruby process hangs while executing regular expression. — duerst@...
Issue #12103 has been updated by Martin D端rst.
3 messages
2016/02/27
[ruby-core:73638] [Ruby trunk Bug#12044] net/ftp.rb: add NullSocket#closed? to fix closing not yet opened connection
From:
antstorm@...
Date:
2016-02-01 22:52:41 UTC
List:
ruby-core #73638
Issue #12044 has been reported by Anthony Dmitriyev. ---------------------------------------- Bug #12044: net/ftp.rb: add NullSocket#closed? to fix closing not yet opened connection https://bugs.ruby-lang.org/issues/12044 * Author: Anthony Dmitriyev * Status: Open * Priority: Normal * Assignee: ruby-core * ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin14] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- Hi there, I've opened a PR for this issue on GitHub: https://github.com/ruby/ruby/pull/1232 An instance of `NullSocket` is stored in a `@sock` variable of a new `Net::FTP`, it also has a `#close` method (that obviously does nothing), but it is never called, because a wrapping `Net::FTP#close` checks that `@sock and not @sock.closed?` which crashes with `FTPConnectionError` because there is no method `#closed?` on `NullSocket`. This PR adds it and a test to verify that it works. Below is the way to reproduce the error in the IRB. As you can see it's quite confusing, you'd expect `#closed?` not to raise an error, but return `true` instead. ~~~ >> ftp = Net::FTP.new => #<Net::FTP:0x007f90c38075e0 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Thread::Mutex:0x007f90c3807590>, @binary=true, @passive=true, @debug_mode=false, @resume=false, @sock=#<Net::FTP::NullSocket:0x007f90c3807568>, @logged_in=false, @open_timeout=nil, @read_timeout=60> >> ftp.close Net::FTPConnectionError: not connected from /usr/local/var/rbenv/versions/2.3.0/lib/ruby/2.3.0/net/ftp.rb:1277:in `method_missing' from /usr/local/var/rbenv/versions/2.3.0/lib/ruby/2.3.0/net/ftp.rb:1168:in `close' from (irb):6 from /usr/local/var/rbenv/versions/2.3.0/bin/irb:11:in `<main>' >> ftp.closed? Net::FTPConnectionError: not connected from /usr/local/var/rbenv/versions/2.3.0/lib/ruby/2.3.0/net/ftp.rb:1277:in `method_missing' from /usr/local/var/rbenv/versions/2.3.0/lib/ruby/2.3.0/net/ftp.rb:1184:in `closed?' from (irb):7 from /usr/local/var/rbenv/versions/2.3.0/bin/irb:11:in `<main>' ~~~ -- 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>