Replying to self, it seems to be related to https://sourceforge.net/tracker/index.php?func=detail&aid=1163244&group_id=5470&atid=105470 (Syntax error on large file with MBCS encoding) even though my files had # -*- coding: ascii -*- However, if I removed this explicit ascii encoding then I did not get any syntax error. /Simon