Page MenuHomePhabricator

Error messages aren't printed
Closed, ResolvedPublic

Description

The argumet givent to pywikibot.exceptions exceptions aren't printed. Sample:

import pwb
import pywikibot
from pywikibot.exceptions import *
raise Error('foo')

Traceback (most recent call last):

File "<pyshell#3>", line 1, in <module>
  raise Error('foo')

Error

raise Error('foo %s' %'bar')

Traceback (most recent call last):

File "<pyshell#4>", line 1, in <module>
  raise Error('foo %s' %'bar')

Error

raise NoPage('Pagename')

Traceback (most recent call last):

File "<pyshell#5>", line 1, in <module>
  raise NoPage('Pagename')

NoPage


Version: core-(2.0)
Severity: major

Details

Reference
bz66012

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:23 AM
bzimport set Reference to bz66012.

Reorder objects Error class is derived from seems to work:

class Error(Exception, UnicodeMixin):
...

import pwb
import pywikibot
from pywikibot.exceptions import *
raise Error('foo')

Traceback (most recent call last):

File "<pyshell#50>", line 1, in <module>
  raise Error('foo')

Error: foo

Change 136719 had a related patch set uploaded by Xqt:
(bug 66012) Reorder inheritance of Error class

https://gerrit.wikimedia.org/r/136719

Change 136719 merged by jenkins-bot:
(bug 66012) Reorder inheritance of Error class

https://gerrit.wikimedia.org/r/136719

Thanks for fixing this so quickly, xqt!