{"action":"created","issue":{"url":"https://api.github.com/repos/G-Node/nixpy/issues/249","repository_url":"https://api.github.com/repos/G-Node/nixpy","labels_url":"https://api.github.com/repos/G-Node/nixpy/issues/249/labels{/name}","comments_url":"https://api.github.com/repos/G-Node/nixpy/issues/249/comments","events_url":"https://api.github.com/repos/G-Node/nixpy/issues/249/events","html_url":"https://github.com/G-Node/nixpy/issues/249","id":211743041,"number":249,"title":"UnicodeDecodeError when setting tag units with unit of data array","user":{"login":"dEvasEnApati","id":5683202,"avatar_url":"https://avatars3.githubusercontent.com/u/5683202?v=3","gravatar_id":"","url":"https://api.github.com/users/dEvasEnApati","html_url":"https://github.com/dEvasEnApati","followers_url":"https://api.github.com/users/dEvasEnApati/followers","following_url":"https://api.github.com/users/dEvasEnApati/following{/other_user}","gists_url":"https://api.github.com/users/dEvasEnApati/gists{/gist_id}","starred_url":"https://api.github.com/users/dEvasEnApati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dEvasEnApati/subscriptions","organizations_url":"https://api.github.com/users/dEvasEnApati/orgs","repos_url":"https://api.github.com/users/dEvasEnApati/repos","events_url":"https://api.github.com/users/dEvasEnApati/events{/privacy}","received_events_url":"https://api.github.com/users/dEvasEnApati/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-03-03T16:54:02Z","updated_at":"2017-03-06T11:34:47Z","closed_at":null,"body":"Hi\r\n\r\nHere is an example with nixio v1.3.0\r\n\r\n    import nixio as nix\r\n    import numpy as np\r\n    \r\n    nixFile = nix.File.open('test.h5')\r\n    blk = nixFile.create_block('TestBlock', 'Test')\r\n    da = blk.create_data_array('TestDA', 'Test', data=np.random.rand(50))\r\n    da.unit = 'mV'\r\n    dim = da.append_sampled_dimension(1)\r\n    dim.unit = 's'\r\n    \r\n    tag = blk.create_tag('TestTag', 'Test', position=[10])\r\n    tag.extent = [10]\r\n    tag.references.append(da)\r\n    tag.units = [da.dimensions[0].unit]\r\n    nixFile.close()\r\n\r\n\r\nHere is the Traceback,\r\n\r\n      Traceback (most recent call last):\r\n      File \"tmp/nixioUnicodeBug.py\", line 14, in <module>\r\n        tag.units = [da.dimensions[0].unit]\r\n      File \"/home/aj/intel/intelpython27/envs/GJEMS/lib/python2.7/site-packages/nixio/pycore/tag.py\", line 51, in units\r\n        u = util.units.sanitizer(u)\r\n      File \"/home/aj/intel/intelpython27/envs/GJEMS/lib/python2.7/site-packages/nixio/pycore/util/units.py\", line 66, in sanitizer\r\n        replace(micro, \"u\").replace(mugr, \"u\")\r\n    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)\r\n\r\n\r\nI could get around it with\r\n\r\n    tag.units = [str(da.dimensions[0].unit)]\r\n\r\nIs this expected behavior? Thanks."},"comment":{"url":"https://api.github.com/repos/G-Node/nixpy/issues/comments/284372721","html_url":"https://github.com/G-Node/nixpy/issues/249#issuecomment-284372721","issue_url":"https://api.github.com/repos/G-Node/nixpy/issues/249","id":284372721,"user":{"login":"achilleas-k","id":2369197,"avatar_url":"https://avatars3.githubusercontent.com/u/2369197?v=3","gravatar_id":"","url":"https://api.github.com/users/achilleas-k","html_url":"https://github.com/achilleas-k","followers_url":"https://api.github.com/users/achilleas-k/followers","following_url":"https://api.github.com/users/achilleas-k/following{/other_user}","gists_url":"https://api.github.com/users/achilleas-k/gists{/gist_id}","starred_url":"https://api.github.com/users/achilleas-k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/achilleas-k/subscriptions","organizations_url":"https://api.github.com/users/achilleas-k/orgs","repos_url":"https://api.github.com/users/achilleas-k/repos","events_url":"https://api.github.com/users/achilleas-k/events{/privacy}","received_events_url":"https://api.github.com/users/achilleas-k/received_events","type":"User","site_admin":false},"created_at":"2017-03-06T11:34:47Z","updated_at":"2017-03-06T11:34:47Z","body":"Cool. Thanks for the extra info. I'll try to poke this bug to death later today... or tomorrow.\r\nOr soon.\r\nMost likely _soonish_."}}
{"actor":{"display_login":"achilleas-k"}}