[Sugar-devel] Debian Advocacy Update - Errors in Calculate on Debian Bullseye

shaansubbaiah.cs18 at bmsce.ac.in shaansubbaiah.cs18 at bmsce.ac.in
Tue Jun 30 13:34:44 EDT 2020

Hello James,
While testing Sugar 0.117-3 on Debian Bullseye (11 / testing) I have found numerous errors which were not present while testing on Debian Buster (10 / stable).
Both versions of the activity are the same, 46. There have been a few changes made a week back:
   - fix recommend python3-matplotlib (not python-matplotlib); closes: bug#938584, thanks to Sandro Tosi * fix provide ${python3:Provides} (not ${python:Provides}) 

I will investigate further and report back.

   - Warning when ateempting to calculate and expression ( pressing ‘=’ )   
65535 = (Binary) 1111111111111111 = (Hexadecimal) FFFF

Gtk-WARNING **: 19:47:57.736: Don't know color 'Gdk.Color(red=6553
5, green=65535, blue=65535)'
   - Error when using ‘pi’ and ‘e’ in expression:
1593526849.741283 ERROR root: Internal error (<class 'UnboundLocalError'>): local variable
 'list' referenced before assignment
Traceback (most recent call last):
  File "/usr/share/sugar/activities/Calculate.activity/astparser.py", line 674, in evaluat
    ret = self._process_node(eqn, state)
  File "/usr/share/sugar/activities/Calculate.activity/astparser.py", line 444, in _proces
    return self._process_node(node.value, state)
  File "/usr/share/sugar/activities/Calculate.activity/astparser.py", line 515, in _proces
    if node.id not in list(state.used_var_ofs.keys()):
UnboundLocalError: local variable 'list' referenced before assignment

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/sugar/activities/Calculate.activity/layout.py", line 133, in <lambda>
    lambda w: self._parent.process()],
  File "/usr/share/sugar/activities/Calculate.activity/calculate.py", line 518, in process
    res = self.parser.evaluate(tree)
  File "/usr/share/sugar/activities/Calculate.activity/astparser.py", line 680, in evaluat
    raise ParseError(msg, 0)
TypeError: __init__() missing 1 required positional argument: 'eqn'
   - Hovering over Algebraic, Trigonometric toolbar buttons throws:
(sugar-activity3:1791): Gtk-WARNING **: 19:54:34.278: Drawing a gadget with negative dimen
sions. Did you forget to allocate a size? (node menuitem owner SugarPaletteHeader)
Submitting trigonometric functions without values displays an error in the Activity but only the first character is highlighted red instead of the full function.

Submitting logical expressions without values throws:

1593527432.306449 DEBUG Calculate: Result: ParseError('Parse error', 6, 'True!=')
Traceback (most recent call last):
  File "/usr/share/sugar/activities/Calculate.activity/layout.py", line 133, in <lambda>
    lambda w: self._parent.process()],
  File "/usr/share/sugar/activities/Calculate.activity/calculate.py", line 552, in process
  File "/usr/share/sugar/activities/Calculate.activity/calculate.py", line 444, in set_err
  File "/usr/share/sugar/activities/Calculate.activity/calculate.py", line 439, in set_las
  File "/usr/share/sugar/activities/Calculate.activity/calculate.py", line 219, in create_
    resstr = str(self.result)
  File "/usr/share/sugar/activities/Calculate.activity/astparser.py", line 75, in __str__
    msg = _("Error at '%(a)', position: %(b)") % \
ValueError: unsupported format character ''' (0x27) at index 14
   - Submitting / pressing ‘=’ without entering any value throws
1593527598.469328 DEBUG root: Parsing preprocessed equation: ''
Traceback (most recent call last):
  File "/usr/share/sugar/activities/Calculate.activity/layout.py", line 133, in <lambda>
    lambda w: self._parent.process()],
  File "/usr/share/sugar/activities/Calculate.activity/calculate.py", line 517, in process
    tree = self.parser.parse(s)
  File "/usr/share/sugar/activities/Calculate.activity/astparser.py", line 656, in parse
    raise ParseError(msg)
TypeError: __init__() missing 2 required positional arguments: 'start' and 'eqn'

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20200630/3773cc71/attachment.htm>

More information about the Sugar-devel mailing list