#15 DrPython sometimes cannot find its own files

closed-works-for-me
nobody
None
5
2004-06-03
2004-04-28
kjnash
No

Bug:
DrPython sometimes cannot find its own files. This is not a
problem with the environment - if I run DrPython again, from
the same command prompt, it is fine. I suspect the problems
arise after I load or save files in a directory outside DrPython's
filesystem tree.

1. I get erratic errors with the Information menu items. On the
following run of DrPython, I tried Information/About, and
Information/Help (twice). No window appeared, but these
errors were reported to the console:

[user@localhost drpython-2.4.6]$ ./drpython.lin
Traceback (most recent call last):
File "/local/download/python/drpython-2.4.6/drpython.py", line
2996, in OnViewAbout
from drAboutDialog import drAboutDialog
ImportError: No module named drAboutDialog
Traceback (most recent call last):
File "/local/download/python/drpython-2.4.6/drpython.py", line
2990, in OnViewHelp
from drHelpDialog import drHelpDialog
ImportError: No module named drHelpDialog
Traceback (most recent call last):
File "/local/download/python/drpython-2.4.6/drpython.py", line
2990, in OnViewHelp
from drHelpDialog import drHelpDialog
ImportError: No module named drHelpDialog
[user@localhost drpython-2.4.6]$

2. When loading files from outside DrPython's tree, the second
load crashes DrPython, after bringing up a box with this
warning:

Bitmap Directory (/home/user/bitmaps) Does Not Exist.
This is either a bug with DrPython,
an error with your installation,
or the bitmap directory was simply removed.

3. Feature Request:
The help window blocks input to the main window. This is not
helpful if the user wants to try things out while reading the help.

My system is the same as in bug report [ 943575 ].

Discussion

  • Logged In: YES
    user_id=796750

    2: Launch drpython using drpython.pyw.
    drpython.py.drpython.lin. Different results?

    1: I am unable to produce this bug.

    3. Done in cvs, will be in the next version.
    Logged as a bug-report, feature request (A feature Request
    that is also a bug-report).

    So here are my questions:

    Try running wxPython demo.
    Do these problems only happen with drpython?
    Also, please try running the cvs version. Does that work
    for you at all?

     
  • kjnash
    kjnash
    2004-04-29

    Logged In: YES
    user_id=991282

    > drpython using drpython.pyw. drpython.py.drpython.lin
    Same in each case.

    Using lsof, I see that DrPython changes its CWD to that of the user's
    file, when the file is executed. This is when the problems begin.

    But the problems occur only if I run using a relative path, e.g. from
    the drpython-2.4.6 directory with the command "./drpython.lin". If I
    give the full path to drpython.lin on the command line, there is no
    bug, whichever directory I start in, whichever files I load/run/save.

    It seems that drpython works out its directory from $0, and looks for
    its files relative to that location. This is fine if $0 is an absolute path,
    but drpython gets confused if $0 is a relative path and the CWD has
    changed. In general, the value of os.getcwd() at startup, together
    with $0, will give the absolute path to the running script (there may be
    simpler ways).

     
  • Logged In: YES
    user_id=796750

    I have gone through the code, and tried messing around.

    This is not something I can reproduce, at all.

    Try downloading cvs.

    Try running the following script from "Dynamic DrScript":
    DrPrompt.SetText(str(sys.path))

    What do you get?

    Also:

    Try getting python 2.3 or newer.
    Try using wxPythonGTK instead of wxPythonGTK2.
    Try version 2.5.1

     
  • Logged In: YES
    user_id=796750

    what do you mean by second load?
    Are you running in SDI or MDI?

     
    • status: open --> closed-works-for-me
     
  • Logged In: YES
    user_id=796750

    Since I have not heard back in quite a while, and I cannot
    replicate this no matter how much I mess around, I am
    closing this bug.