adornetto

Trouble with Feature Datasets in directories with spaces

Discussion created by adornetto on Jan 19, 2011
Latest reply on Oct 6, 2011 by csny490
I'm having a problem with a python script run using a toolbox script UI.  The user selects one or more feature datasets from a personal geodatabase to export to shapefiles.  The script iterates through each feature dataset and processes all feature classes within.  the code works fine unless the path for the personal geodatabase has a space.  So do I have to alter the dataset list in some way to account for the spaces?  Below is the code up to where it fails

import arcpy, sys, os, string
import logging
import os.path
import datetime
from arcpy import env

print "WorkSpace"

myWorkspace = sys.argv[1]
env.workspace = myWorkspace

myFDList = sys.argv[2]
myFDList = myFDList.replace(';', ',')
myFeatureDatasetList = myFDList.split(",")

myOutPath = sys.argv[3]


for myFD in myFeatureDatasetList:
    #for myFD in myWorkspace:
    #arcpy.AddMessage(myFDList)
    #arcpy.AddMessage("     ")
    #arcpy.AddMessage(myFeatureDatasetList)
    arcpy.AddMessage(myFD)
   
    desc = arcpy.Describe(myFD)

Outcomes