Select to view content in your preferred language

Error 000354 after 3.0, Can the path not contain a space?

339
2
09-02-2022 09:29 AM
ccowin_odfw
Frequent Contributor

Hello,

Had a script that was taking GPS points from a SQL database and putting them into a GDB. It was working fine in 2.8, but got upgraded to 3.0 and now it is throwing me 000354 errors which it has never done before. It is specifically failing at the following code:

 

# In the raw GDB select all rows with the same collar id and get the row count
fc = os.path.join(parameters[1].valueAsText, 'Locations')
where = f"""Collar_ID = '{collar_id}' And Entry_Staff = 'AUTOFILL'"""
scratch_fc = os.path.join(arcpy.env.scratchGDB, f'V{collar_id}')

# fc = '{Path that you dont need}\\Population Data\\GIS_Data\\Locations.gdb\\Locations'
# where = "Collar_ID = '14692' And Entry_Staff = 'AUTOFILL'"
# scratch_fc = 'C:\\Users\\cowinch\\AppData\\Local\\Temp\\scratch.gdb\\V14692'

if arcpy.Exists(scratch_fc):
    arcpy.Delete_management(scratch_fc)

selection = arcpy.analysis.Select(fc, scratch_fc, where)

 

The only thing I can think of that would cause the error is the space in the Population Data folder, but I thought it specifically referred to content within a GDB so I really have no idea why I'm getting this error. It has also worked previously so not sure what changed.

Anyone have any thoughts?

0 Kudos
2 Replies
by Anonymous User
Not applicable

Is this part of a loop?  Could there be trailing spaces in the collar_id variable?  There are also arcpy methods that you can use to validate the table names.  It might be worth using them to determine which names it says is not valid.

 

0 Kudos
ccowin_odfw
Frequent Contributor

It is, no trailing spaces but I just changed it from using the scratch GDB env parameter to an explicit one and that seemed to work. Must not have liked something about that path for some reason.

0 Kudos