In Python 3.3+ (or with this backport for 2.6 and 2.7), you can simply use ipaddress
:
import ipaddress
addr = str(ipaddress.ip_address(167772160))
assert addr == '10.0.0.0'
Alternatively, you can manually pack the value
import socket,struct
packed_value = struct.pack('!I', 167772160)
addr = socket.inet_ntoa(packed_value)
assert addr == '10.0.0.0'
Check the permissions of the .git/objects
file. It sounds like you may have mistakenly used sudo
at some point in the past and given ownership to root
rather than to yourself.