jayvdb created this task.
jayvdb added subscribers: jayvdb, XZise, Malafaya.
jayvdb added projects: pywikibot-core, Pywikibot-textlib.py.
Herald added subscribers: pywikibot-bugs-list, Aklapper.
TASK DESCRIPTION
There is a very unusual scenario where `textlib.removeLanguageLinks` will not
remove obsolete interlanguage links.
`removeLanguageLinks` includes:
```
if not site.validLanguageLinks():
return text
...
languages = '|'.join(site.validLanguageLinks() +
list(site.family.obsolete.keys()))
```
As it exits early if `site.validLanguageLinks()` doesnt return a value, the
current algorithm for `site.validLanguageLinks()` is:
```
nsnames = [name for name in self.namespaces.values()]
return [lang for lang in self.languages()
if first_upper(lang) not in nsnames]
```
The scenario which does not work is:
1. A wiki family called `foo` has two codes: 'en', and 'de' , with the
interwikimap set up so that `en` is the English language site and `de` is the
German language site, linked together.
2. The wiki community decides two wikis is duplicated effort, so they merge
the wikis into a multilingual wiki. The `de` site is retired, all content is
copied to the `en` site, and the sysadmin deletes `de` from the interwikimap of
`en`.
3. A bot operator creates a `Family` mapping `obsolete` with `de` and `en`,
and puts in `langs` new site `foo`, because it is multilingual site.
4. The bots running on `foo` are supposed to remove all 'de' interlanguage
links from the `foo` (was `en`) site. This does not happen, because 'Foo' is
the name of the `Project` namespace.
The workaround to this is the Family needs to use a non-namespace code (e.g.
`en` ), until the `de` interlanguage links are removed, and then change the
code from `en` to `foo` after all internal language links to `de` have been
removed.
Or, we can fix the bug ;-)
TASK DETAIL
https://phabricator.wikimedia.org/T112256
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: jayvdb
Cc: Malafaya, Aklapper, XZise, jayvdb, pywikibot-bugs-list
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs