Not a bug. You are using different files.
Both are directories,
here is the output with the same dir's:
Pike 7.7.5
write("%d\n",Stdio.file_size("/etc"));
-2
Pike 7.7.23
write("%d\n",Stdio.file_size("/etc"));
4096
I actually haven't just retyped but also retried it!