Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 550802 - app-portage/elogviewer-2.5 - crashes with TypeError: argument of type 'NoneType' is not iterable
Summary: app-portage/elogviewer-2.5 - crashes with TypeError: argument of type 'NoneTy...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Paul Varner (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-30 07:46 UTC by Juergen Rose
Modified: 2015-09-11 05:27 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
elogviewer—fixed encoding and no settings (elogviewer.py,28.77 KB, text/x-python-script)
2015-05-31 09:15 UTC, Mathias Laurin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Rose 2015-05-30 07:46:24 UTC
'elogviewer' fails with:

root@impala:/usr/share/applications/RootRlogin/TECNET(99)# elogviewer 
Traceback (most recent call last):
  File "/usr/bin/elogviewer", line 837, in <module>
    main()
  File "/usr/bin/elogviewer", line 831, in main
    elogviewer = Elogviewer(config)
  File "/usr/bin/elogviewer", line 598, in __init__
    self.populate()
  File "/usr/bin/elogviewer", line 794, in populate
    elogRowItem = ElogRowItem(filename)
  File "/usr/bin/elogviewer", line 407, in __init__
    self._elog = Elog.fromFilename(filename) if filename else Elog(
  File "/usr/bin/elogviewer", line 231, in fromFilename
    _(elogfile.read()))
  File "/usr/bin/elogviewer", line 91, in _
    return bytes.decode(locale.getpreferredencoding())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 379: ordinal not in range(128)
root@impala:/usr/share/applications/RootRlogin/TECNET(100)# locale
LANG=en_US.UTF-8
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C
root@impala:/usr/share/applications/RootRlogin/TECNET(101)# qlist -Iv elogviewer 
app-portage/elogviewer-2.5
Comment 1 Juergen Rose 2015-05-30 07:58:33 UTC
Under a en_US.UTF-8 locale elogviewer needs very long to start. After the start it firstly responds very slowly and then does not react at all. I can't enter search entries. If I want to close the window, I get: 
'The window "Elogviewer (10821 unread)" does not seem to responding. Do you want to force it to exit by sending the terminate signal?"

In the lx-terminalwindow the following UnicodeError is shown:

root@impala:/root(47)# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
[1]+  Done                    emacs -i $GEOMETRY $NO_DOS_CONV -name "$BASENAME" "$*"
root@impala:/root(48)# elogviewer 
Traceback (most recent call last):
  File "/usr/bin/elogviewer", line 263, in setEditorData
    editor.setHtml(model.itemFromIndex(index).html())
  File "/usr/bin/elogviewer", line 426, in html
    text = _html(self._elog.filename)
  File "/usr/bin/elogviewer", line 182, in _html
    lines.append("{} <br />".format(line))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2018' in position 63: ordinal not in range(128)
Traceback (most recent call last):
  File "/usr/bin/elogviewer", line 263, in setEditorData
    editor.setHtml(model.itemFromIndex(index).html())
  File "/usr/bin/elogviewer", line 426, in html
    text = _html(self._elog.filename)
  File "/usr/bin/elogviewer", line 182, in _html
    lines.append("{} <br />".format(line))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2018' in position 63: ordinal not in range(128)
Comment 2 Juergen Rose 2015-05-30 08:20:08 UTC
Reemerging elogviewer does not help.
Comment 3 Juergen Rose 2015-05-30 08:33:30 UTC
At the next system (with a en_US.UTF-8 locale) it fails with:

root@lynx:/root(57)# elogviewer 
Traceback (most recent call last):
  File "/usr/bin/elogviewer", line 837, in <module>
    main()
  File "/usr/bin/elogviewer", line 831, in main
    elogviewer = Elogviewer(config)
  File "/usr/bin/elogviewer", line 598, in __init__
    self.populate()
  File "/usr/bin/elogviewer", line 797, in populate
    if filename in self.settings.value("readFlag")
TypeError: argument of type 'NoneType' is not iterable
root@lynx:/root(58)# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
root@lynx:/root(59)# qlist -Iv elogviewer
app-portage/elogviewer-2.5
Comment 4 Mathias Laurin 2015-05-30 20:35:35 UTC
As far as I understand, \xe2 is â and u'\u2018' is ‘, so none of them is
in the ascii range. If you set your computer to strict ascii and try to
read files that are non-ascii, they cannot be decoded. This is a good
thing and not related to elogviewer...

Am I misunderstanding?

Can you maybe set your computer's locale to your language and try again?


Mathias



