It seems to be caused by the presence of: nlIter = re.finditer('\n',self.raw) in one of the methods of one of the class methods.
So, I moved the work to a separate function (not method): def initNewLines(self): self.newLines = findNewLines(self.raw) def findNewLines( searchIn): ''' given a string return a list with the indices of each \n character ''' result = [] for nl in re.finditer('\n', searchIn): result.append(nl.start) return result But it still doesn't seem to work. If I change it to self.newlines = [], web2py pickles the session fine. confused... --