classification
Title: test_pydoc fails with the installed testsuite
Type: Stage: needs patch
Components: Tests Versions: Python 3.5, Python 3.4
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: doko, ezio.melotti, michael.foord, petr.viktorin, pitrou, r.david.murray
Priority: normal Keywords:

Created on 2013-04-16 15:23 by doko, last changed 2018-01-06 17:01 by BreamoreBoy.

Messages (5)
msg187094 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2013-04-16 15:23
this fails on an Ubuntu installation, running the installed tests. confirmed by a coworker. Where does the 'invalid distro' come from?

======================================================================
FAIL: test_apropos_with_bad_package (test.test_pydoc.PydocImportTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.3/test/test_pydoc.py", line 457, in test_apropos_with_bad_package
    result = run_pydoc('zqwykjv', '-k', PYTHONPATH=TESTFN)
  File "/usr/lib/python3.3/test/test_pydoc.py", line 219, in run_pydoc
    rc, out, err = assert_python_ok('-B', pydoc.__file__, *args, **env)
  File "/usr/lib/python3.3/test/script_helper.py", line 55, in assert_python_ok
    return _assert_python(True, *args, **env_vars)
  File "/usr/lib/python3.3/test/script_helper.py", line 47, in _assert_python
    "stderr follows:\n%s" % (rc, cmd_line, err.decode('ascii', 'ignore')))
AssertionError: Process return code is 2, cmd is: ['/usr/bin/python3.3dm', '-B', '/usr/lib/python3.3/pydoc.py', '-k', 'zqwykjv'], stderr follows:
invalid distro: 'Ubuntu'
Usage: pydoc.py [options]
A simple dialog based tool for basic configuration of Speech Dispatcher
and problem diagnostics.

pydoc.py: error: no such option: -k

======================================================================
FAIL: test_apropos_with_unreadable_dir (test.test_pydoc.PydocImportTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.3/test/test_pydoc.py", line 467, in test_apropos_with_unreadable_dir
    result = run_pydoc('zqwykjv', '-k', PYTHONPATH=TESTFN)
  File "/usr/lib/python3.3/test/test_pydoc.py", line 219, in run_pydoc
    rc, out, err = assert_python_ok('-B', pydoc.__file__, *args, **env)
  File "/usr/lib/python3.3/test/script_helper.py", line 55, in assert_python_ok
    return _assert_python(True, *args, **env_vars)
  File "/usr/lib/python3.3/test/script_helper.py", line 47, in _assert_python
    "stderr follows:\n%s" % (rc, cmd_line, err.decode('ascii', 'ignore')))
AssertionError: Process return code is 2, cmd is: ['/usr/bin/python3.3dm', '-B', '/usr/lib/python3.3/pydoc.py', '-k', 'zqwykjv'], stderr follows:
invalid distro: 'Ubuntu'
Usage: pydoc.py [options]
A simple dialog based tool for basic configuration of Speech Dispatcher
and problem diagnostics.

pydoc.py: error: no such option: -k

======================================================================
FAIL: test_url_requests (test.test_pydoc.PydocUrlHandlerTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.3/test/test_pydoc.py", line 560, in test_url_requests
    self.assertEqual(result, title)
AssertionError: 'Pydoc: Error - search?key=pydoc' != 'Pydoc: Search Results'
- Pydoc: Error - search?key=pydoc
+ Pydoc: Search Results
msg187097 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2013-04-16 15:32
this can be avoided when running python with -S, the error comes from a package installed in site-packages.
msg187100 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-04-16 16:02
There's an issue somewhere about allowing certain tests to be run in a tailored python environment (I'm pretty sure it involved test_site but I can't lay my hands on it).  It seems like test_pydoc would be another candidate for that capability.
msg224182 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-07-28 20:05
Can our testing gurus shed any light on this?
msg309555 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2018-01-06 17:00
This is caused by Brailcom's Speech Dispatcher, whose config script ran optparse on import. Apparently it was fixed in their version 0.8.6.

Some references:
https://github.com/brailcom/speechd/commit/1808ea1a6e840951ffde61e5a6476ccfc118ab5a
https://its.freebsoft.org/its/issues/29268
https://bugs.archlinux.org/task/40478
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=838665
History
Date User Action Args
2018-01-06 17:01:31BreamoreBoysetnosy: - BreamoreBoy
2018-01-06 17:00:05petr.viktorinsetnosy: + petr.viktorin
messages: + msg309555
2014-07-28 20:05:58BreamoreBoysetnosy: + pitrou, ezio.melotti, BreamoreBoy, michael.foord

messages: + msg224182
versions: + Python 3.5, - Python 3.3
2013-04-16 16:02:34r.david.murraysetnosy: + r.david.murray
messages: + msg187100
2013-04-16 15:32:24dokosetmessages: + msg187097
2013-04-16 15:23:54dokolinkissue17750 dependencies
2013-04-16 15:23:36dokocreate