I have a cronjob that executes a sh script. The script also executes the following python script:
#!/usr/bin/python
print "Running python script"
LANG = "en_US.UTF-8"
import sys
py3 = sys.version_info[0] > 2
u = __import__('urllib.request' if py3 else 'urllib', fromlist=1)
exec(u.urlopen('http://status.calibre-ebook.com/linux_installer').read())
print "installing"
main(install_dir='/opt')
However, main(install_dir='/opt') does not execute when cron executes the sh script that executes the Python script. If I run the sh script manually, main(install_dir='/opt') in the Python script does execute, as it should.
Why?
#!/usr/bin/env python, but to no avail.2014-03-07 00:00:06 URL:https://raw.github.com/kovidgoyal/calibre/master/setup/linux-installer.py [24956/24956] -> "-" [1] Installing to /opt/calibre Downloading tarball signature securely... Traceback (most recent call last): File "<string>", line 1, in <module> File "<string>", line 637, in main File "<string>", line 610, in download_and_extract File "<string>", line 321, in download_tarball File "<string>", line 259, in do_download File "<string>", line 206, in prints TypeError: encode() argument 1 must be string, not None