I realized that the coercion to oct string I did was incorrect.

>>> oct(int(str('744'), 8))
'0744'
>>> oct(int(str(744), 8))
'0744'

The second should be '1305'.

I just went ahead and made the coercion very explicit with an if switch.  I
verified that all the unit tests and the previously affected integration test
succeed.