OEPE - WLST Eclipse Plug-In Program Arguments Error (Doc ID 1662437.1)

Last updated on FEBRUARY 03, 2017

Applies to:

Oracle Enterprise Pack for Eclipse - Version 11.1.1.6.0 and later
Information in this document applies to any platform.

Symptoms

Using OEPE to run a script via "Run As WLST" will inappropriately change the current working directory based on the last sys.argv value provided via "Run Configurations - Program Arguments." This error doesn't happen when the script is run via "Debug as WLST."

Steps to reproduce the problem
1) First run the script without providing any program args. You will see that the current working directory is set appropriately.
2) Run the script with a program arg set to c:/windows/system. You will see that the current working directory has been set to c:/windows.
3) Run the script with a program arg set to c:/windows. You will see that the current working directory has been set to c:/.
4) Run the script with a program arg set to xyzzy. You will see an internal error (unless you have an xyzzy directory).

Below is the script
#Conditionally import wlstModule only when script is executed with jython
if __name__ == '__main__':
from wlstModule import *#@UnusedWildImport

print 'starting the script ....'

for arg in sys.argv:
print "Arg: " + arg

for f in os.listdir(os.curdir):
print f

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms