Skip to main content
Question

python error

  • November 5, 2014
  • 6 replies
  • 39 views

samisnunu
Contributor
Forum|alt.badge.img+10
Folks:

 

 

I keep getting the error, While using the following method in the code:

 

..

 

attrValue = feature.getAttribute(AttrXYZ)

 

 ... 
 Python Exception <AttributeError>: attribute has unsupported type 2014-11-05 11:19:162.00.0|WARN |Traceback (most recent call last): File "<string>", line 59in input File "C:\Program Files\FME\fmeobjects/python26\pyfme.py", line 199in getAttribute def getAttribute(*args): return _pyfme.FMEFeature_getAttribute(*args) AttributeError: attribute has unsupported type
 Note the attribute may contain nulls, and only raise the error while encountering a null value.

 

 

 

However, I tried to use the method "feature.getAttributeNullMissingAndType(attrName)"  to detect whenever the null attribute value occurs to skip it.

 

 

But I got another error: 
 Python Exception <AttributeError>: getAttributeNullMissingAndType 2014-11-05 11:25:582.10.0|WARN |Traceback (most recent call last): File "<string>", line 52in input File "C:\Program Files\FME\fmeobjects/python26\pyfme.py", line 121in <lambda> __getattr__ = lambda self, name: _swig_getattr(self, FMEFeature, name) File "C:\Program Files\FME\fmeobjects/python26\pyfme.py", line 34in _swig_getattr raise AttributeError,name AttributeError: getAttributeNullMissingAndType
 I'm using 

 

   FME 2014 SP3

 

   Python v 2.6

 

 

 

Any idea?

 

 

6 replies

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • November 6, 2014
empty string?

 

 

getAttributeNullMissingAndType returns a empty string when encountering a <NULL>

 

 

takashi
Influencer
  • November 6, 2014
Hi,

 

 

FME 2014 uses Python 2.7 by default. Why Python 2.6?

 

I guess there is an issue on the setting for Python environment.

 

 

Takashi

david_r
Celebrity
  • November 6, 2014
Hi,

 

 

I agree with Takashi, this behavior is very odd and I cannot reproduce it with my installation of FME 2014 SP4, not even when using a custom Python 2.6 interpreter.

 

 

If you insert a Logger just before the PythonCaller, what does it print as value for attribute "AttrXYZ" before the PythonCaller fails?

 

 

David

 

 

samisnunu
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • November 6, 2014
David -  the Logger indicates: attrXYZ value is <null>

 

 

Takashi - the python 2.6 is used to be in our working environment as we use ArcGIS 10.1. I'll double check to analyze if python 2.7 will solve this issue to request an upgrade to python 2.7

 

 

Gio-  shouldn't this method to return a tuple values with isNull = True? that confuesed me..

 

 

Thanks

samisnunu
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • November 6, 2014
Ok  - I tested the same script on a testing machine where the following are installed:

 

   ArcGIS 10.2.1

 

   FME 2014 SP4

 

   Python 2.7

 

 

I got the same error message:

 

"Python Exception <AttributeError>: attribute has unsupported type.

 

 

Looking into the full error message:

 

....

 

Python Exception <AttributeError>: attribute has unsupported type

 

Traceback (most recent call last):

 

File "<string>", line 48, in input

 

File "C:\\Program Files\\FME\\fmeobjects/python27\\pyfme.py", line 199, in getAttribute

 

def getAttribute(*args): return _pyfme.FMEFeature_getAttribute(*args)

 

AttributeError: attribute has unsupported type

 

Error encountered while calling method `input'

 

PythonFactory failed to process feature

 

PythonFactory failed to process feature

 

BADNEWS: A fatal error has occurred. Check the logfile above for details (dynafact.cpp:313)

 

Closing the Geodatabase reader

 

A fatal error has occurred. Check the logfile above for details

 

 

(stftrans.cpp:288) - (simptran.cpp:727) - (stftrans.cpp:318) - (pipeline.cpp:586) - (pipeline.cpp:739) - (factory.cpp:441) - (fcttee.cpp:283) - (factory.cpp:1033) - (pipeline.cpp:998) - (pipeline.cpp:739) - (factory.cpp:441) - (fcttest.cpp:471) - (factory.cpp:1122) - (factory.cpp:1033) - (pipeline.cpp:998) - (pipeline.cpp:739) - (factory.cpp:441) - (fcttee.cpp:283) - (factory.cpp:1033) - (pipeline.cpp:998) - (pipeline.cpp:739) - (factory.cpp:441) - (fcttee.cpp:283) - (factory.cpp:1033) - (pipeline.cpp:998) - (pipeline.cpp:739) - (factory.cpp:441) - (fcttest.cpp:471) - (factory.cpp:1122) - (factory.cpp:1033) - (pipeline.cpp:998) - (pipeline.cpp:739) - (factory.cpp:441) - (fcttee.cpp:283) - (factory.cpp:1033) - (pipeline.cpp:998) - (pipeline.cpp:739) - (factory.cpp:441) - (fctschmap.cpp:324) - (factory.cpp:1122) - (factory.cpp:1033) - (pipeline.cpp:998) - (pipeline.cpp:739) - (factory.cpp:441) - (fcttee.cpp:283) - (factory.cpp:1033) - (pipeline.cpp:998) - (pipeline.cpp:739) - (factory.cpp:441) - (dynafact.cpp:313)

 

 

 

 

samisnunu
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • November 10, 2014
Ok I found the cause of the issue...

 

The PythonCaller transformer should be upgraded in my script for the FME 2014 version. once updated, it worked like a charm..

 

 

 

 

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings