Page MenuHomePhabricator

Category, Wikipedia namespace, and unicode
Closed, DuplicatePublic

Description

pywikibot-core$ python pwb.py category move -from:"Wikipédia:suppression immédiate" -to:"Wikipédia:Suppression immédiate"
Traceback (most recent call last):
  File "pwb.py", line 262, in <module>
    if not main():
  File "pwb.py", line 255, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "pwb.py", line 121, in run_python_file
    main_mod.__dict__)
  File "./scripts/category.py", line 1294, in <module>
    main()
  File "./scripts/category.py", line 1255, in main
    keep_sortkey=keep_sortkey)
  File "pywikibot/tools/__init__.py", line 1458, in wrapper
    return obj(*__args, **__kw)
  File "./scripts/category.py", line 458, in __init__
    self.oldcat = self._makecat(oldcat)
  File "./scripts/category.py", line 752, in _makecat
    var = pywikibot.Category(self.site, var)
  File "pywikibot/tools/__init__.py", line 1458, in wrapper
    return obj(*__args, **__kw)
  File "pywikibot/page.py", line 2699, in __init__
    % title)
ValueError: <exception str() failed>
<type 'exceptions.ValueError'>
CRITICAL: Closing network session.

It looks like the namespace detection doesn't like unicodes, it sucks only with accents before the :

Event Timeline

It works with other prefixes than Wikipédia... Why ?

This fail too. The problem is independent to category.py

import pywikibot
print(pywikibot.Category(pywikibot.Site(), "Wikipédia:suppression immédiate"))
Framawiki renamed this task from Namespace detection and unicode to Category, Wikipedia namespace, and unicode.Jul 27 2017, 10:45 PM

@Framawiki Not that it should be like this, but could you try including the Catégorie: prefix in -to and -from parameters?

$python pwb.py category move -from:"Catégorie:Wikipédia:suppression immédiate" -to:"Catégorie:Wikipédia:Suppression immédiate"

@Framawiki Not that it should be like this, but could you try including the Catégorie: prefix in -to and -from parameters?

$python pwb.py category move -from:"Catégorie:Wikipédia:suppression immédiate" -to:"Catégorie:Wikipédia:Suppression immédiate"

It works, thanks