title: Why aren't my scripts running when called from cron and other scheduled services?
body: <p>I'm simply trying to trigger a script to run every so often to download items into a directory.</p>
  
  <p>I have a python script that downloads a directory. I've tried running the python script directly from cron....</p>
  
  <pre><code>5 * * * * python /home/yt/pybox/boxclient.py -U email@address.com -td -Pd moremusic/youtube
  </code></pre>
  
  <p>Even having cron call a bash script that runs the python script....</p>
  
  <pre><code>5 * * * * cd /home/yt/yxbox/runscript
  </code></pre>
  
  <p>I've even setup a inotifywait that listens to cron doing a touch command and then triggering the python script from there....</p>
  
  <pre><code>#!/usr/bin/env bash
  
  inotifywait -mr -e ATTRIB * |
  
  while read dir ev file;
  do
     python boxclient.py -U email@address.com -td -Pd moremusic/youtube;
  done;
  </code></pre>
  
  <p>And all those ways give me this error which I'm lost on:</p>
  
  <pre><code>Traceback (most recent call last):
    File "boxclient.py", line 224, in &lt;module&gt;
      sys.exit(main())
    File "boxclient.py", line 190, in main
      (parser, options, args) = parse_args(argv)
    File "boxclient.py", line 80, in parse_args
      return (parser, options, decode_args(args, options))
    File "/home/yt/pybox/pybox/utils.py", line 134, in decode_args
      setattr(options, attr, value.decode(ENCODING))
  TypeError: decode() argument 1 must be string, not None
  </code></pre>
  
  <p>everything runs fine when I run the python and the bash script on the cl.</p>