I see there are a number of posts about the “Cannot create PyString with non-byte value”.
Unfortunately I’m not seeing a solution for the error as it is getting generated in my script.
I’m using the system.dataset.toDataSet(headers, data) function to create a dataset that will be bound to a Perspective Table component.
The code that creates the data list is convoluted, but the values are either being hard coded or coming from DB queries. I logged the contents of the list and it is shown below with the headers assignment and the toDataSet instruction:
headers = ['lot', 'qty_ordered', 'qty_complete_last_op', 'qty_rejected', 'next_operation', 'status']
data = [
['12345678-1', 25, 25, 0, u'Cycle', 'Idle'],
['12345678-2', 25, 25, 0, u'Cycle', 'Idle'],
['12345678-3', 9, 8, 1, 'Inspection (CURRENT)', 'ACTIVE'],
['12345678-4', 30, 30, 0, u'Cycle', 'Idle']
]
tableDataset = system.dataset.toDataSet(headers, data)
When I take this data list and headers list to the Script Console and create the dataset, it works fine.
My understanding of the error is that a not Unicode character is in a string that is being inserted in the dataset (that is my sophomoric interpretation of the error). If this is correct, then I’m not seeing the offending character. Maybe it is a nonprintable character (since it isn’t Unicode maybe).
The version is 8.1.10.
How do I fix this (find the offending item)?