[Bug 10011] convert argument to Pathname if required, throw type error if conversion fails