Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V5 #13

Merged
merged 3 commits into from Jul 6, 2020
Merged

V5 #13

merged 3 commits into from Jul 6, 2020

Conversation

JuiP
Copy link
Member

@JuiP JuiP commented Jun 21, 2020

@quozl
Copy link

quozl commented Jun 29, 2020

Thanks. Reviewed.

Probably blocked by #14.

@chimosky
Copy link
Member

Yes I agree, it's blocked by #14.

JuiP added 3 commits June 30, 2020 14:03
Seen in Ubuntu 20.04 LTS, when clicked "import-freespace" or "import-journal" button
TypeError: Expected string but got 10590.3046875<class 'float'>
The Value Error(for other distos packages) in /usr/lib/python3/dist-packages/gi/overrides/GObject.py, line 273 is raised as TypeError for Ubuntu 20.04 LTS python3-gi package
@JuiP
Copy link
Member Author

JuiP commented Jun 30, 2020

I don't agree with the change in #14 so I made the change in this branch and rebased.
TypeError was reported by @Saumya-Mishra9129 Thanks 😄

I checked GObject.py in the path /usr/lib/python3/dist-packages/gi/overrides for Ubuntu 18.04 LTS, 20.04 LTS and Debian Buster,

For Debian buster and Ubuntu 18.04 python3-gi package, it raises Value Error when set_value is called
Debian_ValueError

For Ubuntu 20.04 python3-gi package, it raises Type Error when set_value is called
Ubuntu_TypeError

Since Value Error was previously handled, there were no tracebacks when I tested on Debian Buster. However, tracebacks:

  File "/usr/share/sugar/activities/analyzeJournal/activity.py", line 443, in __import_freespace_cb
    self._graph_from_reader(reader)
  File "/usr/share/sugar/activities/analyzeJournal/activity.py", line 425, in _graph_from_reader
    self._add_value(None, label=row[0], value=float(row[1]))
  File "/usr/share/sugar/activities/analyzeJournal/activity.py", line 432, in _add_value
    pos = self.labels_and_values.add_value(label, value)
  File "/usr/share/sugar/activities/analyzeJournal/activity.py", line 582, in add_value
    _iter = self.model.insert(path, [label, value])
  File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 1007, in insert
    return self._do_insert(position, row)
  File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 988, in _do_insert
    row, columns = self._convert_row(row)
  File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 900, in _convert_row
    result.append(self._convert_value(cur_col, value))
  File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 914, in _convert_value
    return GObject.Value(self.get_column_type(column), value)
  File "/usr/lib/python3/dist-packages/gi/overrides/GObject.py", line 210, in __init__
    self.set_value(py_value)
  File "/usr/lib/python3/dist-packages/gi/overrides/GObject.py", line 249, in set_value
    raise TypeError("Expected string but got %s%s" %
TypeError: Expected string but got 10590.3046875<class 'float'>
Traceback (most recent call last):
  File "/usr/share/sugar/activities/analyzeJournal/activity.py", line 447, in __import_journal_cb
    self._graph_from_reader(reader)
  File "/usr/share/sugar/activities/analyzeJournal/activity.py", line 425, in _graph_from_reader
    self._add_value(None, label=row[0], value=float(row[1]))
  File "/usr/share/sugar/activities/analyzeJournal/activity.py", line 432, in _add_value
    pos = self.labels_and_values.add_value(label, value)
  File "/usr/share/sugar/activities/analyzeJournal/activity.py", line 582, in add_value
    _iter = self.model.insert(path, [label, value])
  File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 1007, in insert
    return self._do_insert(position, row)
  File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 988, in _do_insert
    row, columns = self._convert_row(row)
  File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 900, in _convert_row
    result.append(self._convert_value(cur_col, value))
  File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 914, in _convert_value
    return GObject.Value(self.get_column_type(column), value)
  File "/usr/lib/python3/dist-packages/gi/overrides/GObject.py", line 210, in __init__
    self.set_value(py_value)
  File "/usr/lib/python3/dist-packages/gi/overrides/GObject.py", line 249, in set_value
    raise TypeError("Expected string but got %s%s" %
TypeError: Expected string but got 25.0<class 'float'> 

Were seen for Ubuntu 20.04
Since, just the exception it raises when set_value is called is different,(difference in packages of different distros) I think this is the best way to fix it. (As done in 3ce8ce9)
@quozl @chimosky @Saumya-Mishra9129 kindly review

@quozl
Copy link

quozl commented Jun 30, 2020

Agreed, well found.

Copy link
Member

@Saumya-Mishra9129 Saumya-Mishra9129 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were seen for Ubuntu 20.04
Since, just the exception it raises when set_value is called is different,(difference in packages of different distros) I think this is the best way to fix it. (As done in 3ce8ce9)

Thanks @JuiP , I agree , Reviewed and Tested. Works fine 👍

@chimosky
Copy link
Member

chimosky commented Jul 6, 2020

Good find @JuiP, reviewed. Thanks.

@chimosky chimosky merged commit b234c7f into sugarlabs:master Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants