Issue/10991 stable7

Stable7 backport of #12218

Commit 39ae569c5cafda5e15865699ff17b9734020329e is missing, as the files do not exist in stable7

@MorrisJobke @PVince81