https://bugzilla.wikimedia.org/show_bug.cgi?id=73124

John Mark Vandenberg <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|additional space causes     |additional space in
                   |crash                       |langlinks data causes crash

--- Comment #2 from John Mark Vandenberg <[email protected]> ---
API langlinks data retains the space.

https://en.wikipedia.org/w/api.php?action=query&prop=langlinks&titles=User:John%20Vandenberg/test

{
    "query": {
        "pages": {
            "40071800": {
                "pageid": 40071800,
                "ns": 2,
                "title": "User:John Vandenberg/test",
                "langlinks": [
                    {
                        "lang": "fr",
                        "*": "Cat\u00e9gorie: Pantonyme"
                    }
                ]
            }
        }
    }
}

api.py update_page uses pywikibot.Link.langlinkUnsafe to create a Link object,
and that doesnt remove spaces.

>>> s = pywikibot.Site()
>>> l = pywikibot.Link.langlinkUnsafe('fr', 'Catégorie: Pantonyme', source=s)
>>> l.title
' Pantonyme'

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to