(In reply to Juergen Rose from comment #0)
> 'elogviewer' fails with:
> 
> root@impala:/usr/share/applications/RootRlogin/TECNET(99)# elogviewer 
> Traceback (most recent call last):
>   File "/usr/bin/elogviewer", line 837, in <module>
>     main()
>   File "/usr/bin/elogviewer", line 831, in main
>     elogviewer = Elogviewer(config)
>   File "/usr/bin/elogviewer", line 598, in __init__
>     self.populate()
>   File "/usr/bin/elogviewer", line 794, in populate
>     elogRowItem = ElogRowItem(filename)
>   File "/usr/bin/elogviewer", line 407, in __init__
>     self._elog = Elog.fromFilename(filename) if filename else Elog(
>   File "/usr/bin/elogviewer", line 231, in fromFilename
>     _(elogfile.read()))
>   File "/usr/bin/elogviewer", line 91, in _
>     return bytes.decode(locale.getpreferredencoding())
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 379:
> ordinal not in range(128)
> root@impala:/usr/share/applications/RootRlogin/TECNET(100)# locale
> LANG=en_US.UTF-8
> LC_CTYPE="C"
> LC_NUMERIC="C"
> LC_TIME="C"
> LC_COLLATE="C"
> LC_MONETARY="C"
> LC_MESSAGES="C"
> LC_PAPER="C"
> LC_NAME="C"
> LC_ADDRESS="C"
> LC_TELEPHONE="C"
> LC_MEASUREMENT="C"
> LC_IDENTIFICATION="C"
> LC_ALL=C
> root@impala:/usr/share/applications/RootRlogin/TECNET(101)# qlist -Iv
> elogviewer 
> app-portage/elogviewer-2.5
Comment 5 Juergen Rose 2015-05-31 05:13:23 UTC
(In reply to Mathias Laurin from comment #4)
> As far as I understand, \xe2 is â and u'\u2018' is ‘, so none of them is
> in the ascii range. If you set your computer to strict ascii and try to
> read files that are non-ascii, they cannot be decoded. This is a good
> thing and not related to elogviewer...

Hallo Mathias,

I can accept that the program can't decode some strings, if the wrong locale is selected. But it should not crash.

> Am I misunderstanding?
> 
> Can you maybe set your computer's locale to your language and try again?
 
What is my locale? As user root I prefer to have the locale C or en_US.UTF-8.
As user rose I use sometimes de_DE.UTF-8 and sometimes en_US.UTF-8. And as you can see from Comment 1 elogviewer crashes also with en_US.UTF-8.

Juergen
 
> Mathias
> 
> 
> 
> (In reply to Juergen Rose from comment #0)
> > 'elogviewer' fails with:
> > 
> > root@impala:/usr/share/applications/RootRlogin/TECNET(99)# elogviewer 
> > Traceback (most recent call last):
> >   File "/usr/bin/elogviewer", line 837, in <module>
...
> >   File "/usr/bin/elogviewer", line 231, in fromFilename
> >     _(elogfile.read()))
> >   File "/usr/bin/elogviewer", line 91, in _
> >     return bytes.decode(locale.getpreferredencoding())
> > UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 379:
> > ordinal not in range(128)
> > root@impala:/usr/share/applications/RootRlogin/TECNET(100)# locale
> > LANG=en_US.UTF-8
> > LC_CTYPE="C"
> > LC_NUMERIC="C"
...
> > LC_IDENTIFICATION="C"
> > LC_ALL=C
> > root@impala:/usr/share/applications/RootRlogin/TECNET(101)# qlist -Iv
> > elogviewer 
> > app-portage/elogviewer-2.5
Comment 6 Juergen Rose 2015-05-31 05:18:40 UTC
It crashes also with german UTF-8 locale:

rose@lynx:/home/rose(1)$ locale
LANG=de_DE.UTF-8
LC_CTYPE=de_DE.UTF-8
LC_NUMERIC=C
LC_TIME=de_DE.UTF-8
LC_COLLATE=C
LC_MONETARY=C
LC_MESSAGES=de_DE.UTF-8
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=
rose@lynx:/home/rose(2)$ elogviewer 
Traceback (most recent call last):
  File "/usr/bin/elogviewer", line 837, in <module>
    main()
  File "/usr/bin/elogviewer", line 831, in main
    elogviewer = Elogviewer(config)
  File "/usr/bin/elogviewer", line 598, in __init__
    self.populate()
  File "/usr/bin/elogviewer", line 797, in populate
    if filename in self.settings.value("readFlag")
TypeError: argument of type 'NoneType' is not iterable
Comment 7 Mathias Laurin 2015-05-31 09:15:38 UTC
Created attachment 404358 [details]
elogviewer—fixed encoding and no settings

Servus. It seems that you found two unrelated bugs. Sorry about
that...

Could please download the attached file to your computer and
invoke it directly from the prompt.

  python ./elogviewer.py

and report back? The encoding error and the noniterable None
type errors should be taken care of. I am not sure about the
slowness.
Comment 8 Mathias Laurin 2015-06-07 22:21:02 UTC
Jürgen, thank you for the bug report.

At first, I misunderstood your bug report and only later found
out it was two unrelated and independent bugs that you were
unfortunate enough to encounter at once.

In any case, I believe I fixed them in elogviewer 2.6, see Bug
#551472.


Best,
Mathias
Comment 9 Brian Dolbec (RETIRED) gentoo-dev 2015-09-11 05:27:31 UTC
Fixed in elogviewer-2.6