I had this problem on Windows, too. I fixed it, but I forgot how. I had a lot of uncommitted stuff on my machine, which I committed now, but none of it seems related to the problem.

I tried to replicate the bug on Ubuntu but could not.

Nevertheless, I found the line responsible (although it has been there forever, I don't know why the problem appeared only now) and patched it. My previous fix was apparently done differently, so now it is, well, fixed twice, so it should more than work.