classification
Title: Pydoc doesn't escape parameter defaults in html
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: georg.brandl, larry, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2014-02-17 17:08 by serhiy.storchaka, last changed 2014-11-17 21:57 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
pydoc_escape_argspec.patch serhiy.storchaka, 2014-11-17 21:09 review
Messages (5)
msg211426 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-02-17 17:08
Pydoc doesn't escape parameter defaults in generated html files. For example for the socket.__init__() method in the socket module following html code is generated:

<dl><dt><a name="socket-__init__"><strong>__init__</strong></a>(self, family=<AddressFamily.AF_INET: 2>, type=<SocketType.SOCK_STREAM: 1>, proto=0, fileno=None)</dt></dl>

As result <AddressFamily.AF_INET: 2> and <SocketType.SOCK_STREAM: 1> aren't visible in browser (they are illegal html tags).
msg231294 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-11-17 21:09
Here is a patch which fixes this issue. Html formatting was broken by issue19674.
msg231295 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2014-11-17 21:13
LGTM
msg231301 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-11-17 21:51
New changeset cf2e424e0413 by Serhiy Storchaka in branch '3.4':
Issue #20662: Argspec now is escaped in html output of pydoc.
https://hg.python.org/cpython/rev/cf2e424e0413

New changeset 1855b5c3da61 by Serhiy Storchaka in branch 'default':
Issue #20662: Argspec now is escaped in html output of pydoc.
https://hg.python.org/cpython/rev/1855b5c3da61
msg231303 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-11-17 21:57
Thanks for the review Larry.

There is related minor issue. The formatvalue method is no longer used in HTMLDoc. This can break user code which inherits HTMLDoc and overrides formatvalue.
History
Date User Action Args
2014-11-17 21:57:56serhiy.storchakasetstatus: open -> closed
messages: + msg231303

assignee: serhiy.storchaka
resolution: fixed
stage: patch review -> resolved
2014-11-17 21:51:00python-devsetnosy: + python-dev
messages: + msg231301
2014-11-17 21:13:26larrysetmessages: + msg231295
2014-11-17 21:09:05serhiy.storchakasetfiles: + pydoc_escape_argspec.patch

versions: + Python 3.5
keywords: + patch
nosy: + larry

messages: + msg231294
stage: patch review
2014-02-17 17:08:17serhiy.storchakacreate