Discussion:
[Deluge] #3199: unicode crash in deluge-console
Deluge
2018-10-03 17:53:36 UTC
Permalink
#3199: unicode crash in deluge-console
------------------------+----------------------------
Reporter: pjlbyrne | Owner:
Type: bug | Status: new
Priority: major | Milestone: needs verified
Component: Console UI | Version: develop (git)
Keywords: |
------------------------+----------------------------
I 'fixed' (I think) a bug in deluge-console. Please how may I submit it
for approval / checkin? Here is the stacktrace:

{{{
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:

{{{
~/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.[/code]
}}}

Thanks

Patrick

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3199>
Deluge <http://deluge-torrent.org/>
Deluge Project
--
You received this message because you are subscribed to the Google Groups "Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deluge-dev+***@googlegroups.com.
To post to this group, send email to deluge-***@googlegroups.com.
Visit this group at https://groups.google.com/group/deluge-dev.
For more options, visit https://groups.google.com/d/optout.
Deluge
2018-10-05 12:52:50 UTC
Permalink
#3199: unicode crash in deluge-console
-------------------------+---------------------------
Reporter: pjlbyrne | Owner: Cas
Type: bug | Status: assigned
Priority: major | Milestone: 2.0.0
Component: Console UI | Version: develop (git)
Resolution: | Keywords:
-------------------------+---------------------------
Changes (by Cas):

* owner: => Cas
* status: new => assigned
* milestone: needs verified => 2.0.0


--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3199#comment:1>
Deluge <http://deluge-torrent.org/>
Deluge Project
--
You received this message because you are subscribed to the Google Groups "Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deluge-dev+***@googlegroups.com.
To post to this group, send email to deluge-***@googlegroups.com.
Visit this group at https://groups.google.com/group/deluge-dev.
For more options, visit https://groups.google.com/d/optout.
Deluge
2018-10-22 18:18:27 UTC
Permalink
#3199: unicode crash in deluge-console
-------------------------+---------------------------
Reporter: pjlbyrne | Owner: Cas
Type: bug | Status: assigned
Priority: major | Milestone: 2.0.0
Component: Console UI | Version: develop (git)
Resolution: | Keywords:
-------------------------+---------------------------

Comment (by Cas):

New PR: https://github.com/deluge-torrent/deluge/pull/223

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3199#comment:2>
Deluge <http://deluge-torrent.org/>
Deluge Project
--
You received this message because you are subscribed to the Google Groups "Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deluge-dev+***@googlegroups.com.
To post to this group, send email to deluge-***@googlegroups.com.
Visit this group at https://groups.google.com/group/deluge-dev.
For more options, visit https://groups.google.com/d/optout.
Deluge
2018-10-22 22:32:10 UTC
Permalink
#3199: unicode crash in deluge-console
-------------------------+---------------------------
Reporter: pjlbyrne | Owner: Cas
Type: bug | Status: closed
Priority: major | Milestone: 2.0.0
Component: Console UI | Version: develop (git)
Resolution: Fixed | Keywords:
-------------------------+---------------------------
Changes (by Cas):

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


Comment:

[1838403e3b87dac56678107955625cc7ca09e4d6]

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3199#comment:3>
Deluge <http://deluge-torrent.org/>
Deluge Project
--
You received this message because you are subscribed to the Google Groups "Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deluge-dev+***@googlegroups.com.
To post to this group, send email to deluge-***@googlegroups.com.
Visit this group at https://groups.google.com/group/deluge-dev.
For more options, visit https://groups.google.com/d/optout.
Loading...