Ticket #1945 (closed bug: fixed)

Opened 20 months ago

Last modified 18 months ago

Mutable default argument in deluge.ui.client.DaemonSSLProxy.__init__

Reported by: Simon Owned by: Cas
Priority: trivial Milestone: 1.4.0
Component: gtkui Version: master (git branch)
Keywords: Cc:

Description

Hi,

When looking at the source code I saw that DaemonSSLProxy.init have a mutable default parameter value:  http://git.deluge-torrent.org/deluge/tree/deluge/ui/client.py#n269

This may be the source of bugs as explained here:

 http://effbot.org/zone/default-values.htm#valid-uses-for-mutable-defaults

It may be intentional, but I am not sure as I am not familiar with the code. If it is intentional, a comment should be added to say so. Otherwise, the method should be changed to look like this:

    def __init__(self, event_handlers=None):
        if event_handlers is None:
            event_handlers = {}

Change History

Changed 18 months ago by Cas

  • status changed from new to accepted
  • owner set to Cas
  • milestone changed from Future to 1.3.4

Changed 18 months ago by Cas

  • milestone changed from 1.3.4 to 1.4.0

Fix committed to 1.3-stable:  3a0b6f8

Changed 18 months ago by Cas

  • status changed from accepted to closed
  • resolution set to fixed

Fix committed to master:  2a3d8ae

Note: See TracTickets for help on using tickets.