Page MenuHomePhabricator

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

Description

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