[New-bugs-announce] [issue11692] subprocess demo functions

Ross Lagerwall report at bugs.python.org
Sun Mar 27 09:27:50 CEST 2011


New submission from Ross Lagerwall <rosslagerwall at gmail.com>:

Running subprocess as a module invokes some demo functions.

On posix, one of these doesn't work:

$ ./python -m subprocess
Process list:
b'  PID TTY          TIME CMD\n 9003 pts/6    00:00:00 python\n 9004 pts/6    00:00:00 ps\n23760 pts/6    00:00:00 bash\n'
Looking for 'hda'...
b''

Trying a weird file...
The file didn't exist.  I thought so...
Child traceback:
Traceback (most recent call last):
  File "/home/ross/code/py3kdev/silly/Lib/subprocess.py", line 1757, in _demo_posix
    print(Popen(["/this/path/does/not/exist"]).communicate())
  File "/home/ross/code/py3kdev/silly/Lib/subprocess.py", line 766, in __init__
    restore_signals, start_new_session)
  File "/home/ross/code/py3kdev/silly/Lib/subprocess.py", line 1439, in _execute_child
    raise child_exception_type(errno_num, err_msg)
OSError: [Errno 2] No such file or directory: '/this/path/does/not/exist'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ross/code/py3kdev/silly/Lib/runpy.py", line 160, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/ross/code/py3kdev/silly/Lib/runpy.py", line 73, in _run_code
    exec(code, run_globals)
  File "/home/ross/code/py3kdev/silly/Lib/subprocess.py", line 1790, in <module>
    _demo_posix()
  File "/home/ross/code/py3kdev/silly/Lib/subprocess.py", line 1762, in _demo_posix
    print(e.child_traceback)
AttributeError: 'OSError' object has no attribute 'child_traceback'


I think these demo functions should be either be removed or incorporated into the docs.

----------
messages: 132291
nosy: gregory.p.smith, rosslagerwall
priority: normal
severity: normal
status: open
title: subprocess demo functions
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11692>
_______________________________________


More information about the New-bugs-announce mailing list