remove 2 lines from doc tests to get tests to pass.
use stringIO instead of temporary files.
update doc tests