Comment 21 for bug 135320

Revision history for this message
John A Meinel (jameinel) wrote : Re: bzr merge - exceptions.UnicodeDecodeError

Now the question is what to do if inv_entry.symlink_target is genuinely a Unicode string (with non-ascii characters).
In 'WT4._generate_inventory' we do:
elif kind == 'symlink':
    inv_entry.executable = False
    inv_entry.text_size = None
    inv_entry.symlink_target = utf8_decode(fingerprint)[0]

So I'm guessing we should do something like:

    fingerprint = inv_entry.symlink_target
    if isinstance(fingerprint, unicode):
      fingerprint = fingerprint.encode('UTF-8')
    elif fingerprint is None:
      fingerprint = ''

Come to think of it, I *think* inv_entry.symlink_target should actually be Unicode all the time. (I'm not positive, though, so we might want some asserts to check the behavior.)