I have a script that runs a a scheduled task: it first deletes features in a target feature class and then appends features to that target from a source. That part of the script works fine. However, the last part of the script attempts to import meta data from the source to the target and fails with a generic error of "Object: Error in executing tool". I can run import metadata from an arc catalog python without a problem. Not sure what I should be looking for....
<SPAN class="keyword token">try</SPAN><SPAN class="punctuation token">:</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>MetadataImporter_conversion<SPAN class="punctuation token">(</SPAN>SourceFeatureClass<SPAN class="punctuation token">,</SPAN>TargetFeatureClass<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">'Successfully Imported Metadata From {} To {}'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>SourceFeatureClass<SPAN class="punctuation token">,</SPAN>TargetFeatureClass<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">except</SPAN> Exception <SPAN class="keyword token">as</SPAN> err<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN> err
sendEmail<SPAN class="punctuation token">(</SPAN>err<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>