I am currently working on a project that requires using a python/arcpy tool to allow a user to create a map series report PDF. Without getting into much detail, the tool is used when in ArcCatalog or ArcMap where the user uses the interface to select the appropriate parameters. The tool generates a PDF report that includes a title page, table of contents, map series, and various summary reports.
The tool generates a lot of temp files behind the scenes in order to generate the report. Since the user may run the tool several times while in an ArcMap session, these files need to be deleted, so no locks can remain on them when the tool is completed. I had no problems with the locks being removed, until I added a dynamic table to the map series MXD that uses the "production mapping" extension.
The table updates for each map page based on the features of interest on each map page. Once I added this table, the features in the map series mxd are locked in the file geodatabase even after the python tool ends (and I made sure that the mxd variable is deleted).
So my question is why won't the MXD "close" now that I added this dynamic table? Thanks for any help.