Fixed the breakage with the octal conversion.  Turns out oct() returns a string in Python.  For now, I'm just passing in a base 10 integer and commenting it to show that it's supposed to be octal 0666.