exception could provide more info

Bug #1314597 reported by robert schaefer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mortoray.com
Fix Released
Medium
Unassigned

Bug Description

In your example on pypi.python.org/pypi/shelljob, you use "myprog" as a dummy call.
If you try to actually use this in an example, it exceptions but the exception doesn't point back to the failed command.
It would be helpful to know with command in a list of commands caused the exception.

>>> from shelljob import job
>>> jm = job.FileMonitor()
>>> jm.run([['ls','-alR','/usr/local'],'my_prog','build output input'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.macosx-10.6-x86_64/egg/shelljob/job.py", line 60, in run
  File "build/bdist.macosx-10.6-x86_64/egg/shelljob/proc.py", line 39, in run
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1308, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Revision history for this message
edA-qa (eda-qa) wrote :

I agree it would be nice to have the failed command in the exception. This is just the underlying Python exception though, which means Python itself doesn't report the command. I'll see if I can somehow wrap the exceptions, but that would mean it would no longer be an OSError. Hmm...

Changed in mortoray.com:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
edA-qa (eda-qa) wrote :

Version 0.4.4 introduces a CommandException which will contain the failed command as well as the underlying exception.

Changed in mortoray.com:
status: Confirmed → Fix Released
Revision history for this message
robert schaefer (rps-v) wrote : Re: [Bug 1314597] exception could provide more info

This email is not about a bug but is a shelljob extension question.

Have you considered tying shelljob to sched or an equivalent of sched to make a cron-like tool?

On Apr 30, 2014, at 11:09 PM, edA-qa <email address hidden> wrote:

> Version 0.4.4 introduces a CommandException which will contain the
> failed command as well as the underlying exception.
>
> ** Changed in: mortoray.com
> Status: Confirmed => Fix Released
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1314597
>
> Title:
> exception could provide more info
>
> Status in Code for mortoray.com:
> Fix Released
>
> Bug description:
> In your example on pypi.python.org/pypi/shelljob, you use "myprog" as a dummy call.
> If you try to actually use this in an example, it exceptions but the exception doesn't point back to the failed command.
> It would be helpful to know with command in a list of commands caused the exception.
>
>>>> from shelljob import job
>>>> jm = job.FileMonitor()
>>>> jm.run([['ls','-alR','/usr/local'],'my_prog','build output input'])
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "build/bdist.macosx-10.6-x86_64/egg/shelljob/job.py", line 60, in run
> File "build/bdist.macosx-10.6-x86_64/egg/shelljob/proc.py", line 39, in run
> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 711, in __init__
> errread, errwrite)
> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1308, in _execute_child
> raise child_exception
> OSError: [Errno 2] No such file or directory
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mortoray.com/+bug/1314597/+subscriptions
>
>
> !DSPAM:5361bc7526278298407386!
>

-----------------------------------
robert schaefer
Atmospheric Sciences Group
MIT Haystack Observatory
Westford, MA 01886

email: <email address hidden>
voice: 781-981-5767
www: http://www.haystack.mit.edu

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.