This reverts commit f0ce827c. This reapplies commit 83973cf1. The new test now should pass on Windows thanks to commit 4d6483e9.