[New-bugs-announce] [issue33700] [doc] Old version picker don't understand language tags in URL

Julien Palard report at bugs.python.org
Wed May 30 17:44:23 EDT 2018


New submission from Julien Palard <julien+python at palard.fr>:

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 https://docs.python.org/fr/3.5/library/__main__.html 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.


[1]: https://docs.python.org/fr/3.5/_static/version_switch.js

----------
assignee: mdk
components: Documentation
messages: 318210
nosy: mdk
priority: low
severity: normal
stage: needs patch
status: open
title: [doc] Old version picker don't understand language tags in URL
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33700>
_______________________________________


More information about the New-bugs-announce mailing list