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

Saumya Mishra 2017230 at iiitdmj.ac.in
Tue Jun 30 15:34:18 EDT 2020


Hello Shaan!!

Nice work.
I have also tested Calculate version 46-1 with Ubuntu 20.04 sucrose package
version 0.117.
All the Errors are reproducible.

   1. Warning when attempting 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)'

*Workaround is to use Gdk.RGBA as Gdk.Color is deprecated and will not work
with newer versions of Ubuntu and Debian.*

1. 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
e
    ret = self._process_node(eqn, state)
  File "/usr/share/sugar/activities/Calculate.activity/astparser.py",
line 444, in _proces
s_node
    return self._process_node(node.value, state)
  File "/usr/share/sugar/activities/Calculate.activity/astparser.py",
line 515, in _proces
s_node
    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
e
    raise ParseError(msg, 0)
TypeError: __init__() missing 1 required positional argument:
'eqn'Reproducible on Ubuntu 20.04


   1. 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)*-- Warning is Reproducible*


   1.

   Submitting trigonometric functions without values displays an error in
   the Activity but only the first character is highlighted red instead of the
   full function. -- Reproducible on Ubuntu 20.04
   2.

   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
    self.set_error_equation(eqn)
  File "/usr/share/sugar/activities/Calculate.activity/calculate.py",
line 444, in set_err
or_equation
    self.set_last_equation(eqn)
  File "/usr/share/sugar/activities/Calculate.activity/calculate.py",
line 439, in set_las
t_equation
    self.layout.last_eq.set_buffer(eqn.create_lasteq_textbuf())
  File "/usr/share/sugar/activities/Calculate.activity/calculate.py",
line 219, in create_
lasteq_textbuf
    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

*Reproducile on Ubuntu 20.04 -- We need to implement Exception handlers*


   1. 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'*Reproducile on Ubuntu 20.04 -- We need to implement
Exception handlers*


I will now move forward with solving these errors and opening issues.
Thanks
Saumya

On Tue, Jun 30, 2020 at 11:04 PM shaansubbaiah.cs18 at bmsce.ac.in <
shaansubbaiah.cs18 at bmsce.ac.in> wrote:

> 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.
> ------------------------------
>
> *Calculate*
>
>    1. 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)'
>
>
>    1. 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
> e
>     ret = self._process_node(eqn, state)
>   File "/usr/share/sugar/activities/Calculate.activity/astparser.py", line 444, in _proces
> s_node
>     return self._process_node(node.value, state)
>   File "/usr/share/sugar/activities/Calculate.activity/astparser.py", line 515, in _proces
> s_node
>     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
> e
>     raise ParseError(msg, 0)
> TypeError: __init__() missing 1 required positional argument: 'eqn'
>
>
>    1. 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)
>
>
>    1.
>
>    Submitting trigonometric functions without values displays an error in
>    the Activity but only the first character is highlighted red instead of the
>    full function.
>    2.
>
>    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
>     self.set_error_equation(eqn)
>   File "/usr/share/sugar/activities/Calculate.activity/calculate.py", line 444, in set_err
> or_equation
>     self.set_last_equation(eqn)
>   File "/usr/share/sugar/activities/Calculate.activity/calculate.py", line 439, in set_las
> t_equation
>     self.layout.last_eq.set_buffer(eqn.create_lasteq_textbuf())
>   File "/usr/share/sugar/activities/Calculate.activity/calculate.py", line 219, in create_
> lasteq_textbuf
>     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
>
>
>    1. 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'
>
> ------------------------------
>
> Best,
> Shaan
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20200701/112dba0e/attachment-0001.htm>


More information about the Sugar-devel mailing list