Error while changing the default application with which we open a file Recently I've tried to change the default application with which a file is opened, by doing the following:


Right click on the file
Get info
In "Open with", change to the application you want your file to be opened with. 
Click on the "Change All" button which is found under the "Open with" label


in the last step, i.e. when I click on "Change All", I receive the following message:



then if I look at the default application that opens this file, it's really the application I've just chosen, but when I click on the file to open it, I've the following error message:



Yes, I was trying to open a Makefile for a C program.

Any ideas of why this is happening and how to solve it?
I had the same problem, with a set of files that do have an extension (testfile.py). It turned out that there was an (invisible to me) space at the end of the filename "testfile.py ", which was causing the headache. i removed that, and all was fine again.