Synopsis and string exceptions

Carl Chenet <[email protected]> Wed, 23 Jun 2010 23:47:24 +0200
Newsgroups gmane.comp.documentation.synopsis
Message-ID <1277329644.21372.45.camel@bureau>
Hi !

I'm the Debian maintainer of the Synopsis package.

One of the changes brought by Python 2.6 is the removal of string
exceptions, so they won't work in Python 2.6 (just a side note: they
were also buggy before, since they were not guaranteed to work
reliable even in <2.6); as an example:

$ python2.5 -c "raise 'eggs'"
-c:1: DeprecationWarning: raising a string exception is deprecated
Traceback (most recent call last):
  File "<string>", line 1, in <module>
eggs

$ python2.6 -c "raise 'eggs'"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: exceptions must be old-style classes or derived from
BaseException, not str

Since 2.6 is the planned default version for the upcoming new Debian
stable release, Synopsis could be impacted by this issue.

The issues are here :

string-literal-exception /usr/lib/synopsis/Synopsis/Parsers/Python/SXRGenerator.py:147
string-literal-exception /usr/lib/synopsis/Synopsis/Parsers/Python/SXRGenerator.py:156

I could patch myself but I'd prefer these patches to be upstream :)

Bye,
-- 
Carl Chenet

Blog: http://carlchenet.wordpress.com
Identi.ca: http://identi.ca/carlchenet