{"action":"created","issue":{"url":"https://api.github.com/repos/hgrecco/pint/issues/437","repository_url":"https://api.github.com/repos/hgrecco/pint","labels_url":"https://api.github.com/repos/hgrecco/pint/issues/437/labels{/name}","comments_url":"https://api.github.com/repos/hgrecco/pint/issues/437/comments","events_url":"https://api.github.com/repos/hgrecco/pint/issues/437/events","html_url":"https://github.com/hgrecco/pint/issues/437","id":177647651,"number":437,"title":"Can't Open Custom Registry","user":{"login":"hohlraum","id":3930880,"avatar_url":"https://avatars.githubusercontent.com/u/3930880?v=3","gravatar_id":"","url":"https://api.github.com/users/hohlraum","html_url":"https://github.com/hohlraum","followers_url":"https://api.github.com/users/hohlraum/followers","following_url":"https://api.github.com/users/hohlraum/following{/other_user}","gists_url":"https://api.github.com/users/hohlraum/gists{/gist_id}","starred_url":"https://api.github.com/users/hohlraum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hohlraum/subscriptions","organizations_url":"https://api.github.com/users/hohlraum/orgs","repos_url":"https://api.github.com/users/hohlraum/repos","events_url":"https://api.github.com/users/hohlraum/events{/privacy}","received_events_url":"https://api.github.com/users/hohlraum/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-18T11:56:14Z","updated_at":"2016-09-20T10:52:57Z","closed_at":null,"body":"I have a registry file in the cwd called `pint_units.txt`, it can be opened and read with `io.open` but when I try to load it with pint I get the following error:\r\n```\r\n>>> import pint\r\n>>> pint.UnitRegistry('pint_units.txt')\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/usr/local/lib/python2.7/site-packages/pint/registry.py\", line 1411, in __init__\r\n    self._after_init()\r\n  File \"/usr/local/lib/python2.7/site-packages/pint/registry.py\", line 1221, in _after_init\r\n    super(SystemRegistry, self)._after_init()\r\n  File \"/usr/local/lib/python2.7/site-packages/pint/registry.py\", line 164, in _after_init\r\n    self.load_definitions(self._filename)\r\n  File \"/usr/local/lib/python2.7/site-packages/pint/registry.py\", line 353, in load_definitions\r\n    raise ValueError('While opening {0}\\n{1}'.format(file, msg))\r\nValueError: While opening pint_units.txt\r\nWhile opening constants_en.txt\r\n[Errno 2] No such file or directory: 'constants_en.txt'\r\n```\r\n\r\nNote the mismatched file names in the confusing error messages at the end. The result is more straightforward if I use a filename for a file that doesn't exist:\r\n\r\n```\r\n>>> pint.UnitRegistry('bogus.txt')\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/usr/local/lib/python2.7/site-packages/pint/registry.py\", line 1411, in __init__\r\n    \r\n  File \"/usr/local/lib/python2.7/site-packages/pint/registry.py\", line 1221, in _after_init\r\n    def _after_init(self):\r\n  File \"/usr/local/lib/python2.7/site-packages/pint/registry.py\", line 164, in _after_init\r\n    self.load_definitions(self._filename)\r\n  File \"/usr/local/lib/python2.7/site-packages/pint/registry.py\", line 353, in load_definitions\r\n    msg = getattr(e, 'message', '') or str(e)\r\nValueError: While opening bogus.txt\r\n[Errno 2] No such file or directory: 'bogus.txt'\r\n```"},"comment":{"url":"https://api.github.com/repos/hgrecco/pint/issues/comments/248268171","html_url":"https://github.com/hgrecco/pint/issues/437#issuecomment-248268171","issue_url":"https://api.github.com/repos/hgrecco/pint/issues/437","id":248268171,"user":{"login":"hohlraum","id":3930880,"avatar_url":"https://avatars.githubusercontent.com/u/3930880?v=3","gravatar_id":"","url":"https://api.github.com/users/hohlraum","html_url":"https://github.com/hohlraum","followers_url":"https://api.github.com/users/hohlraum/followers","following_url":"https://api.github.com/users/hohlraum/following{/other_user}","gists_url":"https://api.github.com/users/hohlraum/gists{/gist_id}","starred_url":"https://api.github.com/users/hohlraum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hohlraum/subscriptions","organizations_url":"https://api.github.com/users/hohlraum/orgs","repos_url":"https://api.github.com/users/hohlraum/repos","events_url":"https://api.github.com/users/hohlraum/events{/privacy}","received_events_url":"https://api.github.com/users/hohlraum/received_events","type":"User","site_admin":false},"created_at":"2016-09-20T10:52:57Z","updated_at":"2016-09-20T10:52:57Z","body":"No. The cwd has only a single file, `pint_units.txt`."}}
{"actor":{"display_login":"hohlraum"}}