Bug 153733 - Debugger should start in same directory as runtime
Debugger should start in same directory as runtime
Status: RESOLVED FIXED
Product: python
Classification: Unclassified
Component: Debugger
6.x
PC Windows XP
: P3 (vote)
: 6.x
Assigned To: jymen
nbpythonqa
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-24 02:19 UTC by sinewalker
Modified: 2009-02-19 22:57 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
:


Attachments
script to test / reproduce issue 153733 (2.12 KB, text/x-python)
2008-11-26 09:58 UTC, sinewalker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sinewalker 2008-11-24 02:19:57 UTC
The current working directory (CWD) of the debugger session starts in the NetBeans install directory. This is fine
except if scripts are expecting the CWD to be the directory where the script is located. That is the normal case from
the shell, and also if you run the project from NetBeans without the debugger (e.g. with the F6 key).

Because the CWD is the NetBeans install directory, any python file operations for files expected to be in the same
directory as the script file will fail with "No such file or directory: ..." errors when run in the debugger, but will
work fine normally.

A work-around:

Set a break-point before opening any files etc. Start the debugger, run to the break-point, then issue this from the
interactive Debugging window:

>>> import os
>>> os.chdir('<path_to_project>/src')

You can then continue debugging with the runtime in the expected state.

Suggest the CWD should be the debugging project's /src directory, since this is what it is when you run the project
normally.
Comment 1 sinewalker 2008-11-26 09:58:43 UTC
Created attachment 74167 [details]
script to test / reproduce issue 153733
Comment 2 sinewalker 2008-11-26 09:59:41 UTC
Attachment is a Python script to reproduce this behaviour
Comment 3 jymen 2009-01-08 09:39:13 UTC
Fixed in 7.0 trunk build #545 and above 


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo