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: searchindex.js is annoying
Type: behavior Stage:
Components: Documentation Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, georg.brandl, lemburg, martin.panter, pitrou, r.david.murray, serhiy.storchaka
Priority: normal Keywords:

Created on 2015-03-08 19:36 by pitrou, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (11)
msg237557 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2015-03-08 19:36
Since I get hit by this at least once a week, I thought I'd finally report a bug. The Doc/build/html/searchindex.js file is extremely annoying when grepping through the source tree (and especially when grepping in the docs), because it's very likely to match your search *and* it seems made of a huge single line of text, meaning the grep output now fills your terminal with junk.
msg237560 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2015-03-08 19:50
And what do you suggest to do about it?
msg237561 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2015-03-08 19:50
That's a good question :) Making it a normal multiline file would be good enough.
msg237562 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2015-03-08 19:54
Well, that's not useful in a generated file.  I propose you exclude the doc build tree from your search, or use a grepping tool like ag that ignores files ignored by the vcs.
msg237563 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2015-03-08 19:57
> Well, that's not useful in a generated file.

Well, here's a case where it's useful... Asking me to change tools is quite obvious and quite pointless at the same time. How about we respond to all Windows-specific issues with "switch to Linux"?
msg237564 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2015-03-08 20:03
> How about we respond to all Windows-specific issues with "switch to Linux"?

How about we don't respond to strawman arguments?
msg237565 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2015-03-08 20:06
On 08.03.2015 20:57, Antoine Pitrou wrote:
> 
> Antoine Pitrou added the comment:
> 
>> Well, that's not useful in a generated file.
> 
> Well, here's a case where it's useful... Asking me to change tools is quite obvious and quite pointless at the same time. How about we respond to all Windows-specific issues with "switch to Linux"?

Georg suggested excluding the file from your search. That's a very
reasonable answer.

You don't have to change your tools for this,
just configure them to not look in .js files or perhaps not look
in this particular file if it returns false positives for you.

I'd suggest to close this as "wont fix".
msg237576 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-03-08 22:27
Lib/pydoc_data/topics.py was extremely annoying to me for the same reason. I even didn't know about Doc/build/html/searchindex.js because it has different extension. Finally I had written few scripts like:

$ cat ~/bin/findpy
#!/bin/sh
find * -name '*.py' ! -path '*Lib/pydoc_data/topics.py' ! -path '*Lib/plat-*' -exec egrep -n --color "$@" '{}' +

and similar for *.[ch] and *.rst, and forgot about this problem.
msg237582 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-03-08 22:54
My own one-liner kicking around in my Bash history that uses GNU Grep options to avoid specific files and directories:

grep -r . --exclude-dir={.git,.hg} --exclude={refcounts.dat,"*.js"} -nIwe PIPE_MAX_SIZE
msg237637 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-03-09 11:09
Martin's solution is similar to the one I use except that I made an alias for it and I also exclude topics.py.  Which is a tracked file.  It seems that what one wants to ignore is a bit of a personal decision, and so it is probably best left up to the individual to craft a solution (even though I also find it annoying :)
msg237697 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2015-03-09 19:30
Most important reason to close this: this is not something to change in Python, but would have to be changed in Sphinx.
History
Date User Action Args
2022-04-11 14:58:13adminsetgithub: 67801
2015-03-09 19:30:23georg.brandlsetstatus: open -> closed
resolution: third party
messages: + msg237697
2015-03-09 11:09:32r.david.murraysetnosy: + r.david.murray
messages: + msg237637
2015-03-08 22:54:12martin.pantersetnosy: + martin.panter
messages: + msg237582
2015-03-08 22:27:32serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg237576
2015-03-08 20:06:32lemburgsetnosy: + lemburg
messages: + msg237565
2015-03-08 20:03:51georg.brandlsetmessages: + msg237564
2015-03-08 19:57:29pitrousetmessages: + msg237563
2015-03-08 19:54:30georg.brandlsetmessages: + msg237562
2015-03-08 19:50:40pitrousetmessages: + msg237561
2015-03-08 19:50:00georg.brandlsetnosy: + georg.brandl
messages: + msg237560
2015-03-08 19:36:00pitroucreate