mmeeks

r'  Raw String Suppress Escape not working in arcpy ArcGIS 10

Discussion created by mmeeks on Apr 20, 2011
Latest reply on Apr 20, 2011 by lpugh01
I'm converting all my 9.3.1 python scripts to 10.0 sp1 arcpy scripts and getting fatal crashes in IDLE when I use the r raw string when defining constants which worked fine in the 9.3.1 gp.

Example:
Layers = r'Road Centerline'
Scales = r'2000;900'
All = r'Recreate All Tiles'

arcpy.ManageMapServerCacheTiles_server("server","BaseCache/RoadCache", "Layers", Layers, Scales, All.......etc)

After I changed the constants to replace r with " it worked
Example:
Layers = "'Road Centerline'"
Scales = "'2000;900'"
All = "'Recreate All Tiles'"

I've used r for years with python and had no problems in the past.  It was a habit and am now having to change all references of r when used in an arcpy call.  The r still works with python functions such as open(r'C:\GIS Scripts\RoadCacheLog.txt', 'a')

Has arcpy been designed not to accept the r now?  because it worked with gp!

Mike

Outcomes