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.
Created on 2017年08月09日 11:38 by mdk, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 3039 | merged | python-dev, 2017年08月09日 11:53 | |
| PR 3051 | merged | python-dev, 2017年08月10日 14:15 | |
| PR 3081 | merged | python-dev, 2017年08月13日 10:33 | |
| Messages (6) | |||
|---|---|---|---|
| msg299990 - (view) | Author: Julien Palard (mdk) * (Python committer) | Date: 2017年08月09日 11:38 | |
Since ja has been added to the language switch, a bug appeared and in some case the switch won't ... switch.
Due to a regex bug in switchers.js, a needed trailing slash is sometimes not matched. It has not been detected previously as it can happen only when there more than two languages in the picker which is now the case.
Bug is in: var language_regexp = '\.org/(' + Object.keys(all_languages).join('|') + '/)';
It only matches the trailing slash for the last language, currently the / is for ja, so fr does no longer match the needed slash.
Fix may consists in adding a non-matching group around the join.
But there's another issue when a user goes to a version in which there's a language picker but the current langage is not known by the picker, typically if a user is on /ja/2.7/ but the language picker with Japanese has only been merged on 3.6 and 3.7: the regex on /ja/2.7 will not contain "ja", so it will not be able to match it.
So we should write this regex otherwise, I grepped on the server logs and checked on the filesystem, this one should work better and still be safe:
var language_regexp = '\.org/([a-z]{2}(?:-[a-z]{2})?/)';
|
|||
| msg300016 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年08月09日 15:01 | |
New changeset 122081deef86174beee965be1207fa46ea23533d by Victor Stinner (Julien Palard) in branch 'master': bpo-31159: fix language switch regex on unknown yet built languages. (#3039) https://github.com/python/cpython/commit/122081deef86174beee965be1207fa46ea23533d |
|||
| msg300056 - (view) | Author: Julien Palard (mdk) * (Python committer) | Date: 2017年08月10日 07:26 | |
Now works in 3.7, needs backports to 3.6 and 2.7. |
|||
| msg300095 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年08月10日 14:54 | |
New changeset e8e7fba0b24582959feca9c31f2a72fc0251f83d by Victor Stinner (Julien Palard) in branch '3.6': bpo-31159: fix language switch regex on unknown yet built languages. ... (#3051) https://github.com/python/cpython/commit/e8e7fba0b24582959feca9c31f2a72fc0251f83d |
|||
| msg300232 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年08月13日 21:44 | |
New changeset fe8d9dc479a96ef490034107e7d4a6228b4be140 by Victor Stinner (Julien Palard) in branch '2.7': bpo-31159: fix language switch regex on unknown yet built languages. ... (#3051) (#3081) https://github.com/python/cpython/commit/fe8d9dc479a96ef490034107e7d4a6228b4be140 |
|||
| msg300233 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年08月13日 21:48 | |
To choose the langague, see what Wikipedia does: Wikipedia EN displays "Français", no? |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:49 | admin | set | github: 75342 |
| 2017年09月23日 16:36:28 | mdk | set | status: open -> closed stage: resolved |
| 2017年08月13日 21:48:21 | vstinner | set | messages: + msg300233 |
| 2017年08月13日 21:44:54 | vstinner | set | messages: + msg300232 |
| 2017年08月13日 10:33:36 | python-dev | set | pull_requests: + pull_request3123 |
| 2017年08月10日 14:54:29 | vstinner | set | messages: + msg300095 |
| 2017年08月10日 14:15:44 | python-dev | set | pull_requests: + pull_request3098 |
| 2017年08月10日 07:26:13 | mdk | set | messages: + msg300056 |
| 2017年08月09日 15:01:18 | vstinner | set | nosy:
+ vstinner messages: + msg300016 |
| 2017年08月09日 11:53:46 | python-dev | set | pull_requests: + pull_request3072 |
| 2017年08月09日 11:38:46 | mdk | create | |