SystemError: error return without exception set

3200
5
10-17-2016 07:23 AM
MatthiasBuehler3
Occasional Contributor

Hi,

I have run into a script error today with some code that was not altered since and worked yesterday..

I have tracked it down to this example (some paths shortened):

import arcpy     

spatialRef = arcpy.Describe('Y:/......../xyz.gdb/BeispielLeitungenZ').spatialReference

array = arcpy.Array()

array.append(arcpy.Point(100000, 40000, 500))

array.append(arcpy.Point(100000, 42000, 510))

createCursor = arcpy.da.InsertCursor('...../xyz.gdb/Leitungen', ['SHAPE@', 'quellLeitung', 'quellStartMastenID', 'quellEndMastenID'])

 cable = arcpy.Polyline(array, spatialRef, True, False)

 createCursor.insertRow([cable, 1, 1, 1])

The error I get is: 

Traceback (most recent call last):  File ".....\pyScripts\createCables.py", line 37, in <module>    createCursor.insertRow([cable, 1, 1, 1])SystemError: error return without exception set

Failed to execute (createCables).

Does somebody have an idea why this could be?

The script runs fine with the last line commented out.

The attr table of the target FC shows the fields (correctly):

OBJECTID, Shape, Shape_Length, quellLeitung, quellStartMastenID, quellEndMastenID

This is hard to track down, as I have no clue what the exception actually is ..

Something with the software must have changed. [Or license? I'm actually switching accounts.]

Any input welcome! Thanks!

Matt

0 Kudos
5 Replies
JoshuaBixby
MVP Esteemed Contributor

If the code worked yesterday and stopped working today, I wonder whether the feature class or file geodatabase got corrupted.  What if you try the code using a freshly created file geodatabase with a freshly created feature class?

MatthiasBuehler3
Occasional Contributor

Hey .. I'll try that .. Thanks for the pointer!

Matt

EDIT:

No, that did not work either. The data is intact...

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

Did you create the code the other day and it worked that day, or has the code been around working for a while and just stopped working?  The sudden breakage doesn't make sense.  Did anything else change between one day and the next?  Different machine?  Different version of ArcGIS?  New software installed on the machine?  Did someone change the spatial reference of BeispielLeitungenZ so now it doesn't match the feature class you are trying to insert into?

0 Kudos
MatthiasBuehler3
Occasional Contributor

Hi,

It indeed was a change in the 'BeispielLeitungenZ' FC that was given back to me from an other person with added Z information of the point features, but the spatialReference of that new FC was different than the first one, which caused the error.

I had tracked all code down and the intermediate results were all still correct (point positions, ..), with the new data, which did not give me the clue of the wrong spatialRef.

0 Kudos
MatthiasBuehler3
Occasional Contributor

Turns out it was a combination of tests with a different projection/spatial reference.

I had worked on a copy I got with the same data, just in a different projection. It seems adding lines to a position outside the extent (far off) was the issue and this caused a non-defined error, which is not helpful ..

Issue solved. *phew*

0 Kudos