Here is the working script.
After replacing "row.setValue("SHAPE", newLine)" with "row = newLine" (to be consistent with the arcpy.da.UpdateCursor format), the original script still failed because the original data is in a geographic coordinate system and offsetting a second polyline vertex only 0.0001 decimal degrees from the origin vertex resulted in ArcPy snapping the vertices together, back into a zero-length polyline. I attempted to add a projected spatial reference to my update cursor, but then ArcPy, apparently recognizing a zero-length polyline, deleted ALL vertices from the feature, so that it no longer had any origin vertex from which to build.
I overcame this problem by running the update cursor in 2 iterations. The first iteration identifies zero-length features, and adds a second vertex 0.001 decimal degrees from the origin (this being far enough away that ArcPy doesn't snap them back together). It also tags a new "FLAG" attribute so that the second iteration knows which features to alter.
Now that there is a legitimate polyline, the second iteration runs the cursor on flagged records in a projected coordinate system, allowing the script to create a polyline that begins at the origin and ends 1 meter away in both X and Y directions.
oilZoneFC = "T:\\Temp\\processing.gdb\\TEST"
arcpy.AddField_management(oilZoneFC, "FLAG", "SHORT")
with arcpy.da.UpdateCursor(oilZoneFC, ["SHAPE@", "FLAG"]) as cursor:
arcpy.AddMessage("\nFirst Iteration - Identify Zero-Length Features and Add Vertex")
for row in cursor:
length = row.getLength('GEODESIC', 'METERS')
arcpy.AddMessage("Length = " + str(length) + " meters")
if length == 0.0:
arcpy.AddMessage("ZERO LENGTH FEATURE MODIFIED")
for part in row:
origX = part.X
origY = part.Y
newX = origX + 0.001
newY = origY + 0.001
newCoord = arcpy.Array([arcpy.Point(origX, origY), arcpy.Point(newX, newY)])
newLine = arcpy.Polyline(newCoord)
row = newLine
row = 1
with arcpy.da.UpdateCursor(oilZoneFC, ["SHAPE@", "FLAG"], spatial_reference = arcpy.SpatialReference(3310)) as cursor2: #change spatial ref of cursor to Teale Albers NAD83
arcpy.AddMessage("\nSecond Iteration - Adjust Zero-Length Features to 1 Meter Length")
for row2 in cursor2:
length = row2.getLength('GEODESIC', 'METERS')
arcpy.AddMessage("Length2 = " + str(length) + " meters")
if row2 == 1:
arcpy.AddMessage("FEATURE ADJUSTED TO 1 METER LENGTH")
for part2 in row2:
origX2 = part2.X
origY2 = part2.Y
newX2 = origX2 + 1
newY2 = origY2 + 1
newCoord2 = arcpy.Array([arcpy.Point(origX2, origY2), arcpy.Point(newX2, newY2)])
newLine2 = arcpy.Polyline(newCoord2)
row2 = newLine2