crash in deluge-console

Suggestions and discussion of future versions
pjlbyrne
Leecher
Leecher
Posts: 50
Joined: Thu May 22, 2014 9:28 am

crash in deluge-console

Postby pjlbyrne » Tue Oct 02, 2018 8:11 am

I 'fixed' (I think) a bug in deluge-console. Please how may I submit it for approval / checkin? Here is the stacktrace:

Code: Select all

16:58:57.792 [ERROR   ][deluge.ui.console.modes.basemode                      :1207] 'ascii' codec can't encode character u'\xf9' in position 15: ordinal not in range(128)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/deluge-2.0.0b2.dev141-py2.7.egg/deluge/ui/console/modes/basemode.py", line 210, in doRead
    self.read_input()
  File "/usr/local/lib/python2.7/dist-packages/deluge-2.0.0b2.dev141-py2.7.egg/deluge/ui/console/modes/torrentlist/torrentlist.py", line 286, in read_input
    self.minor_mode.handle_read(c)
  File "/usr/local/lib/python2.7/dist-packages/deluge-2.0.0b2.dev141-py2.7.egg/deluge/ui/console/modes/torrentlist/search_mode.py", line 195, in handle_read
    self.torrentlist.refresh([])
  File "/usr/local/lib/python2.7/dist-packages/deluge-2.0.0b2.dev141-py2.7.egg/deluge/ui/console/modes/torrentlist/torrentlist.py", line 223, in refresh
    self.torrentview.update_torrents(lines)
  File "/usr/local/lib/python2.7/dist-packages/deluge-2.0.0b2.dev141-py2.7.egg/deluge/ui/console/modes/torrentlist/torrentview.py", line 325, in update_torrents
    trim=False, scr=self.torrentlist.torrentview_panel,
  File "/usr/local/lib/python2.7/dist-packages/deluge-2.0.0b2.dev141-py2.7.egg/deluge/ui/console/modes/basemode.py", line 160, in add_string
    return add_string(row, string, screen, self.encoding, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/deluge-2.0.0b2.dev141-py2.7.egg/deluge/ui/console/modes/basemode.py", line 290, in add_string
    screen.addstr(row, col, string, color)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf9' in position 15: ordinal not in range(128)

Here is my proposed fix:

Code: Select all

 ~/deluge $ git diff deluge/ui/console/modes/basemode.py
diff --git a/deluge/ui/console/modes/basemode.py b/deluge/ui/console/modes/basemode.py
index 6226d1bc1..804ccdb42 100644
--- a/deluge/ui/console/modes/basemode.py
+++ b/deluge/ui/console/modes/basemode.py
@@ -287,6 +287,7 @@ def add_string(row, fstring, screen, encoding, col=0, pad=True, pad_char=' ', tr
                 string = string[0:remaining_chrs]

         try:
+            string = string.encode( encoding )
             screen.addstr(row, col, string, color)
         except curses.error as ex:
             # Ignore exception for writing offscreen.



How may I progress this please? Will someone apply the fix or can I raise a ticket? How do I get a login to raise a ticket?
Thanks

shamael
Compulsive Poster
Compulsive Poster
Posts: 634
Joined: Sat Oct 08, 2016 9:28 am

Re: crash in deluge-console

Postby shamael » Tue Oct 02, 2018 10:21 am

Hi,

Please login https://dev.deluge-torrent.org/wiki/Development and create a new ticket.
(new ticket is not present if not logged). It think your work may have a better view there, thx!

Cas
Top Bloke
Top Bloke
Posts: 3643
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: crash in deluge-console

Postby Cas » Tue Oct 02, 2018 11:10 am

It does look good to me so also see https://dev.deluge-torrent.org/wiki/Con ... llRequests

pjlbyrne
Leecher
Leecher
Posts: 50
Joined: Thu May 22, 2014 9:28 am

Re: crash in deluge-console

Postby pjlbyrne » Wed Oct 03, 2018 5:54 pm

Thanks. I was being silly. I have now logged in, verified my email and created the ticket.


Return to “Development”

Who is online

Users browsing this forum: No registered users and 3 guests