Max Russell wrote: > None > compStripToTxt is executed > Traceback (most recent call last): > File "HeaderChecker.py", line 182, in ? > diff =checker.compStripToTxt(text, stripped) > File "HeaderChecker.py", line 114, in compStripToTxt > stripped = open(strippedfile, "r") > TypeError: coercing to Unicode: need string or buffer, NoneType found > > > > Why is it returning the None type? > > How can I fix this?
It's because stripped is None in your main program, as the print statement shows. stripped is the value returned from stripFile(). Since stripFile() doesn't explicitly return anything, its return value is None. I think you want stripFile() to return the name of the stripped file, which is filetostrip. Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor