diff -r 006c3e3c76b4 Lib/pydoc.py --- a/Lib/pydoc.py Sat Dec 21 16:19:57 2013 +0100 +++ b/Lib/pydoc.py Sat Dec 21 13:41:21 2013 -0500 @@ -1532,7 +1532,9 @@ if isinstance(thing, str): object = locate(thing, forceload) if not object: - raise ImportError('no Python documentation found for %r' % thing) + raise ImportError('No Python documentation found for %(thing)r.\n' + 'Try help(%(thing)r) for information on recognized strings or ' + 'help(str) for help on the str class.' % {'thing': thing}) return object, thing else: name = getattr(thing, '__name__', None) diff -r 006c3e3c76b4 Lib/test/test_pydoc.py --- a/Lib/test/test_pydoc.py Sat Dec 21 16:19:57 2013 +0100 +++ b/Lib/test/test_pydoc.py Sat Dec 21 13:41:21 2013 -0500 @@ -204,7 +204,9 @@ for s in expected_data_docstrings) # output pattern for missing module -missing_pattern = "no Python documentation found for '%s'" +missing_pattern = "No Python documentation found for '%(module)s'.\n" + + "Try help('%(module)s') for information on recognized strings or " + + "help(str) for help on the str class." # output pattern for module with bad imports badimport_pattern = "problem in %s - ImportError: No module named %r" @@ -405,14 +407,14 @@ def test_not_here(self): missing_module = "test.i_am_not_here" result = str(run_pydoc(missing_module), 'ascii') - expected = missing_pattern % missing_module + expected = missing_pattern % {'module': missing_module} self.assertEqual(expected, result, "documentation for missing module found") def test_input_strip(self): missing_module = " test.i_am_not_here " result = str(run_pydoc(missing_module), 'ascii') - expected = missing_pattern % missing_module.strip() + expected = missing_pattern % {'module': missing_module.strip()} self.assertEqual(expected, result) def test_stripid(self):