There is a problem, and it's a Python 3.2 problem. All the solutions presented here work perfectly well in Python 2.7.1, and they all fail at exactly the same point in Python 3.2 - it's the line that tries to seek from the end. e.g. f.seek(offset, os.SEEK_END)
I'll register this as a Python bug. Thank you, everyone, for the help and guidance. Sincerely Thomas Philips -- http://mail.python.org/mailman/listinfo/python-list