{"action":"closed","issue":{"url":"https://api.github.com/repos/channelcat/sanic/issues/817","repository_url":"https://api.github.com/repos/channelcat/sanic","labels_url":"https://api.github.com/repos/channelcat/sanic/issues/817/labels{/name}","comments_url":"https://api.github.com/repos/channelcat/sanic/issues/817/comments","events_url":"https://api.github.com/repos/channelcat/sanic/issues/817/events","html_url":"https://github.com/channelcat/sanic/issues/817","id":238446294,"number":817,"title":"Configs loaded from environmental variables aren't properly typed","user":{"login":"ttpham0111","id":11918574,"avatar_url":"https://avatars3.githubusercontent.com/u/11918574?v=3","gravatar_id":"","url":"https://api.github.com/users/ttpham0111","html_url":"https://github.com/ttpham0111","followers_url":"https://api.github.com/users/ttpham0111/followers","following_url":"https://api.github.com/users/ttpham0111/following{/other_user}","gists_url":"https://api.github.com/users/ttpham0111/gists{/gist_id}","starred_url":"https://api.github.com/users/ttpham0111/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttpham0111/subscriptions","organizations_url":"https://api.github.com/users/ttpham0111/orgs","repos_url":"https://api.github.com/users/ttpham0111/repos","events_url":"https://api.github.com/users/ttpham0111/events{/privacy}","received_events_url":"https://api.github.com/users/ttpham0111/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-06-26T05:43:48Z","updated_at":"2017-06-27T04:54:55Z","closed_at":"2017-06-27T04:54:55Z","body":"When setting configs using environmental variables `export SANIC_REQUEST_TIMEOUT=30`\r\n\r\n```\r\napp = Sanic(__name__)\r\nprint(type(app.config.REQUEST_TIMEOUT))  #  <class 'str'>\r\n```\r\n\r\nThe problem is in this function\r\n```\r\n# .../sanic/config.py\r\n    def load_environment_vars(self):\r\n        \"\"\"\r\n        Looks for any SANIC_ prefixed environment variables and applies\r\n        them to the configuration if present.\r\n        \"\"\"\r\n        for k, v in os.environ.items():\r\n            if k.startswith(SANIC_PREFIX):\r\n                _, config_key = k.split(SANIC_PREFIX, 1)\r\n                self[config_key] = v  # os.environ values are always of type str\r\n```\r\n"}}
{"actor":{"display_login":"r0fls"}}