{"action":"created","issue":{"url":"https://api.github.com/repos/Unidata/netcdf4-python/issues/377","labels_url":"https://api.github.com/repos/Unidata/netcdf4-python/issues/377/labels{/name}","comments_url":"https://api.github.com/repos/Unidata/netcdf4-python/issues/377/comments","events_url":"https://api.github.com/repos/Unidata/netcdf4-python/issues/377/events","html_url":"https://github.com/Unidata/netcdf4-python/issues/377","id":63304785,"number":377,"title":"group.parent.filepath() returns garbage string","user":{"login":"AgilentGCMS","id":3866945,"avatar_url":"https://avatars.githubusercontent.com/u/3866945?v=3","gravatar_id":"","url":"https://api.github.com/users/AgilentGCMS","html_url":"https://github.com/AgilentGCMS","followers_url":"https://api.github.com/users/AgilentGCMS/followers","following_url":"https://api.github.com/users/AgilentGCMS/following{/other_user}","gists_url":"https://api.github.com/users/AgilentGCMS/gists{/gist_id}","starred_url":"https://api.github.com/users/AgilentGCMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AgilentGCMS/subscriptions","organizations_url":"https://api.github.com/users/AgilentGCMS/orgs","repos_url":"https://api.github.com/users/AgilentGCMS/repos","events_url":"https://api.github.com/users/AgilentGCMS/events{/privacy}","received_events_url":"https://api.github.com/users/AgilentGCMS/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-20T20:52:10Z","updated_at":"2015-03-21T04:02:37Z","closed_at":null,"body":"I am trying to get the file name from a group object of a netcdf-4 file. In a previous version of python-netcdf (1.0.7), this used to work (I still have it on another machine, which is how I can check):\r\n\r\n```python\r\nIn [1]: fid = Dataset('point/point_input.nc4','r')\r\n\r\nIn [2]: gid = fid.groups['CO2_ff']\r\n\r\nIn [3]: gid.parent.filepath()\r\nOut[3]: u'point/point_input.nc4'\r\n\r\nIn [4]: print gid.parent.filepath()\r\npoint/point_input.nc4\r\n```\r\n\r\nHowever, I recently updated to python-netcdf 1.1.7, and now this method does not work any more:\r\n\r\n```python\r\nIn [1]: fid = Dataset('point/point_input.nc4','r')\r\n\r\nIn [2]: gid = fid.groups['CO2_ff']\r\n\r\nIn [3]: gid.parent.filepath()\r\nOut[3]: u'p\\x00o\\x00i\\x00n\\x00t\\x00/\\x00p\\x00o\\x00i\\x00n\\x00t'\r\n\r\nIn [4]: print gid.parent.filepath()\r\npoint/point\r\n```\r\n\r\nSo the unicode version has these null characters \\x00 before each character, and the name is truncated at the first underscore. Is there another way of getting the file name from a group id?\r\n\r\nThanks,\r\nSourish Basu"},"comment":{"url":"https://api.github.com/repos/Unidata/netcdf4-python/issues/comments/84244296","html_url":"https://github.com/Unidata/netcdf4-python/issues/377#issuecomment-84244296","issue_url":"https://api.github.com/repos/Unidata/netcdf4-python/issues/377","id":84244296,"user":{"login":"jswhit","id":579593,"avatar_url":"https://avatars.githubusercontent.com/u/579593?v=3","gravatar_id":"","url":"https://api.github.com/users/jswhit","html_url":"https://github.com/jswhit","followers_url":"https://api.github.com/users/jswhit/followers","following_url":"https://api.github.com/users/jswhit/following{/other_user}","gists_url":"https://api.github.com/users/jswhit/gists{/gist_id}","starred_url":"https://api.github.com/users/jswhit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jswhit/subscriptions","organizations_url":"https://api.github.com/users/jswhit/orgs","repos_url":"https://api.github.com/users/jswhit/repos","events_url":"https://api.github.com/users/jswhit/events{/privacy}","received_events_url":"https://api.github.com/users/jswhit/received_events","type":"User","site_admin":false},"created_at":"2015-03-21T04:02:37Z","updated_at":"2015-03-21T04:02:37Z","body":"It may have more to do with the netcdf library version that was linked than the version of the python module.\r\n\r\nTry this on the working and non-working installations:\r\n\r\n    >>> import netCDF4\r\n    >>> netCDF4.__netcdf4libversion__\r\n    u'4.3.3-rc2'"}}