Whitespace Issue in Geoprocessing Tool

2040
3
04-27-2016 11:36 AM
benberman
Occasional Contributor

I'm encountering an issue with the custom python tools I have built not executing when there are whitespaces in the parameter names/paths. Otherwise, the tools execute just fine and return the expected outputs.

Is there a known resolution to this issue? The error that I encountered is something like; Dataset XYZ does not exist or is not supported.

Thanks.

0 Kudos
3 Replies
DanPatterson_Retired
MVP Emeritus

paths with spaces should be avoided at all costs... too many reasons to go into, but esri grids are particularly sensitive.  or do you mean your tool is producing 'whitespace' but not a space...in which case a screen grab is in order

benberman
Occasional Contributor

The former part of what you said..I agree that they should be avoided. I was just wondering if there was any way at all to work around this. If I use an out of the box ESRI tool and load a parameter with whitespace it doesn't seem to be a problem but in custom scripts it does appear to be an issue.

0 Kudos
DanPatterson_Retired
MVP Emeritus

you could try little things like ensuring paths use raw formatting, replace \ with \\ or better /  and a variety of other options assuming that this is python we are talking about.  I posted a blog on this topic

Filenames and file paths in Python

0 Kudos