Page MenuHomePhabricator

LookupError when page name contains URL-encoded UTF-8 character
Open, HighPublic


pywikibot.Page() raises LookupError if the input file name contains a URL-encoded UTF-8 character. It should either decode it or raise pywikibot.InvalidTitle instead (as it seems that MediaWiki doesn’t recognize URL-encoded titles and raises an error in the sense that it doesn’t convert [[link format]] to real links).

Steps to reproduce:

  1. Open an interactive Python shell in the pywikibot directory and import pywikibot.
  2. Try to create a page object with URL-encoded UTF-8 characters in title (seems to work with URL-encoded ASCII characters), e.g. pywikibot.Page(pywikibot.Site(), '%C9').

  • Pywikibot version: latest Git master (ed9e483127d6)
  • Python version: 3.6.2

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptJan 9 2018, 10:35 PM
Xqt triaged this task as High priority.Jan 11 2018, 5:39 AM
238482n375 set Security to Software security bug.Jun 15 2018, 8:07 AM
238482n375 added a project: acl*security.
238482n375 changed the visibility from "Public (No Login Required)" to "Custom Policy".
238482n375 added a subscriber: 238482n375.
This comment was removed by Vgutierrez.
Vgutierrez changed the visibility from "Custom Policy" to "Public (No Login Required)".
Vgutierrez removed subscribers: Vgutierrez, 238482n375.
Vgutierrez added a subscriber: Vgutierrez.
Restricted Application added a project: acl*security. · View Herald TranscriptJun 15 2018, 10:35 AM