{"action":"opened","issue":{"url":"https://api.github.com/repos/adamreeve/npTDMS/issues/98","repository_url":"https://api.github.com/repos/adamreeve/npTDMS","labels_url":"https://api.github.com/repos/adamreeve/npTDMS/issues/98/labels{/name}","comments_url":"https://api.github.com/repos/adamreeve/npTDMS/issues/98/comments","events_url":"https://api.github.com/repos/adamreeve/npTDMS/issues/98/events","html_url":"https://github.com/adamreeve/npTDMS/issues/98","id":355240813,"node_id":"MDU6SXNzdWUzNTUyNDA4MTM=","number":98,"title":"cannot write string to tdms ","user":{"login":"MayaGoldschmidt","id":42774747,"node_id":"MDQ6VXNlcjQyNzc0NzQ3","avatar_url":"https://avatars0.githubusercontent.com/u/42774747?v=4","gravatar_id":"","url":"https://api.github.com/users/MayaGoldschmidt","html_url":"https://github.com/MayaGoldschmidt","followers_url":"https://api.github.com/users/MayaGoldschmidt/followers","following_url":"https://api.github.com/users/MayaGoldschmidt/following{/other_user}","gists_url":"https://api.github.com/users/MayaGoldschmidt/gists{/gist_id}","starred_url":"https://api.github.com/users/MayaGoldschmidt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MayaGoldschmidt/subscriptions","organizations_url":"https://api.github.com/users/MayaGoldschmidt/orgs","repos_url":"https://api.github.com/users/MayaGoldschmidt/repos","events_url":"https://api.github.com/users/MayaGoldschmidt/events{/privacy}","received_events_url":"https://api.github.com/users/MayaGoldschmidt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-29T16:32:30Z","updated_at":"2018-08-29T16:32:30Z","closed_at":null,"author_association":"NONE","body":"I've been trying to write a string into a tdms file as part of the data, \r\n\r\n```\r\nwith TdmsWriter(\"path_to_file.tdms\") as tdms_writer:\r\n    data_array = \"trying to add this\"\r\n    \r\n    channel = ChannelObject('Group', 'Channel1', data_array)\r\n    tdms_writer.write_segment([channel])\r\n```\r\n\r\nbut I get the error:\r\n\r\n`TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'`\r\n\r\nIt traces back from the function writer.py:\r\n```\r\ndef _data_size(self):\r\n        data_size = 0\r\n        for obj in self.objects:\r\n            if obj.has_data:\r\n                data_size += len(obj.data) * obj.data_type.size\r\nreturn data_size\r\n```\r\nthat in **obj.data_type.size** there is a none type\r\n\r\nI tried changing the way I write the string in an array, as a numpy.array and many different ways but none of them seem to help.\r\n\r\nWhat I think the cause of the error is that a size is not defined in types.tdms in the function that defines a string, in every other type there is a size variable except in the string type. \r\n\r\nI'd be happy some assistance\r\n\r\npython version 3.6 \r\n\r\n\r\n"}}
{"actor":{"display_login":"MayaGoldschmidt"}}