Merge with 3.2 and also remove captured_output from __all__ (see #7960).