This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: cgi.__all__ is incomplete
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Unit03, martin.panter, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2016-05-24 20:26 by Unit03, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
cgi_all.patch Unit03, 2016-05-24 20:26 review
Messages (10)
msg266265 - (view) Author: Jacek Kołodziej (Unit03) * Date: 2016-05-24 20:26
That's a child issue of #23883, created to propose a patch fixing cgi module's __all__ list.
msg266303 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-05-25 05:38
I don't think test() should be exposed as public API.
msg266308 - (view) Author: Jacek Kołodziej (Unit03) * Date: 2016-05-25 06:17
Well, but it is documented in public docs:

    cgi.test()

    Robust test CGI script, usable as main program. Writes minimal HTTP headers and formats all information provided to the script in HTML form.


Should I remove it from __all__ and probably from the docs, too?
msg266331 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-05-25 11:40
I don’t see why test() should be a special case. A few of the other functions seem to be just for debugging and testing too, e.g. print_environ().

Is there any advantage to having the test case in a separate MiscTestCase class, as opposed to the existing CgiTests class?
msg266332 - (view) Author: Jacek Kołodziej (Unit03) * Date: 2016-05-25 11:47
Martin:

> Is there any advantage to having the test case in a separate MiscTestCase class, as opposed to the existing CgiTests class?

Other than "the first test [well, that I know of] for __all__ list was in separate class called MiscTestCase so each next one follows the same fashion" and "sometimes such test would fit into some existing TestCase class and sometimes not, so let's always put it into separate class for cohesion" - no, I don't see any.
msg266337 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-05-25 12:25
OK. This is unusual name for public function and looks rather as internal function for manual module testing, but since it is documented, we perhaps should add its name to __all__. The patch LGTM.
msg266581 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-05-29 00:20
For this particular case, there is only one existing test class called CgiTests, without any special setup or handling. It seems too arbitrary to have a second class called MiscTestCase, so I would prefer the new test be added to CgiTests.
msg267508 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-06-06 02:30
New changeset 74ed6f3fb8d2 by Martin Panter in branch 'default':
Issue #27105: Add cgi.test() to __all__, based on Jacek Kołodziej’s patch
https://hg.python.org/cpython/rev/74ed6f3fb8d2
msg267514 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-06-06 02:58
Thanks for the patches Jacek. This one I committed after moving the test into CgiTests.
msg267639 - (view) Author: Jacek Kołodziej (Unit03) * Date: 2016-06-07 12:05
Thank you, Martin. :)
History
Date User Action Args
2022-04-11 14:58:31adminsetgithub: 71292
2016-06-07 12:05:28Unit03setmessages: + msg267639
2016-06-06 02:58:59martin.pantersetstatus: open -> closed
resolution: fixed
messages: + msg267514

stage: patch review -> resolved
2016-06-06 02:30:53python-devsetnosy: + python-dev
messages: + msg267508
2016-05-29 00:20:39martin.pantersetmessages: + msg266581
2016-05-25 13:16:53martin.panterlinkissue23883 dependencies
2016-05-25 12:25:33serhiy.storchakasetmessages: + msg266337
2016-05-25 11:47:29Unit03setmessages: + msg266332
2016-05-25 11:40:08martin.pantersetnosy: + martin.panter

messages: + msg266331
stage: patch review
2016-05-25 06:17:21Unit03setmessages: + msg266308
2016-05-25 05:38:23serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg266303
2016-05-24 20:26:15Unit03create