Fix Cycles Python error when device name is not a valid UTF-8 string
Fix Cycles Python error when device name is not a valid UTF-8 string

This may fix or help diagnose T76378.

tangent-opensource/coreBlackbird,tangent-opensource/coreBlackbird,tangent-opensource/coreBlackbird