Yurttas/PL/SL/python/docs/core-python-programming/doc/152/lib/node213.html

From ZCubes Wiki
Revision as of 18:40, 7 November 2013 by MassBot1 (talk | contribs) (Created page with "<div class="navigation"> {| width="100%" cellspacing="2" align="center" | yurttas/PL/SL/python/docs/core-python-programming/doc/152/lib/module-urllib.html|[[Image:yurtt...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

11.1.9 Common problems and solutions

  • Most HTTP servers buffer the output from CGI scripts until the script is completed. This means that it is not possible to display a progress report on the client's display while the script is running.
  • Check the installation instructions above.
  • Check the HTTP server's log files. ("tail -f logfile" in a separate window may be useful!)
  • Always check a script for syntax errors first, by doing something like "python script.py".
  • When using any of the debugging techniques, don't forget to add "import sys" to the top of the script.
  • When invoking external programs, make sure they can be found. Usually, this means using absolute path names -- $PATH is usually not set to a very useful value in a CGI script.
  • When reading or writing external files, make sure they can be read or written by every user on the system.
  • Don't try to give a CGI script a set-uid mode. This doesn't work on most systems, and is a security liability as well.

Send comments on this document to python-docs@python.org.