Actions
Bug #14369
closedWin32::Resolv.get_hosts_path may return nil, causing Resolv to fail
Description
Win32::Resolv.get_hosts_path() may return nil
.
The Resolv
class uses that to get the hosts filename which is used as the default when initializing Hosts
as @filename
.
However, File.open(@filename, 'rb')
is always called, even if @filename
is nil
.
This causes the error: TypeError: no implicit conversion of nil into String
Updated by docwhat (Christian Höltje) almost 7 years ago
Added GitHub PR #1791
Updated by nobu (Nobuyoshi Nakada) almost 7 years ago
What configuration causes it?
No TCP/IP stack?
Updated by nobu (Nobuyoshi Nakada) almost 7 years ago
- Status changed from Open to Closed
Applied in changeset trunk|r61898.
resolv.rb: NUL hosts
- lib/resolv.rb (Resolv::Hosts::DefaultFileName): fallback to NUL
device when Win32::Resolv.get_hosts_path() returned nil, to get
rid of TypeError in lazy_initialize.
[ruby-core:84907] [Bug #14369] [Fix GH-1791]
Actions
Like0
Like0Like0Like0