Tk-nuke-writenode ERROR utf-8 codec can't decode byte

We have these error on Nuke 13 and we are doesn’t now how to fix it. In some shots Nuke 13 is crashing automatically on saving the scripts. We find a workarround because is not happening in Nuke 12. We create the script on 12 and after we open it in Nuke 13 but, when we create the SG-Write these error apears.
Any Idea?

Have you checked that you have updated to the latest tk-nuke-writenode and tk-nuke engine for proper Python 3 support?

On first glance it sounds like a Python2/3 issue.

Thanks Ricardo.
Yes is the last toolkit downloaded from last saturday without any modification on it, with SG Desktop 1.8.0.
All is super strange it only happens In one shot, I did a Tank unregister and same error, is like something was broken on the datebase on SG web with these shot.

Maybe a dupliacte shot? Like a shot removed and then remade with the same name?

Yes, maybe, but I tank unregistered the shot as well.
How these can affect if is unregistered and created again?
Thanks Ricardo

I think it would be wise to take a look at the tk-nuke and tk-desktop log files to see more details about your error.

You may have to turn on debug logging.

We had the same issue and discovered it had something to do with the file path that the writer reads from Nuke root name field.

Fixed it by converting the path to double backslashes.

file_path = nuke.Root()['name'].value()
file_path = file_path.replace("/", "\\\\")

Added this to the, that helps for preventing the crash.

if file_path:
 file_path = file_path.replace("/", os.path.sep)
 # fix to prevent Nuke v13 & v14 crashing on save, convert to double slashes
 file_path = file_path.replace("\\", "\\\\")

However, after publishing, the tk-nuke-writenode app converts the writer back from Nuke to Shotgrid write nodes and the paths set back to the single slashes. Hope this will be fixed properly in the toolkit soon.

1 Like

Not sure if you saw, but I believe this was just resolved going to implement the new tk-nuke-writenode commit today, since we also have the same issue in nuke 14.0: Corrected path normalization. (#50) · shotgunsoftware/tk-nuke-writenode@b44d5e9 · GitHub


That’s correct. Next version of tk-nuke-writenode will include this fix. The main reason it’s that newer Nuke (13+) uses Python 3 and this was a side effect. In the meantime you can use a git descriptor to use this merged fix.

Hi @carlos-villavicencio!
I hate to ask, but do you have an ETA when (roughly) this will be released? Would make my life a bit easier to have it in the app_store…

@Fabian Hello!
Good News: We’ve released v1.6.2 today!