Modify

Ticket #613 (closed defect: fixed)

Opened 20 months ago

Last modified 19 months ago

String exceptions not supported in Python >= 2.6

Reported by: joss@… Owned by: quinox
Priority: normal Milestone: Release 1.2.16
Component: nicotine Version: 1.2.15
Keywords: Cc:

Description

Hi, nicotine+ uses string exceptions which have been deprecated for some time and no longer work with python 2.6:

$ 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

The affected code is in pynicotine/config.py, lines 750 and 754:

749	                        if os.path.exists(filename):
750	                                raise "File %s exists" % filename
751	                        import tarfile
752	                        tar = tarfile.open(filename, "w:bz2")
753	                        if not os.path.exists(self.filename):
754	                                raise "Config file missing"

Attachments

Change History

comment:1 Changed 20 months ago by quinox

thanks for the report! fixed with r1416

comment:2 Changed 19 months ago by quinox

  • Status changed from new to closed
  • Resolution set to fixed
View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.