So this handling most likely needs to be in another place. As the argument already says, it are arguments for File.open, so they should be handled there. This means the fix likely would go into IO#write and not IO.write.