Hi William Cauchois > Original author of the patch here. I took some time to look at this > today and found that the doctesting bug was due to reading the value > of sys.stdout only once in install(); during doctesting, sys.stdout is > reset some time after install() is called, presumably to redirect > output back to the doctesting mechanism. > > I fixed this bug and restructured the code by moving it out of a class > (since the single instance variable was no longer needed) in a new > patch which I've uploaded to #1918. Unless we find any more bugs with > the displayhook, the only problem that remains is that of updating the > doctests where a list of matrices is output.
Many thanks for taking care of that ! I'll try to break it tomorrow, and tell you if I find some problem. > Back when I was working on this, my approach to fixing the doctests > relied upon an automatic solution. William had told me about this > nifty little tool called sage -fixdoctests that looked at the output > of a test run and spliced the output from the "Expected:" section back > into the original source code so that it would pass the doctest. The > problem was, sage -fixdoctests couldn't handle multiline output from a > test case, which are exactly the types of outputs that will be > affected by the displayhook. I spent some time writing a tool that > could handle multiline outputs based on sage -fixdoctests, but even > though it should be really simple I kept making off by one errors :). > > As soon as I get back home to my external HD, I can post the source of > that incomplete tool. I will take a look and see if I can fix it, > because I think that a fixed sage -fixdoctests would be a valuable > resource to the Sage community. Thanks again ! Please tell me when you'll be ok. There certainly will be a long rereading to check that the automated fixdoctests is not hiding a bug. I'll be glad to help if needed. Cheers, Florent -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org