diff --git a/bindings/python/scripts/dlite-validate b/bindings/python/scripts/dlite-validate index 8a2635e34..48fc03827 100644 --- a/bindings/python/scripts/dlite-validate +++ b/bindings/python/scripts/dlite-validate @@ -5,8 +5,23 @@ import sys import argparse import json import re +import ctypes +from ctypes.util import find_library from pathlib import Path +# Silence warning about behavior by setting environment variable +# DLITE_BEHAVIOR=OFF before importing dlite. +# This must be done at c-level outside os.environ. +clib = find_library("c") +dll = ctypes.CDLL(clib) +setenv = dll.setenv +setenv.argtypes = [ + ctypes.POINTER(ctypes.c_char), # name + ctypes.POINTER(ctypes.c_char), # value + ctypes.c_int, # overwrite +] +setenv(b"DLITE_BEHAVIOR", b"OFF", 1) + import dlite diff --git a/src/dlite-behavior.c b/src/dlite-behavior.c index b6f8d0c1b..c8b6a62f5 100644 --- a/src/dlite-behavior.c +++ b/src/dlite-behavior.c @@ -128,7 +128,7 @@ int dlite_behavior_get(const char *name) const char *ver = dlite_get_version(); // current version b->value = (strcmp_semver(ver, b->version_new) >= 0) ? 1 : 0; - dlite_warnx("Behavior `%s` is not configured. " + dlite_warnx("Behavior change `%s` is not configured. " "It will be enabled by default from v%s. " "See https://sintef.github.io/dlite/user_guide/configure_behavior_changes.html for more info.", b->name, b->version_new);