Project

General

Profile

Actions

Bug #5645

closed

YAML.load_file prevents following File.delete

Added by gknowles (Glen Knowles) about 13 years ago. Updated about 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.3p0 (2011-10-30) [i386-mingw32]
Backport:
[ruby-core:41088]

Description

In ruby 1.9.2 and earlier this works:
d = YAML::load_file(fname)
File.delete(fname)

In 1.9.3 the delete fails with permission denied.

The work around is to use:
d = File.open(fname) { |f| YAML::load(f) }
File.delete(fname)

Actions

Also available in: Atom PDF

Like0
Like0