After fix for https://bugs.freedesktop.org/show_bug.cgi?id=86950, this API returns false if it's passed a file as opposed to a directory.
Perhaps we should have a test for this.
Fixed in git.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.