After digging in more, he's the senario...
I have a bunch of metadata which I am trying to apply with: obj.metadata.apply_atomic_operations( *AVU_list )
The way this situation occurs is, that call fails because one of the values has non-printable values: SkopeCalX��# 2d1
The way the code used to work was, after a failure to apply an AVU list, the code would fall back to trying to apply each AVU indifidually using obj.metadata.add().
In that case, sinse this is a rare case, the attribute and value strings are run through the following function to convert any 'bad' chars to '_' before using obj.metadata.add(). The value string becomes: SkopeCalX______#_2d1 None the less, that add, and infact all others on the same object, would fail with the exception noted earlier.
Since then, I've noticed that it appears that the that the first call via apply_atomic_operations( *AVU_List ) did apply the metadata, but sent me down the repare path by raising an exception. What I just tried is intercepting and 'fixing' the 'bad' string before the initial call to apply_atomic_operations(). This makes the first call work.
So, it seems like while obj.apply_atomic_operations( *AVU_list ) is depositing all the metadata on the object, it is not returning cleanly. And then the later calls to obj.metadata.add() all fail with the invalid token exception.
Since almost always (years now), I don't get 'bad' chars in the metadata, I'd like continue the call w/o the conversion of bytes outside 0x20 - 0x7E to underbars, but I guess if that's required, I can do it.
Thanks for considering this issue!