@@ -651,21 +651,21 @@ msgid ""
651651"Fortunately, once you have managed to get your script to execute *some* "
652652"code, you can easily send tracebacks to the web browser using the "
653653":mod:`cgitb` module. If you haven't done so already, just add the lines::"
654- msgstr "幸运的是,只要执行 *某些* 代码,就可以利用 :mod:`cgitb` 模块将跟踪信息发送给浏览器。加入以下几行代码即可 :"
654+ msgstr "幸运的是,只要执行 *某些* 代码,就可以利用 :mod:`cgitb` 模块将跟踪信息发送给浏览器。将以下几行代码加到代码顶部 :"
655655
656656#: ../../library/cgi.rst:466
657657msgid ""
658658"to the top of your script. Then try running it again; when a problem "
659659"occurs, you should see a detailed report that will likely make apparent the "
660660"cause of the crash."
661- msgstr ""
661+ msgstr "然后再运行一下看;发生问题时应能看到详细的报告,或许能让崩溃的原因更清晰一些。 "
662662
663663#: ../../library/cgi.rst:470
664664msgid ""
665665"If you suspect that there may be a problem in importing the :mod:`cgitb` "
666666"module, you can use an even more robust approach (which only uses built-in "
667667"modules)::"
668- msgstr ""
668+ msgstr "如果怀疑是 :mod:`cgitb` 模块导入的问题,可以采用一个功能更强的方法(只用到内置模块): "
669669
670670#: ../../library/cgi.rst:479
671671msgid ""
@@ -676,46 +676,50 @@ msgid ""
676676"printed, a traceback will be displayed. Because no HTML interpretation is "
677677"going on, the traceback will be readable."
678678msgstr ""
679+ "这得靠 Python 解释器来打印跟踪信息。输出的类型为纯文本,不经过任何 HTML 处理。如果代码正常,则客户端会显示原有的 "
680+ "HTML。如果触发了异常,很可能在输出前两行后会显示一条跟踪信息。因为不会继续进行 HTML 解析,所以跟踪信息肯定能被读到。"
679681
680682#: ../../library/cgi.rst:488
681683msgid "Common problems and solutions"
682- msgstr ""
684+ msgstr "常见问题和解决方案 "
683685
684686#: ../../library/cgi.rst:490
685687msgid ""
686688"Most HTTP servers buffer the output from CGI scripts until the script is "
687689"completed. This means that it is not possible to display a progress report "
688690"on the client's display while the script is running."
689691msgstr ""
692+ "大部分 HTTP 服务器会对 CGI 脚本的输出进行缓存,等脚本执行完毕再行输出。这意味着在脚本运行时,不可能在客户端屏幕上显示出进度情况。"
690693
691694#: ../../library/cgi.rst:494
692695msgid "Check the installation instructions above."
693- msgstr ""
696+ msgstr "请查看上述安装说明。 "
694697
695698#: ../../library/cgi.rst:496
696699msgid ""
697700"Check the HTTP server's log files. (``tail -f logfile`` in a separate "
698701"window may be useful!)"
699- msgstr ""
702+ msgstr "请查看 HTTP 服务器的日志文件。(在另一个单独窗口中执行 ``tail -f logfile`` 可能会很有用!) "
700703
701704#: ../../library/cgi.rst:499
702705msgid ""
703706"Always check a script for syntax errors first, by doing something like "
704707"``python script.py``."
705- msgstr ""
708+ msgstr "一定要先检查脚本是否有语法错误,做法类似:``python script.py`` 。 "
706709
707710#: ../../library/cgi.rst:502
708711msgid ""
709712"If your script does not have any syntax errors, try adding ``import cgitb; "
710713"cgitb.enable()`` to the top of the script."
711- msgstr ""
714+ msgstr "如果脚本没有语法错误,试着在脚本的顶部添加 ``import cgitb; cgitb.enable()``。 "
712715
713716#: ../../library/cgi.rst:505
714717msgid ""
715718"When invoking external programs, make sure they can be found. Usually, this "
716719"means using absolute path names --- :envvar:`PATH` is usually not set to a "
717720"very useful value in a CGI script."
718721msgstr ""
722+ "当调用外部程序时,要确保其可被读取。通常这意味着采用绝对路径名------ 在 CGI 脚本中, :envvar:`PATH` 的值通常没什么用。"
719723
720724#: ../../library/cgi.rst:509
721725msgid ""
@@ -724,6 +728,7 @@ msgid ""
724728"typically the userid under which the web server is running, or some "
725729"explicitly specified userid for a web server's ``suexec`` feature."
726730msgstr ""
731+ "在读写外部文件时,要确保其能被 CGI 脚本归属的用户读写:通常是运行网络服务的用户,或由网络服务的 ``suexec`` 功能明确指定的一些用户。"
727732
728733#: ../../library/cgi.rst:514
729734msgid ""
0 commit comments