File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1100,20 +1100,24 @@ def lsize():
11001100 if v_items :
11011101 self .list_win .addstr ('\n ' )
11021102
1103+ if not py3 :
1104+ encoding = getpreferredencoding ()
11031105 for ix , i in enumerate (v_items ):
11041106 padding = (wl - len (i )) * ' '
11051107 if i == current_item :
11061108 color = get_colpair (self .config , 'operator' )
11071109 else :
11081110 color = get_colpair (self .config , 'main' )
11091111 if not py3 :
1110- i = i .encode (getpreferredencoding () )
1112+ i = i .encode (encoding )
11111113 self .list_win .addstr (i + padding , color )
11121114 if ((cols == 1 or (ix and not (ix + 1 ) % cols ))
11131115 and ix + 1 < len (v_items )):
11141116 self .list_win .addstr ('\n ' )
11151117
11161118 if self .docstring is not None :
1119+ if not py3 :
1120+ docstring_string = docstring_string .encode (encoding , 'ignore' )
11171121 self .list_win .addstr ('\n ' + docstring_string ,
11181122 get_colpair (self .config , 'comment' ))
11191123# XXX: After all the trouble I had with sizing the list box (I'm not very good
You can’t perform that action at this time.
0 commit comments