Title: [doc] Old version picker don't understand language tags in URL
Type: Stage: resolved
Components: Documentation Versions: Python 3.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: mdk Nosy List: larry, mdk, ned.deily
Priority: low Keywords: patch

Created on 2018-05-30 21:44 by mdk, last changed 2018-07-02 19:57 by larry. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 8048 merged mdk, 2018-07-02 13:08
Messages (6)
msg318210 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2018-05-30 21:44
In the old version picker used back in 3.5 [1], the function patch_url was patching using the following regex:

    var url_re = /\.org\/(\d|py3k|dev|((release\/)?\d\.\d[\w\d\.]*))\//,

which does not expects a language tag.

This means, for example, that being on and switching to 3.6 will fail (but the reverse will succeed as the implementation of the switcher in 3.6 understands the language tag).

I see two potential fixes:

- Fix in the 3.5 branch which is not allowed as the branch is in "security only" mode.
- Add a rule, nginx-side, to fix the misconstructed URLS (looking like /3.6/fr/3.5/library/...) redirectin g them to the right place.

Other ideas and feedback welcome.

msg318212 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2018-05-30 21:48
3rd possibility, docsbuild-scripts could also apply a patch during the doc compilation.
msg318214 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-05-30 22:06
> Fix in the 3.5 branch which is not allowed as the branch is in "security only" mode.

I think you could appeal to the 3.5 Release Manager that this should go in.  Since the 3.5 docs are only rebuilt manually these days (I think), in the worst case the current 3.5 on-line docs would not reflect the change until the next 3.5.x security release.
msg318262 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2018-05-31 06:59
Hi Larry, bringing you in, I'd like your word on this.
msg320736 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2018-06-29 20:06
Doc fixes are generally okay in security-fixes-only branches.  Obviously I'd want to review it before it went in; it sounds like a simple change (one line change to an RE?), so you can send me a PR or just post it here if you want a pre-review.
msg320909 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2018-07-02 19:56
New changeset 1b141b9553424971639bde281feb1d4e4e586dbe by larryhastings (Julien Palard) in branch '3.5':
Doc: Backport language switcher (bpo-33700, bpo-31045) (#8048)
Date User Action Args
2018-07-02 19:57:09larrysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-07-02 19:56:30larrysetmessages: + msg320909
2018-07-02 13:08:29mdksetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request7657
2018-06-29 20:06:39larrysetmessages: + msg320736
2018-05-31 06:59:50mdksetnosy: + larry
messages: + msg318262
2018-05-30 22:06:16ned.deilysetnosy: + ned.deily
messages: + msg318214
2018-05-30 21:48:52mdksetmessages: + msg318212
2018-05-30 21:44:23mdkcreate