{"action":"created","issue":{"url":"https://api.github.com/repos/heinzK1X/pylibconfig2/issues/6","labels_url":"https://api.github.com/repos/heinzK1X/pylibconfig2/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/heinzK1X/pylibconfig2/issues/6/comments","events_url":"https://api.github.com/repos/heinzK1X/pylibconfig2/issues/6/events","html_url":"https://github.com/heinzK1X/pylibconfig2/pull/6","id":62539007,"number":6,"title":"Fix bug when parsing boolean value false","user":{"login":"juanmaneo","id":244045,"avatar_url":"https://avatars.githubusercontent.com/u/244045?v=3","gravatar_id":"","url":"https://api.github.com/users/juanmaneo","html_url":"https://github.com/juanmaneo","followers_url":"https://api.github.com/users/juanmaneo/followers","following_url":"https://api.github.com/users/juanmaneo/following{/other_user}","gists_url":"https://api.github.com/users/juanmaneo/gists{/gist_id}","starred_url":"https://api.github.com/users/juanmaneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juanmaneo/subscriptions","organizations_url":"https://api.github.com/users/juanmaneo/orgs","repos_url":"https://api.github.com/users/juanmaneo/repos","events_url":"https://api.github.com/users/juanmaneo/events{/privacy}","received_events_url":"https://api.github.com/users/juanmaneo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-17T23:05:45Z","updated_at":"2015-03-18T13:41:39Z","closed_at":"2015-03-18T10:00:28Z","pull_request":{"url":"https://api.github.com/repos/heinzK1X/pylibconfig2/pulls/6","html_url":"https://github.com/heinzK1X/pylibconfig2/pull/6","diff_url":"https://github.com/heinzK1X/pylibconfig2/pull/6.diff","patch_url":"https://github.com/heinzK1X/pylibconfig2/pull/6.patch"},"body":"\r\nHi, \r\n\r\nI'm actually testing your pylicbconfig2 to replace a native/boost-python implementation we use at work \r\nIn top of it, I coded a \"preprocessor\" function, to handle includes because our files are big and use that feature ...\r\nIf you feel it's something that could benefit the lib, I would be glad to share it.\r\n\r\nIn the process, I came across what I think is a bug with the handling of false as boolean, where the parser believe it's the start of an hexadecimal number.\r\n\r\nThe completed test and the fix are in this patch.\r\n"},"comment":{"url":"https://api.github.com/repos/heinzK1X/pylibconfig2/issues/comments/82976691","html_url":"https://github.com/heinzK1X/pylibconfig2/pull/6#issuecomment-82976691","issue_url":"https://api.github.com/repos/heinzK1X/pylibconfig2/issues/6","id":82976691,"user":{"login":"juanmaneo","id":244045,"avatar_url":"https://avatars.githubusercontent.com/u/244045?v=3","gravatar_id":"","url":"https://api.github.com/users/juanmaneo","html_url":"https://github.com/juanmaneo","followers_url":"https://api.github.com/users/juanmaneo/followers","following_url":"https://api.github.com/users/juanmaneo/following{/other_user}","gists_url":"https://api.github.com/users/juanmaneo/gists{/gist_id}","starred_url":"https://api.github.com/users/juanmaneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juanmaneo/subscriptions","organizations_url":"https://api.github.com/users/juanmaneo/orgs","repos_url":"https://api.github.com/users/juanmaneo/repos","events_url":"https://api.github.com/users/juanmaneo/events{/privacy}","received_events_url":"https://api.github.com/users/juanmaneo/received_events","type":"User","site_admin":false},"created_at":"2015-03-18T13:41:39Z","updated_at":"2015-03-18T13:41:39Z","body":"Yes, I care thanks.\r\n\r\nHere is the code for the include/file handling, I'm actually using.\r\nIt's not perfect but does the job.\r\n\r\ndef expandInclude(filename):\r\n    \"\"\"Expand the content of a file into a string\r\n    If @include directive are found also expand included file\r\n    In case recursion is detected or any RunTimeError is detected,\r\n    for example mutal inclusion of files:\r\n    the return value shall be None.\r\n    \"\"\"\r\n    def _expand_include_rec(filename):\r\n        for line in open(filename):\r\n            line_stripped = line.strip().replace(\"//\", \"#\")\r\n            if line_stripped.startswith('@include '):\r\n                include_to_clean = line_stripped.split(None, 1)[1]\r\n                include_filename = include_to_clean.replace('\"',\" \").strip()\r\n                for included_line in _expand_include_rec(include_filename):\r\n                    yield included_line\r\n            else:\r\n                yield line\r\n    try:\r\n        lines = []\r\n        for line in _expand_include_rec(filename):\r\n            lines.append(line)\r\n        return ''.join(lines)\r\n    except RuntimeError:\r\n        return None\r\n\r\nIt's largely inspired for this topic \r\nhttp://bytes.com/topic/python/answers/801673-parsing-text-file-include-define-directives\r\n\r\n"}}