mu-editor python debugger broken.

Bug #1835320 reported by peter green
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mu-editor (Ubuntu)
Fix Released
Low
Unassigned
Disco
Fix Released
Low
Unassigned

Bug Description

The "debug" function in mu-editor is broken in the version shipped in Ubuntu disco. Since mu is intended as a tool for teaching beginner programmers this servely limits it's usefulness.

Nick Morrot and I have already fixed this in sid and the fix from sid has already migrated to buster and eoan. I would like to see this fixed in disco
too.

[Test Case]

Install mu-editor and run it through the programs menu.

Make sure you are in "python 3" mode. On the first run a box should pop up to select the mode. On later runs you can change mode through the icon in the top left corner.

Write a small python program and click on the debug button. The expected behavior is that debugging starts, but instead

> Traceback (most recent call last):
>
> File "/usr/share/mu-editor/mu/mu-debug.py", line 4, in <module>
>
> from mu.app import debug
>
> ModuleNotFoundError: No module named 'mu'

[Analysis]

This is a python path issue. mu-editor's python modules are installed under /usr/share/mu-editor/ . The main editor binary is installed in /usr/share/mu-editor and so finds the modules successfully though sys.path[0], however the debugger script is installed in /usr/share/mu-editor/mu and so does not find the modules.

The fix is to tweak sys.path in the debugger script before loading mu modules.

[Regression Potential]

Potential for regression seems minimal. mu-editor is a leaf package and written in pure python, there are no compiled binaries in the package that could be affected by the compiler version. The debugger script in question is currently unusable so there doesn't seem much potential for making it worse.

When comparing the old and new binaries the only changes I could find other
than the intentional one were some date stamp changes on some image files
and some html footer changes as a result of a new sphinx version. Neither of
these seem likely to cause regressions.

peter green (plugwash)
Changed in mu-editor (Ubuntu):
status: New → Fix Released
Revision history for this message
peter green (plugwash) wrote :
description: updated
description: updated
peter green (plugwash)
description: updated
peter green (plugwash)
description: updated
Mathew Hodson (mhodson)
Changed in mu-editor (Ubuntu):
importance: Undecided → Low
Changed in mu-editor (Ubuntu Disco):
importance: Undecided → Low
Revision history for this message
Robie Basak (racb) wrote :

Hi peter,

This looks good! A couple of suggestions:

1. debian/changelog requires a bug reference to this bug (using the string "LP: #1835320") in order for Ubuntu's SRU process machinery to work properly.

2. Can I suggest that the changelog entry be changed to explain what is being fixed in a way that users might understand? I understand that users receiving stable updates sometimes read changelog entries to understand if they want them, and "add update-rtp-for-mu-debug" doesn't really explain anything from a user's perspective.

Changed in mu-editor (Ubuntu Disco):
status: New → Triaged
Revision history for this message
Robie Basak (racb) wrote :

> "add update-rtp-for-mu-debug" doesn't really explain anything from a user's perspective.

How about something like "Fix debug function"? I would have just uploaded but I didn't want to change text attributed to you without your permission (nor do I want to remove your attribution).

To be clear, I'm not asking that you use my exact wording or remove what you've already got there - I'm just requesting that text that users have a chance of understanding is present.

Revision history for this message
peter green (plugwash) wrote :

Thanks robbie, here is a new debdiff with the changelog changes you requested.

Revision history for this message
Robie Basak (racb) wrote :

Thank you! Uploaded to Disco. Now awaiting SRU team review (which I should not do because I sponsored).

Changed in mu-editor (Ubuntu Disco):
status: Triaged → In Progress
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello peter, or anyone else affected,

Accepted mu-editor into disco-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mu-editor/1.0.2+dfsg-2ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-disco to verification-done-disco. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-disco. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in mu-editor (Ubuntu Disco):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-disco
Revision history for this message
peter green (plugwash) wrote :

I can confirm that 1.0.2+dfsg2ubuntu0.1 from the disco proposed repo fixes the issue for me.

tags: added: verification-done-disco
removed: verification-needed-disco
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mu-editor - 1.0.2+dfsg-2ubuntu0.1

---------------
mu-editor (1.0.2+dfsg-2ubuntu0.1) disco; urgency=medium

  [Nick Morrott]
  * d/patches: add update-rtp-for-mu-debug (Closes: #930270) (LP: #1835320)
    - adapted from patch from Peter Green
    - fixes debugger function in python3 mode.

 -- Peter Michael Green <email address hidden> Thu, 04 Jul 2019 06:06:55 +0000

Changed in mu-editor (Ubuntu Disco):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for mu-editor has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.