From b8389a9112436489a84d59ad76cef43b9a9908bb Mon Sep 17 00:00:00 2001 From: nojhan Date: Sun, 27 Sep 2015 20:34:59 +0200 Subject: [PATCH] bugfix: create a message for 403 errors When handling a BrowserForbidden error, the msg variable was not initialized, thus leading to a reference before assignement error. --- weboob/tools/application/console.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/weboob/tools/application/console.py b/weboob/tools/application/console.py index f14a3f9f..e06de5b5 100644 --- a/weboob/tools/application/console.py +++ b/weboob/tools/application/console.py @@ -569,6 +569,9 @@ class ConsoleApplication(Application): elif isinstance(error, BrowserSSLError): print(u'FATAL(%s): ' % backend.name + self.BOLD + '/!\ SERVER CERTIFICATE IS INVALID /!\\' + self.NC, file=self.stderr) elif isinstance(error, BrowserForbidden): + msg = unicode(error) + if not msg: + msg = 'access denied' print(u'Error(%s): %s' % (backend.name, msg or 'Forbidden'), file=self.stderr) elif isinstance(error, BrowserUnavailable): msg = unicode(error)