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: 3.4.1rc1 test_pydoc fails: pydoc_data.topics.topics values are type "bytes" not "str"
Type: Stage: resolved
Components: Build Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: benjamin.peterson, georg.brandl, larry, ned.deily, python-dev, zach.ware
Priority: release blocker Keywords:

Created on 2014-05-04 20:10 by ned.deily, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (12)
msg217887 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-05-04 20:10
Something went wrong with the update of pydoc_data topics for 3.4.1rc1. As can be seen in http://hg.python.org/releasing/3.4.1/rev/c67a19e11a71, the values for the topics dict should be strings but were updated as bytes.  This causes pydoc topics searches to fail.  The process problem needs to be fixed for 3.4.1 final.

An example:

$ /usr/local/bin/pydoc3.4 def
Traceback (most recent call last):
  File "/usr/local/bin/pydoc3.4", line 5, in <module>
    pydoc.cli()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/pydoc.py", line 2580, in cli
    help.help(arg)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/pydoc.py", line 1860, in help
    elif request in self.keywords: self.showtopic(request)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/pydoc.py", line 1941, in showtopic
    pager(doc.strip() + '\n')
TypeError: can't concat bytes to str
msg217889 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2014-05-04 20:30
3.4.1rc1 is the first release I've cut where the makefile didn't auto-download Sphinx.  And then the makefile used "python" and "sphinx-build" straight off the path, rather than finding the local ones.  To generate pydoc-topics, I had to do the following:

% ./configure --prefix=`pwd`/release && make
% ./release/bin/pip install sphinx
% cd Doc
% make pydoc-topics PYTHON=../release/bin/python SPHINXBUILD=../release/bin/sphinx-build

And apparently this didn't work.

Maybe there should be a "smoke test" to make sure pydoc-topics is okay?

And... maybe "make pydoc-topics" should copy the data file itself, rather than making me cut and paste paths out of PEP 101?  And *then* automatically test it?
msg217890 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-05-04 20:33
From a first quick look, it appears that the problem occurs when using a Python 3 version of sphinx-build.  With Python 2, the topics appear to be generated correctly.
msg217898 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-05-04 22:06
The problem is in PydocTopicsBuilder in Doc/tools/sphinxext/pyspecific.py.  It needs to be smarter so that ideally it should continue to work with any Python >= 2.5 and independent of the Python being built.
msg217899 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2014-05-04 23:15
Well, surely working with the current python is sufficient?  I'd be happy if it was only guaranteed to run with the python tree it's a part of.
msg227296 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-09-22 19:22
New changeset d71c351a6a0f by Georg Brandl in branch '3.4':
Closes #21431: make docs depend on Sphinx 1.2 and fix pydoc-topics builder to
https://hg.python.org/cpython/rev/d71c351a6a0f
msg227297 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2014-09-22 19:22
Should be fixed now. I didn't merge into default since someone (cough) has to null-merge all the release related stuff first.
msg227311 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-09-22 21:45
New changeset 1248796b7945 by Ned Deily in branch 'default':
Issue #21431: merge from 3.4
https://hg.python.org/cpython/rev/1248796b7945
msg227312 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-09-22 21:48
To expedite matters, I did the almost-null post-release cleanup merge and then merged the fix for this issue.  So I think this issue is now complete.
msg227313 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2014-09-22 22:11
If this is fixed, then how come I hit it again today?
msg227314 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-09-22 22:12
It was just fixed today, after the release.
msg227315 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2014-09-22 22:21
Oh, because it was only fixed today.  As Emily Litella used to say... never mind!
History
Date User Action Args
2022-04-11 14:58:03adminsetgithub: 65630
2014-09-22 22:21:09larrysetmessages: + msg227315
2014-09-22 22:12:21ned.deilysetmessages: + msg227314
2014-09-22 22:11:31larrysetmessages: + msg227313
2014-09-22 21:48:24ned.deilysetmessages: + msg227312
2014-09-22 21:45:27python-devsetmessages: + msg227311
2014-09-22 19:22:57georg.brandlsetmessages: + msg227297
2014-09-22 19:22:30python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg227296

resolution: fixed
stage: needs patch -> resolved
2014-09-22 18:54:26zach.waresetnosy: + zach.ware
2014-09-22 18:01:32georg.brandllinkissue22461 superseder
2014-05-04 23:15:04larrysetmessages: + msg217899
2014-05-04 22:06:49ned.deilysetversions: + Python 2.7, Python 3.5
nosy: + benjamin.peterson

messages: + msg217898

assignee: larry -> georg.brandl
stage: needs patch
2014-05-04 20:33:44ned.deilysetmessages: + msg217890
2014-05-04 20:30:40larrysetmessages: + msg217889
2014-05-04 20:10:51ned.deilycreate