not really a “bug” in ota_from_target_files

While building an OTA (Over The Air update) for an Android device I had the following error.

in SetPermissions
self.script.append('set_perm(%d, %d, 0%o, "%s");' % (uid, gid, mode, fn))
TypeError: %d format: a number is required, not NoneType

At first glance it  appears to be in in but this is where the “bug” triggers itself:

def recurse(item, current):
print "PREPRIMERO %s" % (
print "PRIMERO %s %d %d %d" % (, item.uid, item.gid, item.mode) # ya aqui peta.
# current is the (uid, gid, dmode, fmode) tuple that the current
# item (and all its children) have already been set to.  We only
# need to issue set_perm/set_perm_recursive commands if we're
# supposed to be something different.

It usually works properly and the code is not faulty but since I’ve used a Chinese source some of the packages are not in an ASCII format.  The easiest solution is to rename those files and build the target files again.

I just renamed  注音仓颉输入法_1.0.apk and other similar apks.