[New-bugs-announce] [issue5884] pydoc to return error status code

Mike Miller report at bugs.python.org
Thu Apr 30 03:06:32 CEST 2009


New submission from Mike Miller <python.org at mgmiller.net>:

When pydoc is run from the command line and unable to write a file for a
module because of a syntax error, it would be helpful to return a
non-zero status code as a result.

What it does currently:
    C:\>C:\python26\Lib\pydoc.py -w mymod
    problem in .\mymod.py - <type 'exceptions.SyntaxError'>: invalid
syntax (mymod.py, line 1)

    C:\>echo %ERRORLEVEL%
    0

What it should do if an error is found:
    C:\>type doesnt_exist.txt
    The system cannot find the file specified.

    C:\>echo %ERRORLEVEL%
    1


This would allow us to make our build scripts able to react to error
conditions, etc without having to use another script.  Thanks.

----------
components: Library (Lib)
messages: 86837
nosy: mixmastamyk
severity: normal
status: open
title: pydoc to return error status code
type: feature request
versions: Python 2.6

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


More information about the New-bugs-announce mailing list