Hi, I've been trying to use a simple python script to replace values in a field. I am trying to abbreviate "court" to "CT" "Road" to "RD" and so on. The expression is valid but I still encounter the error. Rarely, it works, but most of the time I get an error message. Thanks!
Solved! Go to Solution.
Looking at your screenshot, there appears to be a space between the module name, re, and the function you are calling, sub. Is that space really there or is it some artifact on the screen? (Note, there should not be a space)
Can you describe what version you are seeing the error 999999 with this calculate field case? A few releases ago we added code to catch this NoneType error and raise a warning. If you are still seeing the issue in 2.5 I would love to better understand your data and repro case. Thanks
Error as of 2.5 that results from the replace() Nonetype exception:
Drew Flater, your screenshot isn't viewable, at least by me. I ran some test code and see a WARNING 002858, which I assume is now the expected result.
When I first replied to the OP, I didn't try to reproduce his error, I provided the comment on NULL since it was a historical issue with Pro and Field Calculator.