* Use print function
* Fix except as statements
* Remove old twisted 8 code
* Remove empty docstring
* Refactor try statement to only contain the relevant import and
disable pylint import msgs.
* Use flake8 noqa and pylint comment and drop pyflakes workarounds.
* Replace the uses of long with int.
* Replace im_func with __func__ as it has been provided for Python 3 forward-compatibility.
* Fix next/__next__ for Python 3 compatibility.
* Remove the long number literal
* Ensure freespace() returns int
To make the code more Python 3 compatible, I've made a few changes to how we handle keys() or iterkeys() calls on dictionaries. All functionality should remain the same.
* Remove the use of .keys() or .iterkeys() when iterating through a dictionary.
* Remove the use of .keys() when checking if key exists in dictionary.
* Replace dict.keys() with list(dict) to obtain a list of dictionary keys. In Python 3 dict.keys() returns a dict_keys object, not a list.
* Ensure all file descriptors are closed. Using the with statement ensures
closure.
* The main problem was with thousands of unclosed file desciptors from
tracker_icons mkstemp.
* Use a prefix 'deluge_ticon.' to identify created tracker_icon tmp files.