Script crashes after generating about 100 maps to png/pdf files with Arcpy

Discussion created by pkkj on Apr 28, 2012
Latest reply on May 14, 2012 by jbarrette-esristaff

I used Arcpy to create a script that generates a great amount of maps.

In the script the data source of a layer in mxd file was replaced repeatedly and then a new map came out.

However, the program always crashed after about 100 maps were generated.

I can continue this process, then after generating about 100 maps, it crashed again.

Both export to pdf and export to png have this problem.

If I export to png, I god
AttributeError: PageLayoutObject: Error in executing Export
when the script crashed.

Could somebody tells me what happens? Did I forget to release something? Or is it a bug in Arcpy?

Thank you very much.