fix: issymlinkoption is not available for an optiondescription

This commit is contained in:
egarette@silique.fr 2026-01-14 14:29:23 +01:00
parent a593fa3d35
commit a70627db2b

View file

@ -307,7 +307,7 @@ class UserData:
if isinstance(value, list):
value = display_list(value, add_quote=True)
else:
value = '"' + value + '"'
value = '"' + str(value) + '"'
return value
def _populate_error_warnings(self):
@ -318,14 +318,6 @@ class UserData:
option = self.config.forcepermissive.option(path)
else:
option = self.config.option(path)
if option.issymlinkoption():
err = _('it\'s a symlink option so we cannot set the value {0}').format(self._display_value(option, value))
if self.invalid_user_data_error:
msg = _('{0}, it has been loading from {1}').format(err, options["source"])
else:
msg = _('{0}, it will be ignored when loading from {1}').format(err, options["source"])
self.unknowns.append({msg: option._subconfig})
continue
try:
if option.isoptiondescription():
if value:
@ -343,6 +335,14 @@ class UserData:
): option._subconfig}
)
continue
if option.issymlinkoption():
err = _('it\'s a symlink option so we cannot set the value {0}').format(self._display_value(option, value))
if self.invalid_user_data_error:
msg = _('{0}, it has been loading from {1}').format(err, options["source"])
else:
msg = _('{0}, it will be ignored when loading from {1}').format(err, options["source"])
self.unknowns.append({msg: option._subconfig})
continue
except ConfigError as err:
self.invalids.append({
_("{0}, it has been loaded from {1}").format(err, options["source"]): option._subconfig}