In python, "SystemError: com_backpatch: offset too large"
is thrown when executing the code generated by the following:
f = open("test.py", "w")
f.write("def fn():\n a =1000\n")
for a in xrange(3000):
if a == 0:
f.write(" if a == "+str(a)+": \n print "+str(a)+"\n")
else:
f.write(" elif a == "+str(a)+": \n print "+str(a)+"\n")
f.close()
import test
It is clear that if the length statement goes beyond a certain length, it throws this error.
Can someone give more insight into this error?
Accourding to this: http://www.cgl.ucsf.edu/pipermail/chimera-dev/2007/000404.html
More details here: http://www.mail-archive.com/python-list@python.org/msg72631.html
JFYI, this script worked for me in a Debian Testing host with a 32bits userspace and kernel and Python 2.5.4.
Looks like you are hitting a python interpreter limit. It appears that the branch from the start of the if to the end is too far - probably because offset is limited to 16 bits. If you change the "elif" to "if" then the problem goes away.
You need to reduce the size of the "if/elif" chain.
HIH
...richie