[Deluge] #3309: TypeError: '>' not supported between instances of 'NoneType' and 'str'

30 views
Skip to first unread message

Deluge

unread,
Oct 18, 2019, 6:32:17 AM10/18/19
to delug...@googlegroups.com
#3309: TypeError: '>' not supported between instances of 'NoneType' and 'str'
----------------------------+---------------------
Reporter: kuraga | Type: bug
Status: new | Priority: minor
Milestone: needs verified | Component: Unknown
Version: 2.0.3 | Keywords:
----------------------------+---------------------
At start:

{{{
TypeError: '>' not supported between instances of 'NoneType' and 'str'
Traceback (most recent call last):
File "/usr/lib64/python3.6/site-packages/deluge/ui/gtk3/listview.py",
line 233, in stabilized
result = sort_func(model, iter1, iter2, data)
File "/usr/lib64/python3.6/site-packages/deluge/ui/gtk3/torrentview.py",
line 106, in progress_sort
return cmp(state1, state2)
File "/usr/lib64/python3.6/site-packages/deluge/ui/gtk3/common.py", line
45, in cmp
return (x > y) - (x < y)
}}}

Seems like number of this messages correlates with number of torrents...

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3309>
Deluge <https://deluge-torrent.org/>
Deluge Project

Deluge

unread,
Nov 14, 2019, 8:42:10 AM11/14/19
to delug...@googlegroups.com
#3309: TypeError: '>' not supported between instances of 'NoneType' and 'str'
---------------------+----------------------------
Reporter: kuraga | Owner:

Type: bug | Status: new
Priority: minor | Milestone: needs verified
Component: GTK UI | Version: 2.0.3
Resolution: | Keywords:
---------------------+----------------------------
Changes (by milto):

* component: Unknown => GTK UI


Comment:

I have the same error as kuraga, I report here the result of my
investigation.

== Problem ==

The list of torrents takes time to load at startup with the current
version of Deluge 2.0.3 from the offical ppa deluge-stable installed for
Ubuntu 1.04 Bionic.

The problem seems located in the GTK UI component of Deluge and it leads
to too many open files error. It seems to be a problem of passing a null
parameter to the cmp function in `deluge/ui/gtk3/common.py`.

I have around 60 torrents, seeded correctly with Deluge 1.3 or
Transmission.

== Reproduce error ==

After a successful fresh install of Deluge 2.0 and a first start in
standalone mode without any error, I add torrents in seed manually via
`menu -> File -> Add Torrent` everything seems right so far. Then I close
and restart Deluge. It starts with an empty list of torrent and it takes
several seconds to load them. It may sometimes crash at this point or just
run slowly and starts to use more and more CPU ressources.

To track the problem you can watch in your system log file (personally I
use `journalctl`) or just start Deluge in terminal and see the error.

This error is repeated houndreds of times
{{{#!div style="font-size: 80%"
{{{#!console
Original exception was:


Traceback (most recent call last):

File "/usr/lib/python3/dist-packages/deluge/ui/gtk3/listview.py", line
233, in stabilized
File "/usr/lib/python3/dist-packages/deluge/ui/gtk3/listview.py", line
250, in generic_sort_func
File "/usr/lib/python3/dist-packages/deluge/ui/gtk3/common.py", line 45,
in cmp
TypeError: '>' not supported between instances of 'str' and 'NoneType'


Traceback (most recent call last):

File "/usr/lib/python3/dist-packages/deluge/ui/gtk3/listview.py", line
233, in stabilized
File "/usr/lib/python3/dist-packages/deluge/ui/gtk3/listview.py", line
250, in generic_sort_func
File "/usr/lib/python3/dist-packages/deluge/ui/gtk3/common.py", line 45,
in cmp
TypeError: '>' not supported between instances of 'str' and 'NoneType'
Error in sys.excepthook:


Traceback (most recent call last):

File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 109,
in apport_excepthook
File "/usr/lib/python3/dist-packages/apport/report.py", line 537, in
add_proc_info
OSError: [Errno 24] Too many open files: '/proc/15418'
}}}
}}}

And finally the last line of error is:
{{{#!div style="font-size: 80%"
{{{#!console
[ERROR ][deluge.core.torrentmanager :1132] Unable to save
torrents.fastresume: [Errno 24] Too many open files:
'/home/username/.config/deluge/state/torrents.fastresume.tmp'
}}}
}}}


== Diagnostic ==

I have installed the package `deluge 2.0.3-2~201906121747~ubuntu18.04.1`
provided by the `ppa:deluge-team/stable` for Ubuntu 18.04 Bionic, Python
3.6 is used to run Deluge with `libtorrent: 1.1.5.0`

Prior to the installation of Deluge 2.0.3, I have purged all packages
related to Deluge 1.3 from the universe repository of Ubuntu: `deluge
deluge-common deluge-gtk` and moved my `~/.config/deluge`

