Had the same issue in 3.1.2 with uncle cheese's event calendar module. Turns out there was a space/line in one of the php files in the module.
Just submitted a request to fix it on github, hopefully not too many others are having the same problem!!
An additional note: The encoding of the files in mysite/code can also matter. One of my files was mistakenly encoded as UTF-8 with byte order mark. Converting to ANSI as UTF-8 as Notepad++ calls it (UTF-8 without byte order mark) solved the issue for me.
Seems rather silly that this should break the admin interface...