Git says this is binary and it is not

I had an annoying little issue, where git was saying my file was binary. What do I care what git thinks? Well, I care if it refuses to show me my diff:

[abie@cluster-dev TICS]$ git diff
diff --git a/ b/
index 3b5b4ca..2cb591e 100644
Binary files a/ and b/ differ

Google and Stack Overflow usually solve any problem I have like this, but today they under-delivered. They gave me a good hint, there must be some funny character in my .py file. That can happen when a 1.5 year old is helping with the typing.

Here is a quick fix, in case I (or you) ever find ourselves in this situation again:

import unidecode
f = file('').read()
with file('', 'w') as f2:

All better. Thanks again unidecode.

Comments Off on Git says this is binary and it is not

Filed under software engineering

Comments are closed.