I run the command `deluge -L=debug -l=deluge_debug
--profile=deluge_profile &!` to report information about the bug. The
following are extracts from `deluge_debug` that might help to track the
problem.

Around line 397 and repeated somtimes in the rest of log after:
{{{#!div style="font-size: 80%"
{{{#!console
09:37:31 [DEBUG ][deluge.core.core :651 ] Deprecated session status key
num_peers, please use peer.num_peers_connected
09:37:31 [DEBUG ][deluge.core.core :651 ] Deprecated session status key
dht_nodes, please use dht.dht_nodes
09:37:31 [DEBUG ][deluge.core.core :651 ] Deprecated session status key
has_incoming_connections, please use net.has_incoming_connections
09:37:31 [DEBUG ][deluge.core.core :651 ] Deprecated session status key
num_peers, please use peer.num_peers_connected
09:37:31 [DEBUG ][deluge.core.core :651 ] Deprecated session status key
dht_nodes, please use dht.dht_nodes
09:37:31 [DEBUG ][deluge.core.core :651 ] Deprecated session status key
has_incoming_connections, please use net.has_incoming_connections
}}}
}}}

Something weird happens, around line 516 everything seems fines:
{{{#!div style="font-size: 80%"
{{{#!console
09:37:32 [INFO ][deluge.core.torrentmanager :806 ] Loading torrent state:
/home/username/.config/deluge/state/torrents.state
09:37:32 [INFO ][deluge.core.torrentmanager :819 ] Successfully loaded
/home/username/.config/deluge/state/torrents.state
09:37:32 [INFO ][deluge.core.torrentmanager :1066] Opening
torrents.fastresume for load:
/home/username/.config/deluge/state/torrents.fastresume
09:37:32 [INFO ][deluge.core.torrentmanager :1077] Successfully loaded
torrents.fastresume:
/home/username/.config/deluge/state/torrents.fastresume
}}}
}}}
in between all torrent seems to be loaded correctly and latter:
{{{#!div style="font-size: 80%"
{{{#!console
09:37:48 [DEBUG ][deluge.core.torrentmanager :1126] Creating the temporary
file: /home/username/.config/deluge/state/torrents.fastresume.tmp
09:37:48 [DEBUG ][deluge.core.torrentmanager :1136] Creating backup of
torrents.fastresume at:
/home/username/.config/deluge/state/torrents.fastresume.bak
09:37:48 [DEBUG ][deluge.core.torrentmanager :1146] Saving
torrents.fastresume to:
/home/username/.config/deluge/state/torrents.fastresume`
}}}
}}}
however it is a bit contradictory with the message received in standard
error output:
{{{#!div style="font-size: 80%"
{{{#!console
[ERROR ][deluge.core.torrentmanager :1132] Unable to save
torrents.fastresume: [Errno 24] Too many open files:
'/home/username/.config/deluge/state/torrents.fastresume.tmp'
}}}
}}}

In the end the log is full of:
{{{#!div style="font-size: 80%"
{{{#!console
09:38:56 [DEBUG ][deluge.core.alertmanager :130 ] listen_failed_alert:
listening on 0.0.0.0 : 0.0.0.0:50964 failed: [accept] [TCP] Too many open
files
}}}
}}}

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3309#comment:1>

Deluge

unread,
Nov 14, 2019, 9:05:57 AM11/14/19
to delug...@googlegroups.com
#3309: TypeError: '>' not supported between instances of 'NoneType' and 'str'
----------------------+-------------------
Reporter: kuraga | Owner:
Type: bug | Status: new
Priority: blocker | Milestone: 2.x

Component: GTK UI | Version: 2.0.3
Resolution: | Keywords:
----------------------+-------------------
Changes (by milto):

* priority: minor => blocker
* milestone: needs verified => 2.x


--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3309#comment:2>

Deluge

unread,
Dec 6, 2019, 6:31:31 AM12/6/19
to delug...@googlegroups.com
#3309: TypeError: '>' not supported between instances of 'NoneType' and 'str'
----------------------+-------------------
Reporter: kuraga | Owner:
Type: bug | Status: new
Priority: blocker | Milestone: 2.0.4

Component: GTK UI | Version: 2.0.3
Resolution: | Keywords:
----------------------+-------------------
Changes (by Cas):

* milestone: 2.x => 2.0.4


Comment:

There is a related ticket #3330 which has a !TypeError comparing `None`
and `None` so the issue is due to string type checking by Python 3. So the
`cmp` function needs to be able to handle either or both values being
`None` by converting to appropriate type before comparison.

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3309#comment:3>

Deluge

unread,
Mar 23, 2020, 2:20:12 AM3/23/20
to delug...@googlegroups.com
#3309: TypeError: '>' not supported between instances of 'NoneType' and 'str'
----------------------+-------------------
Reporter: kuraga | Owner:
Type: bug | Status: new

Priority: blocker | Milestone: 2.0.4
Component: GTK UI | Version: 2.0.3
Resolution: | Keywords:
----------------------+-------------------

Comment (by DanBit):

Is there any update on this?

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3309#comment:4>

Deluge

unread,
Mar 23, 2020, 10:58:58 AM3/23/20
to delug...@googlegroups.com
#3309: TypeError: '>' not supported between instances of 'NoneType' and 'str'
----------------------+-------------------
Reporter: kuraga | Owner:
Type: bug | Status: new

Priority: blocker | Milestone: 2.0.4
Component: GTK UI | Version: 2.0.3
Resolution: | Keywords:
----------------------+-------------------

Comment (by milto):

I hoped there would be an update since this error makes Deluge 2 totally
unusable however I lost hope and stick with Deluge 1.3 that it is stable
and functional.

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3309#comment:5>

Deluge

unread,
Mar 23, 2020, 12:27:43 PM3/23/20
to delug...@googlegroups.com
#3309: TypeError: '>' not supported between instances of 'NoneType' and 'str'
----------------------+-------------------
Reporter: kuraga | Owner:
Type: bug | Status: new

Priority: blocker | Milestone: 2.0.4
Component: GTK UI | Version: 2.0.3
Resolution: | Keywords:
----------------------+-------------------

Comment (by jools772):

https://portingguide.readthedocs.io/en/latest/comparisons.html

Here's a guide in how to port python 2 comparison operations to python 3.

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3309#comment:6>

Deluge

unread,
Jun 3, 2020, 10:43:23 PM6/3/20
to delug...@googlegroups.com
#3309: TypeError: '>' not supported between instances of 'NoneType' and 'str'
----------------------+-------------------
Reporter: kuraga | Owner:
Type: bug | Status: new

Priority: blocker | Milestone: 2.0.4
Component: GTK UI | Version: 2.0.3
Resolution: | Keywords:
----------------------+-------------------

Comment (by sremick):

Another person bitten by this. I don't understand how I triggered it.
Deluge had been working fine, I messed some things up w/ Python then fixed
that, but now Deluge won't start. Mine is more like ticket 3330 where I'm
getting "TypeError: '>' not supported between instances of 'NoneType' and
'NoneType'" like that user.

Is there even a workaround or hack so I can become functional again in the
meantime?

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3309#comment:7>

Deluge

unread,
Jun 3, 2020, 10:44:54 PM6/3/20
to delug...@googlegroups.com
#3309: TypeError: '>' not supported between instances of 'NoneType' and 'str'
----------------------+-------------------
Reporter: kuraga | Owner:
Type: bug | Status: new

Priority: blocker | Milestone: 2.0.4
Component: GTK UI | Version: 2.0.3
Resolution: | Keywords:
----------------------+-------------------
Changes (by sremick):

* cc: scott@… (added)


--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3309#comment:8>

Deluge

unread,
Jun 18, 2020, 6:13:36 AM6/18/20
to delug...@googlegroups.com
#3309: TypeError: '>' not supported between instances of 'NoneType' and 'str'
----------------------+-------------------
Reporter: kuraga | Owner:
Type: bug | Status: new

Priority: blocker | Milestone: 2.0.4
Component: GTK UI | Version: 2.0.3
Resolution: | Keywords:
----------------------+-------------------

Comment (by p4nch1):

Same error on my system, deluge closes itself after a lot of those
"TypeError" messages.

Info: deluge 2.0.3 | libtorrent: 1.1.13.0 | Python: 3.8.2 | OS: Linux Mint
20 MATE

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3309#comment:9>

Deluge

unread,
Nov 15, 2020, 5:44:35 AM11/15/20
to delug...@googlegroups.com
#3309: TypeError: '>' not supported between instances of 'NoneType' and 'str'
----------------------+-------------------
Reporter: kuraga | Owner:
Type: bug | Status: new

Priority: blocker | Milestone: 2.0.4
Component: GTK UI | Version: 2.0.3
Resolution: | Keywords:
----------------------+-------------------

Comment (by revlev):

This got fixed in commit [https://github.com/deluge-
torrent/deluge/commit/23a48dd01c86ef01cd1d13371de51247ec9a503b 23a48dd].

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3309#comment:10>

Deluge

unread,
Jan 17, 2021, 10:11:29 AM1/17/21
to delug...@googlegroups.com
#3309: TypeError: '>' not supported between instances of 'NoneType' and 'str'
----------------------+--------------------
Reporter: kuraga | Owner:
Type: bug | Status: closed

Priority: blocker | Milestone: 2.0.4
Component: GTK UI | Version: 2.0.3
Resolution: Fixed | Keywords:
----------------------+--------------------
Changes (by Cas):

* status: new => closed
* resolution: => Fixed


--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3309#comment:11>

Reply all
Reply to author
Forward
0 new messages