Field Calculation: ERROR 000539

Discussion created by ldonahue on Nov 1, 2012
Latest reply on Nov 8, 2012 by krzychu
I have been trying to do a field calculation in ArcMap 10.0 sp5 and PYTHON_9.3 expression type, with not much success.

The field I am trying to calculate is a Text field with a length of 50, even though the data in that field "should" never have a length longer than 12 (it's not my data), it's just the way that field was created.

The error:
Start Time: Thu Nov 01 10:13:08 2012
ERROR 000539: <type 'exceptions.SyntaxError'>: EOL while scanning string literal (<expression>, line 1)
Failed to execute (Calculate Field).
Failed at Thu Nov 01 10:18:15 2012 (Elapsed Time: 5 minutes 7 seconds)

There are some feature attribute values in the field that have some kind of padding applied to them which is causing this error - I believe.

.strip() is not removing the whitespace, as the script will process about 80% of the records before it hits the one record causing the problem.

Can anyone tell what I'm missing?