Just a try: what happens for
pywikibot.output(page.get())
instead of print?


2013/7/28 Adrián Chaves Fernández <adriyetichaves@gmail.com>
I have written the following script:


# -*- coding: utf-8  -*-

import pywikibot

site = pywikibot.Site("gl", "wiktionary")
page = pywikibot.Page(site, u"𐌰𐌽𐌳𐌰𐌿𐍂𐌰")
print page.get()


It fails with the following output:


[gallaecio@afonso fontes]$ python2 test.py
Traceback (most recent call last):
  File "test.py", line 7, in <module>
    print page.get()
  File "/usr/lib/python2.7/site-packages/pywikibot/__init__.py", line 249, in wrapper
    return method(*__args, **__kw)
  File "/usr/lib/python2.7/site-packages/pywikibot/__init__.py", line 249, in wrapper
    return method(*__args, **__kw)
  File "/usr/lib/python2.7/site-packages/pywikibot/page.py", line 278, in get
    self._getInternals(sysop)
  File "/usr/lib/python2.7/site-packages/pywikibot/page.py", line 302, in _getInternals
    self.site.loadrevisions(self, getText=True, sysop=sysop)
  File "/usr/lib/python2.7/site-packages/pywikibot/page.py", line 96, in site
    return self._link.site
  File "/usr/lib/python2.7/site-packages/pywikibot/page.py", line 3080, in site
    self.parse()
  File "/usr/lib/python2.7/site-packages/pywikibot/page.py", line 3037, in parse
    u"contains illegal char(s) '%s'" % m.group(0))
pywikibot.exceptions.InvalidTitle: contains illegal char(s) '𐌰'




_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l



--
Bináris