Select to view content in your preferred language

CalculateField_management on table name with accent don't work

537
5
07-06-2022 04:48 AM
GrégoireC
Regular Contributor
Hello,
I have a table name with an accent and i want to do a calculate : 
 
arcpy.CalculateField_management("inTable_view", "Centralité__point___ATTACH"+".SEQ", calcExp, "VB")
 
But it's seems impossible to speficy a name with accent, i have this error :

 

ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000728: Field Centralité__point___ATTACH.SEQ does not exist within table
Failed to execute (CalculateField).

Failed to execute (ExtractionPJ).
Failed at Wed Jul  6 13:42:20 2022 (Elapsed Time: 20,79 seconds)

But it's work if i use manually the calculate tool with the same name : "Centralité__point___ATTACH"

 

0 Kudos
5 Replies
JohannesLindner
MVP Frequent Contributor

Try using a raw string:

arcpy.CalculateField_management("inTable_view"r"Centralité__point___ATTACH"+".SEQ"calcExp"VB")

 


Have a great day!
Johannes
0 Kudos
GrégoireC
Regular Contributor

Thank you Johannes but it's the same error.

0 Kudos
DanPatterson
MVP Esteemed Contributor

# -*- coding: utf-8 -*-

is that line in your script?  Although it shouldn't matter


... sort of retired...
0 Kudos
GrégoireC
Regular Contributor

Yes Dan, it's in the script.

0 Kudos
DanPatterson
MVP Esteemed Contributor

strange.  Is it a joined field?  You said it works in the calculatefield tool interface, but you would have to show more of the script in case the paths to the workspace aren't being read properly (or something else)


... sort of retired...
0 Kudos