Writing patches at Friday is just not a good idea ... I found out why the silent drop of the exception is necessary: There is a file not found exception if the .lock-waf_linux2_build does not exist. This patch implements the alternative solution: Fixing the scope of contexts and env.