New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
subprocess.check_output: "docstring has inconsistent leading whitespace" #51630
Comments
I've tested the docstring of the module subprocess. ~ $ python2.5 -m doctest /usr/lib/python2.5/subprocess.py OK
~ $ python3 -m doctest /usr/lib/python3.1/subprocess.py
Traceback (most recent call last):
File "/usr/lib/python3.1/runpy.py", line 128, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python3.1/runpy.py", line 34, in _run_code
exec(code, run_globals)
File "/usr/lib/python3.1/doctest.py", line 2637, in <module>
sys.exit(_test())
File "/usr/lib/python3.1/doctest.py", line 2626, in _test
failures, _ = testmod(m)
File "/usr/lib/python3.1/doctest.py", line 1847, in testmod
for test in finder.find(m, name, globs=globs, extraglobs=extraglobs):
File "/usr/lib/python3.1/doctest.py", line 854, in find
self._find(tests, obj, name, module, source_lines, globs, {})
File "/usr/lib/python3.1/doctest.py", line 908, in _find
globs, seen)
File "/usr/lib/python3.1/doctest.py", line 896, in _find
test = self._get_test(obj, name, module, globs, source_lines)
File "/usr/lib/python3.1/doctest.py", line 980, in _get_test
filename, lineno)
File "/usr/lib/python3.1/doctest.py", line 590, in get_doctest
return DocTest(self.get_examples(string, name), globs,
File "/usr/lib/python3.1/doctest.py", line 604, in get_examples
return [x for x in self.parse(string, name)
File "/usr/lib/python3.1/doctest.py", line 566, in parse
self._parse_example(m, name, lineno)
File "/usr/lib/python3.1/doctest.py", line 636, in _parse_example
lineno + len(source_lines))
File "/usr/lib/python3.1/doctest.py", line 722, in _check_prefix
(lineno+i+1, name, line))
ValueError: line 11 of the docstring for subprocess.check_output has
inconsistent leading whitespace: "'" |
I fixed the docstring inconsistency (see patch) and some obvious things. But I still have errors. ~ $ python3 -m doctest py3_failed/subprocess.py File "py3_failed/subprocess.py", line 139, in subprocess File "py3_failed/subprocess.py", line 449, in subprocess.check_output File "py3_failed/subprocess.py", line 455, in subprocess.check_output File "py3_failed/subprocess.py", line 559, in subprocess.getstatusoutput 3 items had failures: |
It may be fixed with "# doctest: +ELLIPSIS" and "# doctest: +SKIP" I have tested only with Debian Lenny. |
Forget the "python2.5 -m doctest /usr/lib/python2.5/subprocess.py" in The attached patch may be enough to fix the docstring inconsistencies |
Patch against the trunk, and against the Py3k branch. It fixes:
|
Patch updated to backport r51536 in trunk. |
Committed to r76925 (trunk) and r76926 (py3k). Thank you Georg. I see small remaining inconsistencies in the docstring. See additional patches:
|
OK, applied in r77086, r77087. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: