Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace"

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Nov 23, 2009, 5:28 AM

Post #1 of 14 (611 views)
Permalink
[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace"

New submission from flox <laxyf [at] yahoo>:

I've tested the docstring of the module subprocess.
Python 2.5 is OK, but Python 3.1 fails.

~ $ python2.5 -m doctest /usr/lib/python2.5/subprocess.py
...............
----------------------------------------------------------------------
Ran 15 tests in 0.012s

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: "'"

----------
components: Library (Lib), Tests
messages: 95625
nosy: flox
severity: normal
status: open
title: subprocess.check_output: "docstring has inconsistent leading whitespace"
versions: Python 3.1, Python 3.2

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7381>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 23, 2009, 5:40 AM

Post #2 of 14 (581 views)
Permalink
[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace" [In reply to]

flox <laxyf [at] yahoo> added the comment:

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
Failed example:
subprocess.getstatusoutput('/bin/junk')
Expected:
(256, 'sh: /bin/junk: not found')
Got:
(32512, '/bin/sh: /bin/junk: No such file or directory')
**********************************************************************
File "py3_failed/subprocess.py", line 449, in subprocess.check_output
Failed example:
check_output(["ls", "-l", "/dev/null"])
Expected:
b'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n'
Got:
b'crw-rw-rw- 1 root root 1, 3 Nov 15 17:41 /dev/null\n'
**********************************************************************
File "py3_failed/subprocess.py", line 455, in subprocess.check_output
Failed example:
check_output(["/bin/sh", "-c",
"ls -l non_existent_file ; exit 0"],
stderr=STDOUT)
Expected:
b'ls: non_existent_file: No such file or directory\n'
Got:
b'ls: cannot access non_existent_file: No such file or directory\n'
**********************************************************************
File "py3_failed/subprocess.py", line 559, in subprocess.getstatusoutput
Failed example:
subprocess.getstatusoutput('/bin/junk')
Expected:
(256, 'sh: /bin/junk: not found')
Got:
(32512, '/bin/sh: /bin/junk: No such file or directory')
**********************************************************************
3 items had failures:
1 of 6 in subprocess
2 of 2 in subprocess.check_output
1 of 4 in subprocess.getstatusoutput
***Test Failed*** 4 failures.
~ $

----------
keywords: +patch
Added file: http://bugs.python.org/file15386/issue7381_first.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7381>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 23, 2009, 5:45 AM

Post #3 of 14 (570 views)
Permalink
[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace" [In reply to]

flox <laxyf [at] yahoo> added the comment:

It may be fixed with "# doctest: +ELLIPSIS" and "# doctest: +SKIP"
directives...
But it is probably platform-dependent.

I have tested only with Debian Lenny.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7381>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 23, 2009, 8:40 AM

Post #4 of 14 (575 views)
Permalink
[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace" [In reply to]

flox <laxyf [at] yahoo> added the comment:

Forget the "python2.5 -m doctest /usr/lib/python2.5/subprocess.py" in
first message msg95625.
This command does not do what I guessed. And there's no doctest in the
Python2.5 "subprocess" module.


The attached patch may be enough to fix the docstring inconsistencies
with Python3.1.
It might not be mandatory to make the docstring 100% successful.
(I see no PEP which requires that).

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7381>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 3, 2009, 10:24 AM

Post #5 of 14 (512 views)
Permalink
[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace" [In reply to]

Changes by flox <laxyf [at] yahoo>:


Removed file: http://bugs.python.org/file15386/issue7381_first.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7381>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 3, 2009, 10:28 AM

Post #6 of 14 (510 views)
Permalink
[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace" [In reply to]

flox <laxyf [at] yahoo> added the comment:

Patch against the trunk, and against the Py3k branch.

It fixes:
* docstring and documentation formatting
* and examples

----------
assignee: -> georg.brandl
components: +Documentation
nosy: +georg.brandl
versions: +Python 2.6, Python 2.7
Added file: http://bugs.python.org/file15446/issue7381.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7381>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 3, 2009, 10:28 AM

Post #7 of 14 (525 views)
Permalink
[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace" [In reply to]

Changes by flox <laxyf [at] yahoo>:


Added file: http://bugs.python.org/file15447/issue7381_py3k.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7381>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 17, 2009, 3:29 AM

Post #8 of 14 (471 views)
Permalink
[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace" [In reply to]

flox <laxyf [at] yahoo> added the comment:

Patch updated to backport r51536 in trunk.
It makes "python -3" happier (do not compare None >= 0).

----------
Added file: http://bugs.python.org/file15580/issue7381_v2.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7381>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 17, 2009, 3:29 AM

Post #9 of 14 (471 views)
Permalink
[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace" [In reply to]

Changes by flox <laxyf [at] yahoo>:


Added file: http://bugs.python.org/file15581/issue7381_py3k_v2.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7381>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 17, 2009, 3:29 AM

Post #10 of 14 (472 views)
Permalink
[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace" [In reply to]

Changes by flox <laxyf [at] yahoo>:


Removed file: http://bugs.python.org/file15447/issue7381_py3k.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7381>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 17, 2009, 3:30 AM

Post #11 of 14 (471 views)
Permalink
[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace" [In reply to]

Changes by flox <laxyf [at] yahoo>:


Removed file: http://bugs.python.org/file15446/issue7381.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7381>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 20, 2009, 7:21 AM

Post #12 of 14 (466 views)
Permalink
[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace" [In reply to]

Florent Xicluna <laxyf [at] yahoo> added the comment:

Committed to r76925 (trunk) and r76926 (py3k).

Thank you Georg.

I see small remaining inconsistencies in the docstring.
Either we agree with implicit "import subprocess" or "from subprocess
import *", but we should not mix both.

See additional patches:
* issue7381_v3.diff
* issue7381_py3k_v3.diff

----------
Added file: http://bugs.python.org/file15624/issue7381_v3.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7381>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 20, 2009, 7:21 AM

Post #13 of 14 (454 views)
Permalink
[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace" [In reply to]

Changes by Florent Xicluna <laxyf [at] yahoo>:


Added file: http://bugs.python.org/file15625/issue7381_py3k_v3.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7381>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 28, 2009, 12:10 AM

Post #14 of 14 (434 views)
Permalink
[issue7381] subprocess.check_output: "docstring has inconsistent leading whitespace" [In reply to]

Georg Brandl <georg [at] python> added the comment:

OK, applied in r77086, r77087.

----------
resolution: -> fixed
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7381>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.