Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock

Recently I became aware of two issues in mu-editor. A tool for beginning
python programmers.

I was informed that the "debug" button in mu-editors default python mode was
broken in the Debian packaged version of mu. While this does not render
the software totally unusable it is a pretty major deficiency.

The cause of the breakage is that the debug helper program 
/usr/share/mu-editor/mu-debug.py fails to find the python module mu.app
due to not having /usr/share/mu-editor in it's sys.path. The main mu executable
is in /usr/share/mu-editor, so it finds the modules through the default 
sys.path[0], but the debug helper script is in /usr/share/mu-editor/mu so it
does not find them. My fix was to make the debug helper script modify 
sys.path[0] before importing mu.app.

While working on the above issue I discovered that the clean target did not
clean up completely (in violation of policy 4.9) and this was making working on
the package irritating, so I added some extra rm commands to clean up the stray
files.

Is there any chance of getting at least the first and preferablly both of these
fixes into buster?

A debdiff is attatched. 

unblock mu-editor/1.0.2+dfsg-2.1
diff -Nru mu-editor-1.0.2+dfsg/debian/changelog 
mu-editor-1.0.2+dfsg/debian/changelog
--- mu-editor-1.0.2+dfsg/debian/changelog       2019-02-28 02:43:16.000000000 
+0000
+++ mu-editor-1.0.2+dfsg/debian/changelog       2019-06-13 02:03:44.000000000 
+0000
@@ -1,3 +1,12 @@
+mu-editor (1.0.2+dfsg-2.1) unstable; urgency=medium
+
+  * Non-Maintainer upload.
+  * Adjust sys.path[0] in mu/mu-debug.py so that debugger works
+    (Closes: 930457)
+  * Fix clean target.
+
+ -- Peter Michael Green <plugw...@debian.org>  Thu, 13 Jun 2019 02:03:44 +0000
+
 mu-editor (1.0.2+dfsg-2) unstable; urgency=medium
 
   * d/gbp.conf: use pristine-tar
diff -Nru mu-editor-1.0.2+dfsg/debian/patches/mu-debug-alter-sys.path.patch 
mu-editor-1.0.2+dfsg/debian/patches/mu-debug-alter-sys.path.patch
--- mu-editor-1.0.2+dfsg/debian/patches/mu-debug-alter-sys.path.patch   
1970-01-01 00:00:00.000000000 +0000
+++ mu-editor-1.0.2+dfsg/debian/patches/mu-debug-alter-sys.path.patch   
2019-06-13 02:03:44.000000000 +0000
@@ -0,0 +1,24 @@
+Description:  Adjust sys.path[0] in mu/mu-debug.py so that debugger works
+ Debian installs mu-editor's modules in a directory that is not on the
+ global python path. mu-editor finds the modules through sys.path[0]
+ pointing at /usr/share/mu-editor, unfortunately for mu-debug.py 
+ sys.path[0] is /usr/share/mu-editor/mu, so the modules are not found
+ adjust sys.path[0] in mu-editor.py to fix this issue
+Author: Peter Michael Green <plugw...@debian.org>
+Last-Update: 2019-06-13
+Bug-Debian: https://bugs.debian.org/930457
+
+--- mu-editor-1.0.2+dfsg.orig/mu/mu-debug.py
++++ mu-editor-1.0.2+dfsg/mu/mu-debug.py
+@@ -1,6 +1,11 @@
+ #!/usr/bin/env python3
+ import os
+ import sys
++
++#Remove last path element from sys.path[0] so that mu modules can be found 
relative to this executable.
++import os.path
++sys.path[0] = os.path.dirname(sys.path[0])
++
+ from mu.app import debug
+ 
+ 
diff -Nru mu-editor-1.0.2+dfsg/debian/patches/series 
mu-editor-1.0.2+dfsg/debian/patches/series
--- mu-editor-1.0.2+dfsg/debian/patches/series  2019-02-28 02:43:16.000000000 
+0000
+++ mu-editor-1.0.2+dfsg/debian/patches/series  2019-06-13 02:03:44.000000000 
+0000
@@ -8,3 +8,4 @@
 remove-non-dfsg-images-from-docs
 remove-non-dfsg-resources
 test_app_icon_as_string
+mu-debug-alter-sys.path.patch
diff -Nru mu-editor-1.0.2+dfsg/debian/rules mu-editor-1.0.2+dfsg/debian/rules
--- mu-editor-1.0.2+dfsg/debian/rules   2019-02-28 02:43:16.000000000 +0000
+++ mu-editor-1.0.2+dfsg/debian/rules   2019-06-13 02:03:44.000000000 +0000
@@ -27,6 +27,9 @@
 override_dh_auto_clean:
        dh_auto_clean
        rm -rf docs/html
+       rm -f debian/mu-editor.1
+       rm -f debian/mu-editor.1.md
+       rm -rf .pytest_cache
 
 override_dh_auto_build:
        dh_auto_build

Reply via email to