Status: New
Owner: ----

New issue 176 by Krause.Chr: solfege does not start if /usr/bin/mpd.py  
exists
http://code.google.com/p/solfege/issues/detail?id=176

What steps will reproduce the problem?
1. create a file called mpd.py in /usr/bin
(in Fedora just install mpich2: "yum install mpich2" which contains such a
file)
2. start solfege

What is the expected output?
solfege should start ;-)

What do you see instead?
Traceback (most recent call last):
   File "/usr/bin/solfege", line 75, in <module>
     import src.mainwin
   File "/usr/share/solfege/src/mainwin.py", line 105, in <module>
     import utils
   File "/usr/share/solfege/src/utils.py", line 23, in <module>
     import soundcard, cfg
   File "/usr/share/solfege/soundcard/__init__.py", line 34, in <module>
     from mpd.track import Track, PercussionTrack
ImportError: No module named track


What version of the product are you using? On what operating system?
3.14.11

Please provide any additional information below.
The reason seems to be that sys.path contains as first element the
directory where the python script was started from. Since there is mpd.py
it tries to find "track" in this file which is obviously not successful.

Since run-solfege.py(.in) seems to be used only as /usr/bin/solfege (and
not for starting solfege out of the source directory, for this purpose
there is solfege.py), I think it would be rather safe to remove sys.path[0]
in run-solfege.py:

--- run-solfege.py.old      2010-03-06 01:03:10.000000000 +0100
+++ run-solfege.py    2010-03-06 01:19:42.000000000 +0100
@@ -32,6 +32,8 @@
  sys.path.insert(1, os.path.join(prefix, "lib", "solfege"))
  sys.path.insert(1, os.path.join(prefix, "share", "solfege"))

+sys.path.pop(0)
+
  import src
  import src.cfg
  from src import filesystem


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Solfege-devel mailing list
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe", or visit
https://lists.sourceforge.net/lists/listinfo/solfege-devel

Reply via email to