diff --git a/deluge/core/core.py b/deluge/core/core.py index 451b9a88d..7125a8093 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -472,7 +472,7 @@ class Core(component.Component): torrent[0], torrent[1], torrent[2], save_state=idx == last_index, ) except AddTorrentError as ex: - log.warn('Error when adding torrent: %s', ex) + log.warning('Error when adding torrent: %s', ex) errors.append(ex) defer.returnValue(errors) return task.deferLater(reactor, 0, add_torrents) @@ -578,7 +578,7 @@ class Core(component.Component): # Save the session state self.torrentmanager.save_state() if errors: - log.warn('Failed to remove %d of %d torrents.', len(errors), len(torrent_ids)) + log.warning('Failed to remove %d of %d torrents.', len(errors), len(torrent_ids)) return errors return task.deferLater(reactor, 0, do_remove_torrents) diff --git a/deluge/core/rpcserver.py b/deluge/core/rpcserver.py index ccbb03d3d..146f39c3e 100644 --- a/deluge/core/rpcserver.py +++ b/deluge/core/rpcserver.py @@ -139,7 +139,7 @@ class DelugeRPCProtocol(DelugeTransferProtocol): try: self.transfer_message(data) except Exception as ex: - log.warn('Error occurred when sending message: %s.', ex) + log.warning('Error occurred when sending message: %s.', ex) log.exception(ex) raise diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index 62e1d2508..31e28b6a0 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -762,7 +762,7 @@ class TorrentManager(component.Component): resume_data=resume_data.get(t_state.torrent_id), ) except AddTorrentError as ex: - log.warn('Error when adding torrent "%s" to session: %s', t_state.torrent_id, ex) + log.warning('Error when adding torrent "%s" to session: %s', t_state.torrent_id, ex) else: deferreds.append(d) @@ -1105,19 +1105,19 @@ class TorrentManager(component.Component): def on_alert_add_torrent(self, alert): """Alert handler for libtorrent add_torrent_alert""" if not alert.handle.is_valid(): - log.warn('Torrent handle is invalid!') + log.warning('Torrent handle is invalid!') return try: torrent_id = str(alert.handle.info_hash()) except RuntimeError as ex: - log.warn('Failed to get torrent id from handle: %s', ex) + log.warning('Failed to get torrent id from handle: %s', ex) return try: add_async_params = self.torrents_loading.pop(torrent_id) except KeyError as ex: - log.warn('Torrent id not in torrents loading list: %s', ex) + log.warning('Torrent id not in torrents loading list: %s', ex) return self.add_async_callback(alert.handle, *add_async_params) diff --git a/deluge/log.py b/deluge/log.py index fe61ff3da..ba0af4c8b 100644 --- a/deluge/log.py +++ b/deluge/log.py @@ -218,7 +218,7 @@ def tweak_logging_levels(): if not os.path.isfile(logging_config_file): return log = logging.getLogger(__name__) - log.warn( + log.warning( 'logging.conf found! tweaking logging levels from %s', logging_config_file, ) @@ -230,7 +230,7 @@ def tweak_logging_levels(): if level not in levels: continue - log.warn('Setting logger "%s" to logging level "%s"', name, level) + log.warning('Setting logger "%s" to logging level "%s"', name, level) set_logger_level(level, name) diff --git a/deluge/pluginmanagerbase.py b/deluge/pluginmanagerbase.py index 439ebf5ed..624b06b05 100644 --- a/deluge/pluginmanagerbase.py +++ b/deluge/pluginmanagerbase.py @@ -243,7 +243,7 @@ class PluginManagerBase(object): cont_lines = [] # Missing plugin info if not self.pkg_env[name]: - log.warn('Failed to retrive info for plugin: %s', name) + log.warning('Failed to retrive info for plugin: %s', name) for k in info: info[k] = 'not available' return info diff --git a/deluge/plugins/Execute/deluge/plugins/execute/core.py b/deluge/plugins/Execute/deluge/plugins/execute/core.py index 2dbf1c64d..ed35a32bf 100644 --- a/deluge/plugins/Execute/deluge/plugins/execute/core.py +++ b/deluge/plugins/Execute/deluge/plugins/execute/core.py @@ -106,11 +106,11 @@ class Core(CorePluginBase): def log_error(result, command): (stdout, stderr, exit_code) = result if exit_code: - log.warn('Command "%s" failed with exit code %d', command, exit_code) + log.warning('Command "%s" failed with exit code %d', command, exit_code) if stdout: - log.warn('stdout: %s', stdout) + log.warning('stdout: %s', stdout) if stderr: - log.warn('stderr: %s', stderr) + log.warning('stderr: %s', stderr) # Go through and execute all the commands for command in self.config['commands']: diff --git a/deluge/plugins/WebUi/deluge/plugins/webui/core.py b/deluge/plugins/WebUi/deluge/plugins/webui/core.py index 55d269cd6..72923a6f0 100644 --- a/deluge/plugins/WebUi/deluge/plugins/webui/core.py +++ b/deluge/plugins/WebUi/deluge/plugins/webui/core.py @@ -82,7 +82,7 @@ class Core(CorePluginBase): try: self.server.start() except CannotListenError as ex: - log.warn('Failed to start WebUI server: %s', ex) + log.warning('Failed to start WebUI server: %s', ex) raise return True diff --git a/deluge/transfer.py b/deluge/transfer.py index 23bf98290..c1859eb67 100644 --- a/deluge/transfer.py +++ b/deluge/transfer.py @@ -104,8 +104,8 @@ class DelugeTransferProtocol(Protocol, object): # Remove the header from the buffer self._buffer = self._buffer[MESSAGE_HEADER_SIZE:] except Exception as ex: - log.warn('Error occurred when parsing message header: %s.', ex) - log.warn('This version of Deluge cannot communicate with the sender of this data.') + log.warning('Error occurred when parsing message header: %s.', ex) + log.warning('This version of Deluge cannot communicate with the sender of this data.') self._message_length = 0 self._buffer = b'' @@ -119,7 +119,7 @@ class DelugeTransferProtocol(Protocol, object): try: self.message_received(rencode.loads(zlib.decompress(data), decode_utf8=True)) except Exception as ex: - log.warn('Failed to decompress (%d bytes) and load serialized data with rencode: %s', len(data), ex) + log.warning('Failed to decompress (%d bytes) and load serialized data with rencode: %s', len(data), ex) def get_bytes_recv(self): """ diff --git a/deluge/ui/client.py b/deluge/ui/client.py index ac9b9f99a..64db4ce06 100644 --- a/deluge/ui/client.py +++ b/deluge/ui/client.py @@ -133,7 +133,7 @@ class DelugeRPCProtocol(DelugeTransferProtocol): exception_cls = getattr(error, request[2]) exception = exception_cls(*request[3], **request[4]) except TypeError: - log.warn('Received invalid RPC_ERROR (Old daemon?): %s', request[2]) + log.warning('Received invalid RPC_ERROR (Old daemon?): %s', request[2]) return # Ideally we would chain the deferreds instead of instance @@ -188,7 +188,7 @@ class DelugeRPCProtocol(DelugeTransferProtocol): # Send the request in a tuple because multiple requests can be sent at once self.transfer_message((request.format_message(),)) except Exception as ex: - log.warn('Error occurred when sending message: %s', ex) + log.warning('Error occurred when sending message: %s', ex) class DelugeRPCClientFactory(ClientFactory): diff --git a/deluge/ui/console/cmdline/command.py b/deluge/ui/console/cmdline/command.py index 262182bfe..0b59aca7b 100644 --- a/deluge/ui/console/cmdline/command.py +++ b/deluge/ui/console/cmdline/command.py @@ -108,7 +108,7 @@ class Commander(object): return except OptionParserError as ex: import traceback - log.warn('Error parsing command "%s": %s', args, ex) + log.warning('Error parsing command "%s": %s', args, ex) self.write('{!error!} %s' % ex) parser.print_help() return diff --git a/deluge/ui/console/cmdline/commands/status.py b/deluge/ui/console/cmdline/commands/status.py index 5f6c3fe94..2f34ede95 100644 --- a/deluge/ui/console/cmdline/commands/status.py +++ b/deluge/ui/console/cmdline/commands/status.py @@ -51,7 +51,7 @@ class Command(BaseCommand): self.torrents = status def on_torrents_status_fail(reason): - log.warn('Failed to retrieve session status: %s', reason) + log.warning('Failed to retrieve session status: %s', reason) self.torrents = -2 deferreds = [] diff --git a/deluge/ui/console/modes/basemode.py b/deluge/ui/console/modes/basemode.py index a947b509d..a5e85e862 100644 --- a/deluge/ui/console/modes/basemode.py +++ b/deluge/ui/console/modes/basemode.py @@ -330,7 +330,7 @@ def move_cursor(screen, row, col): screen.move(row, col) except curses.error as ex: import traceback - log.warn( + log.warning( 'Error on screen.move(%s, %s): (curses.LINES: %s, curses.COLS: %s) Error: %s\nStack: %s', row, col, curses.LINES, curses.COLS, ex, ''.join(traceback.format_stack()), ) diff --git a/deluge/ui/console/utils/colors.py b/deluge/ui/console/utils/colors.py index ac1a50c77..3de338b1a 100644 --- a/deluge/ui/console/utils/colors.py +++ b/deluge/ui/console/utils/colors.py @@ -90,7 +90,7 @@ def init_colors(): color_pairs[(fg_name, bg_name)] = counter counter += 1 except curses.error as ex: - log.warn('Error: %s', ex) + log.warning('Error: %s', ex) return counter # Create the color_pairs dict diff --git a/deluge/ui/console/widgets/fields.py b/deluge/ui/console/widgets/fields.py index f9530c791..e5b9ece76 100644 --- a/deluge/ui/console/widgets/fields.py +++ b/deluge/ui/console/widgets/fields.py @@ -477,7 +477,7 @@ class IntSpinInput(InputField): self.cursor = cursor except TypeError: import traceback - log.warn('TypeError: %s', ''.join(traceback.format_exc())) + log.warning('TypeError: %s', ''.join(traceback.format_exc())) else: if cursor is True: self.cursor = len(self.valstr) @@ -925,7 +925,7 @@ class ComboInput(InputField): msg = c[1] break if msg is None: - log.warn('Setting value "%s" found nothing in choices: %s', val, self.choices) + log.warning('Setting value "%s" found nothing in choices: %s', val, self.choices) self.fmt_keys.update({'msg': msg}) diff --git a/deluge/ui/console/widgets/inputpane.py b/deluge/ui/console/widgets/inputpane.py index 810b72209..2aba998fd 100644 --- a/deluge/ui/console/widgets/inputpane.py +++ b/deluge/ui/console/widgets/inputpane.py @@ -87,7 +87,7 @@ class BaseInputPane(InputKeyHandler): continue if e.name == input_element.name: import traceback - log.warn( + log.warning( 'Input element with name "%s" already exists in input pane (%s):\n%s', input_element.name, e, ''.join(traceback.format_stack(limit=5)), ) diff --git a/deluge/ui/console/widgets/window.py b/deluge/ui/console/widgets/window.py index 35660ea6f..eeb0de4e5 100644 --- a/deluge/ui/console/widgets/window.py +++ b/deluge/ui/console/widgets/window.py @@ -154,7 +154,7 @@ class BaseWindow(object): self.screen.noutrefresh(pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol) except curses.error as ex: import traceback - log.warn( + log.warning( 'Error on screen.noutrefresh(%s, %s, %s, %s, %s, %s) Error: %s\nStack: %s', pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol, ex, ''.join(traceback.format_stack()), ) diff --git a/deluge/ui/gtkui/path_chooser.py b/deluge/ui/gtkui/path_chooser.py index b96958d2f..249b4c894 100644 --- a/deluge/ui/gtkui/path_chooser.py +++ b/deluge/ui/gtkui/path_chooser.py @@ -162,7 +162,7 @@ class PathChooser(PathChooserComboBox): try: self.config_key_funcs[key][1](config[key]) except TypeError as ex: - log.warn('TypeError: %s', ex) + log.warning('TypeError: %s', ex) # Set the saved paths if self.paths_config_key and self.paths_config_key in config: diff --git a/deluge/ui/gtkui/pluginmanager.py b/deluge/ui/gtkui/pluginmanager.py index 0e0797877..f1424a693 100644 --- a/deluge/ui/gtkui/pluginmanager.py +++ b/deluge/ui/gtkui/pluginmanager.py @@ -72,7 +72,7 @@ class PluginManager(deluge.pluginmanagerbase.PluginManagerBase, component.Compon try: self.enable_plugin(name) except Exception as ex: - log.warn('Failed to enable plugin "%s": ex: %s', name, ex) + log.warning('Failed to enable plugin "%s": ex: %s', name, ex) self.run_on_show_prefs() diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index ef7ac2a11..f1832f0e6 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -909,7 +909,7 @@ class Preferences(component.Component): def on_plugin_action(arg): if not value and arg is False: - log.warn('Failed to enable plugin: %s', name) + log.warning('Failed to enable plugin: %s', name) self.plugin_liststore.set_value(row, 1, False) d.addBoth(on_plugin_action) diff --git a/deluge/ui/gtkui/removetorrentdialog.py b/deluge/ui/gtkui/removetorrentdialog.py index 27faad359..c53e20f48 100644 --- a/deluge/ui/gtkui/removetorrentdialog.py +++ b/deluge/ui/gtkui/removetorrentdialog.py @@ -71,7 +71,7 @@ class RemoveTorrentDialog(object): if errors: log.info('Error(s) occured when trying to delete torrent(s).') for t_id, e_msg in errors: - log.warn('Error removing torrent %s : %s', t_id, e_msg) + log.warning('Error removing torrent %s : %s', t_id, e_msg) d = client.core.remove_torrents(self.__torrent_ids, remove_data) d.addCallback(on_removed_finished) diff --git a/deluge/ui/gtkui/torrentdetails.py b/deluge/ui/gtkui/torrentdetails.py index 6be19dffb..95544f532 100644 --- a/deluge/ui/gtkui/torrentdetails.py +++ b/deluge/ui/gtkui/torrentdetails.py @@ -74,7 +74,7 @@ class Tab(object): args = [status[key] for key in widget.status_keys] txt = widget.func(*args) except KeyError as ex: - log.warn('Unable to get status value: %s', ex) + log.warning('Unable to get status value: %s', ex) txt = '' return txt diff --git a/deluge/ui/translations_util.py b/deluge/ui/translations_util.py index e82d0cbce..cdffc3230 100644 --- a/deluge/ui/translations_util.py +++ b/deluge/ui/translations_util.py @@ -27,7 +27,7 @@ def set_dummy_trans(warn_msg=None): def _func(*txt): if warn_msg: - log.warn('"%s" has been marked for translation, but translation is unavailable.', txt[0]) + log.warning('"%s" has been marked for translation, but translation is unavailable.', txt[0]) return txt[0] builtins.__dict__['_'] = _func builtins.__dict__['ngettext'] = builtins.__dict__['_n'] = _func @@ -80,7 +80,7 @@ def set_language(lang): ro = gettext.translation('deluge', localedir=translations_path, languages=[lang]) ro.install() except IOError as ex: - log.warn('IOError when loading translations: %s', ex) + log.warning('IOError when loading translations: %s', ex) # Initialize gettext diff --git a/deluge/ui/web/json_api.py b/deluge/ui/web/json_api.py index db9df59fb..39ca81326 100644 --- a/deluge/ui/web/json_api.py +++ b/deluge/ui/web/json_api.py @@ -863,7 +863,7 @@ class WebApi(JSONComponent): web_config = component.get('DelugeWeb').config for key in config: if key in ['sessions', 'pwd_salt', 'pwd_sha1']: - log.warn('Ignored attempt to overwrite web config key: %s', key) + log.warning('Ignored attempt to overwrite web config key: %s', key) continue web_config[key] = config[key] diff --git a/deluge/ui/web/server.py b/deluge/ui/web/server.py index fe8bee6c3..c7a4cba92 100644 --- a/deluge/ui/web/server.py +++ b/deluge/ui/web/server.py @@ -661,7 +661,7 @@ class DelugeWeb(component.Component): Start the DelugeWeb server """ if self.socket: - log.warn('DelugeWeb is already running and cannot be started') + log.warning('DelugeWeb is already running and cannot be started') return log.info('Starting webui server at PID %s', os.getpid())