Note that datadir must be a string

See redmine #21669.