Sarge 0.1.1 drops into the debugger on error

Issue #5 resolved
Paul Moore created an issue

I was trying a test example with sarge, and hit an error (looks like the command I was using couldn't be found). The program dropped me into the Python debugger, rather than giving a normal traceback:

>python
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:57:17) [MSC v.1600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from sarge import capture_stdout
>>> from io import TextIOWrapper
>>> for i, line in enumerate(TextIOWrapper(capture_stdout('yada.py -t 5 foo'))):
...   print(i, line)
...
> c:\work\scratch\v33\lib\site-packages\sarge\__init__.py(576)wait()
-> logger.warning('No process found for %s', self)

Comments (2)

  1. Paul Moore reporter

    The underlying error turned out to be that capture_stdout doesn't seem to respect PATHEXT on Windows - it didn't like running yada.py directly, but it did when I changed the call to "python yada.py ...".

    Is that expected behaviour? I guess so, as it matches subprocess (with shell=False). Maybe a clearer note in the documentation would be worthwhile.

  2. Log in to comment