We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Timeout not converted to int
**Describe the bug**
<!-- A clear and concise description of what the bug is. -->

No request can be made with the current code. The timeout specified has to be an int, but the config stores it as a string.

**To Reproduce**
Steps to reproduce the behavior:

```python
reddit.request("tesT")
```

**Expected behavior**

Timeout works and the request goes through.

**Code/Logs**

```
In [4]: reddit.subreddit("The_Donald").subscribers                                                                      
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
~/.virtualenvs/praw/venv/lib/python3.7/site-packages/urllib3/util/timeout.py in _validate_timeout(cls, value, name)
    139         try:
--> 140             if value <= 0:
    141                 raise ValueError(

TypeError: '<=' not supported between instances of 'str' and 'int'

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
~/.virtualenvs/praw/venv/lib/python3.7/site-packages/prawcore/requestor.py in request(self, timeout, *args, **kwargs)
     52         try:
---> 53             return self._http.request(*args, timeout=timeout, **kwargs)
     54         except Exception as exc:

~/.virtualenvs/praw/venv/lib/python3.7/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    529         send_kwargs.update(settings)
--> 530         resp = self.send(prep, **send_kwargs)
    531 

~/.virtualenvs/praw/venv/lib/python3.7/site-packages/requests/sessions.py in send(self, request, **kwargs)
    642         # Send the request
--> 643         r = adapter.send(request, **kwargs)
    644 

~/.virtualenvs/praw/venv/lib/python3.7/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    434         else:
--> 435             timeout = TimeoutSauce(connect=timeout, read=timeout)
    436 

~/.virtualenvs/praw/venv/lib/python3.7/site-packages/urllib3/util/timeout.py in __init__(self, total, connect, read)
     95     def __init__(self, total=None, connect=_Default, read=_Default):
---> 96         self._connect = self._validate_timeout(connect, "connect")
     97         self._read = self._validate_timeout(read, "read")

~/.virtualenvs/praw/venv/lib/python3.7/site-packages/urllib3/util/timeout.py in _validate_timeout(cls, value, name)
    149                 "Timeout value %s was %s, but it must be an "
--> 150                 "int, float or None." % (name, value)
    151             )

ValueError: Timeout value connect was 16, but it must be an int, float or None.

During handling of the above exception, another exception occurred:

RequestException                          Traceback (most recent call last)
<ipython-input-4-a5aa025940f1> in <module>
----> 1 reddit.subreddit("The_Donald").subscribers

~/PycharmProjects/praw/praw/models/reddit/base.py in __getattr__(self, attribute)
     31         """Return the value of `attribute`."""
     32         if not attribute.startswith("_") and not self._fetched:
---> 33             self._fetch()
     34             return getattr(self, attribute)
     35         raise AttributeError(

~/PycharmProjects/praw/praw/models/reddit/subreddit.py in _fetch(self)
    514 
    515     def _fetch(self):
--> 516         data = self._fetch_data()
    517         data = data["data"]
    518         other = type(self)(self._reddit, _data=data)

~/PycharmProjects/praw/praw/models/reddit/subreddit.py in _fetch_data(self)
    511         name, fields, params = self._fetch_info()
    512         path = API_PATH[name].format(**fields)
--> 513         return self._reddit.request("GET", path, params)
    514 
    515     def _fetch(self):

~/PycharmProjects/praw/praw/reddit.py in request(self, method, path, params, data, files)
    661                 files=files,
    662                 params=params,
--> 663                 timeout=self.config.timeout,
    664             )
    665         except BadRequest as exception:

~/.virtualenvs/praw/venv/lib/python3.7/site-packages/prawcore/sessions.py in request(self, method, path, data, files, json, params, timeout)
    334             params=params,
    335             timeout=timeout,
--> 336             url=url,
    337         )
    338 

~/.virtualenvs/praw/venv/lib/python3.7/site-packages/prawcore/sessions.py in _request_with_retries(self, data, files, json, method, params, timeout, url, retry_strategy_state)
    233             retry_strategy_state,
    234             timeout,
--> 235             url,
    236         )
    237 

~/.virtualenvs/praw/venv/lib/python3.7/site-packages/prawcore/sessions.py in _make_request(self, data, files, json, method, params, retry_strategy_state, timeout, url)
    193                 json=json,
    194                 params=params,
--> 195                 timeout=timeout,
    196             )
    197             log.debug(

~/.virtualenvs/praw/venv/lib/python3.7/site-packages/prawcore/rate_limit.py in call(self, request_function, set_header_callback, *args, **kwargs)
     34         self.delay()
     35         kwargs["headers"] = set_header_callback()
---> 36         response = request_function(*args, **kwargs)
     37         self.update(response.headers)
     38         return response

~/.virtualenvs/praw/venv/lib/python3.7/site-packages/prawcore/requestor.py in request(self, timeout, *args, **kwargs)
     53             return self._http.request(*args, timeout=timeout, **kwargs)
     54         except Exception as exc:
---> 55             raise RequestException(exc, args, kwargs)

RequestException: error with request Timeout value connect was 16, but it must be an int, float or None.
```

**System Info**
 - OS: MacOS 10.14.6
 - Python: 3.7.7
 - PRAW Version: 7.0.0dev0


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `praw/config.py`
Content:
```
1 """Provides the code to load PRAW's configuration file `praw.ini`."""
2 import configparser
3 import os
4 import sys
5 from threading import Lock
6 from typing import Optional
7 
8 from .exceptions import ClientException
9 
10 
11 class _NotSet:
12     def __bool__(self):
13         return False
14 
15     __nonzero__ = __bool__
16 
17     def __str__(self):
18         return "NotSet"
19 
20 
21 class Config:
22     """A class containing the configuration for a reddit site."""
23 
24     CONFIG = None
25     CONFIG_NOT_SET = _NotSet()  # Represents a config value that is not set.
26     LOCK = Lock()
27     INTERPOLATION_LEVEL = {
28         "basic": configparser.BasicInterpolation,
29         "extended": configparser.ExtendedInterpolation,
30     }
31 
32     @staticmethod
33     def _config_boolean(item):
34         if isinstance(item, bool):
35             return item
36         return item.lower() in {"1", "yes", "true", "on"}
37 
38     @classmethod
39     def _load_config(cls, config_interpolation: Optional[str] = None):
40         """Attempt to load settings from various praw.ini files."""
41         if config_interpolation is not None:
42             interpolator_class = cls.INTERPOLATION_LEVEL[
43                 config_interpolation
44             ]()
45         else:
46             interpolator_class = None
47         config = configparser.ConfigParser(interpolation=interpolator_class)
48         module_dir = os.path.dirname(sys.modules[__name__].__file__)
49         if "APPDATA" in os.environ:  # Windows
50             os_config_path = os.environ["APPDATA"]
51         elif "XDG_CONFIG_HOME" in os.environ:  # Modern Linux
52             os_config_path = os.environ["XDG_CONFIG_HOME"]
53         elif "HOME" in os.environ:  # Legacy Linux
54             os_config_path = os.path.join(os.environ["HOME"], ".config")
55         else:
56             os_config_path = None
57         locations = [os.path.join(module_dir, "praw.ini"), "praw.ini"]
58         if os_config_path is not None:
59             locations.insert(1, os.path.join(os_config_path, "praw.ini"))
60         config.read(locations)
61         cls.CONFIG = config
62 
63     @property
64     def short_url(self) -> str:
65         """Return the short url or raise a ClientException when not set."""
66         if self._short_url is self.CONFIG_NOT_SET:
67             raise ClientException("No short domain specified.")
68         return self._short_url
69 
70     def __init__(
71         self,
72         site_name: str,
73         config_interpolation: Optional[str] = None,
74         **settings: str
75     ):
76         """Initialize a Config instance."""
77         with Config.LOCK:
78             if Config.CONFIG is None:
79                 self._load_config(config_interpolation)
80 
81         self._settings = settings
82         self.custom = dict(Config.CONFIG.items(site_name), **settings)
83 
84         self.client_id = self.client_secret = self.oauth_url = None
85         self.reddit_url = self.refresh_token = self.redirect_uri = None
86         self.password = self.user_agent = self.username = None
87 
88         self._initialize_attributes()
89 
90     def _fetch(self, key):
91         value = self.custom[key]
92         del self.custom[key]
93         return value
94 
95     def _fetch_default(self, key, default=None):
96         if key not in self.custom:
97             return default
98         return self._fetch(key)
99 
100     def _fetch_or_not_set(self, key):
101         if key in self._settings:  # Passed in values have the highest priority
102             return self._fetch(key)
103 
104         env_value = os.getenv("praw_{}".format(key))
105         ini_value = self._fetch_default(key)  # Needed to remove from custom
106 
107         # Environment variables have higher priority than praw.ini settings
108         return env_value or ini_value or self.CONFIG_NOT_SET
109 
110     def _initialize_attributes(self):
111         self._short_url = (
112             self._fetch_default("short_url") or self.CONFIG_NOT_SET
113         )
114         self.check_for_updates = self._config_boolean(
115             self._fetch_or_not_set("check_for_updates")
116         )
117         self.kinds = {
118             x: self._fetch("{}_kind".format(x))
119             for x in [
120                 "comment",
121                 "message",
122                 "redditor",
123                 "submission",
124                 "subreddit",
125                 "trophy",
126             ]
127         }
128 
129         for attribute in (
130             "client_id",
131             "client_secret",
132             "redirect_uri",
133             "refresh_token",
134             "password",
135             "user_agent",
136             "username",
137         ):
138             setattr(self, attribute, self._fetch_or_not_set(attribute))
139 
140         for required_attribute in ("oauth_url", "reddit_url", "timeout"):
141             setattr(self, required_attribute, self._fetch(required_attribute))
142
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/praw/config.py b/praw/config.py
--- a/praw/config.py
+++ b/praw/config.py
@@ -139,3 +139,16 @@
 
         for required_attribute in ("oauth_url", "reddit_url", "timeout"):
             setattr(self, required_attribute, self._fetch(required_attribute))
+
+        for attribute, conversion in {"timeout": int}.items():
+            try:
+                setattr(self, attribute, conversion(getattr(self, attribute)))
+            except ValueError:
+                raise ValueError(
+                    "An incorrect config type was given for option {}. The "
+                    "expected type is {}, but the given value is {}.".format(
+                        attribute,
+                        conversion.__name__,
+                        getattr(self, attribute),
+                    )
+                )

{"golden_diff": "diff --git a/praw/config.py b/praw/config.py\n--- a/praw/config.py\n+++ b/praw/config.py\n@@ -139,3 +139,16 @@\n \n         for required_attribute in (\"oauth_url\", \"reddit_url\", \"timeout\"):\n             setattr(self, required_attribute, self._fetch(required_attribute))\n+\n+        for attribute, conversion in {\"timeout\": int}.items():\n+            try:\n+                setattr(self, attribute, conversion(getattr(self, attribute)))\n+            except ValueError:\n+                raise ValueError(\n+                    \"An incorrect config type was given for option {}. The \"\n+                    \"expected type is {}, but the given value is {}.\".format(\n+                        attribute,\n+                        conversion.__name__,\n+                        getattr(self, attribute),\n+                    )\n+                )\n", "issue": "Timeout not converted to int\n**Describe the bug**\r\n<!-- A clear and concise description of what the bug is. -->\r\n\r\nNo request can be made with the current code. The timeout specified has to be an int, but the config stores it as a string.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n\r\n```python\r\nreddit.request(\"tesT\")\r\n```\r\n\r\n**Expected behavior**\r\n\r\nTimeout works and the request goes through.\r\n\r\n**Code/Logs**\r\n\r\n```\r\nIn [4]: reddit.subreddit(\"The_Donald\").subscribers                                                                      \r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n~/.virtualenvs/praw/venv/lib/python3.7/site-packages/urllib3/util/timeout.py in _validate_timeout(cls, value, name)\r\n    139         try:\r\n--> 140             if value <= 0:\r\n    141                 raise ValueError(\r\n\r\nTypeError: '<=' not supported between instances of 'str' and 'int'\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nValueError                                Traceback (most recent call last)\r\n~/.virtualenvs/praw/venv/lib/python3.7/site-packages/prawcore/requestor.py in request(self, timeout, *args, **kwargs)\r\n     52         try:\r\n---> 53             return self._http.request(*args, timeout=timeout, **kwargs)\r\n     54         except Exception as exc:\r\n\r\n~/.virtualenvs/praw/venv/lib/python3.7/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)\r\n    529         send_kwargs.update(settings)\r\n--> 530         resp = self.send(prep, **send_kwargs)\r\n    531 \r\n\r\n~/.virtualenvs/praw/venv/lib/python3.7/site-packages/requests/sessions.py in send(self, request, **kwargs)\r\n    642         # Send the request\r\n--> 643         r = adapter.send(request, **kwargs)\r\n    644 \r\n\r\n~/.virtualenvs/praw/venv/lib/python3.7/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)\r\n    434         else:\r\n--> 435             timeout = TimeoutSauce(connect=timeout, read=timeout)\r\n    436 \r\n\r\n~/.virtualenvs/praw/venv/lib/python3.7/site-packages/urllib3/util/timeout.py in __init__(self, total, connect, read)\r\n     95     def __init__(self, total=None, connect=_Default, read=_Default):\r\n---> 96         self._connect = self._validate_timeout(connect, \"connect\")\r\n     97         self._read = self._validate_timeout(read, \"read\")\r\n\r\n~/.virtualenvs/praw/venv/lib/python3.7/site-packages/urllib3/util/timeout.py in _validate_timeout(cls, value, name)\r\n    149                 \"Timeout value %s was %s, but it must be an \"\r\n--> 150                 \"int, float or None.\" % (name, value)\r\n    151             )\r\n\r\nValueError: Timeout value connect was 16, but it must be an int, float or None.\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nRequestException                          Traceback (most recent call last)\r\n<ipython-input-4-a5aa025940f1> in <module>\r\n----> 1 reddit.subreddit(\"The_Donald\").subscribers\r\n\r\n~/PycharmProjects/praw/praw/models/reddit/base.py in __getattr__(self, attribute)\r\n     31         \"\"\"Return the value of `attribute`.\"\"\"\r\n     32         if not attribute.startswith(\"_\") and not self._fetched:\r\n---> 33             self._fetch()\r\n     34             return getattr(self, attribute)\r\n     35         raise AttributeError(\r\n\r\n~/PycharmProjects/praw/praw/models/reddit/subreddit.py in _fetch(self)\r\n    514 \r\n    515     def _fetch(self):\r\n--> 516         data = self._fetch_data()\r\n    517         data = data[\"data\"]\r\n    518         other = type(self)(self._reddit, _data=data)\r\n\r\n~/PycharmProjects/praw/praw/models/reddit/subreddit.py in _fetch_data(self)\r\n    511         name, fields, params = self._fetch_info()\r\n    512         path = API_PATH[name].format(**fields)\r\n--> 513         return self._reddit.request(\"GET\", path, params)\r\n    514 \r\n    515     def _fetch(self):\r\n\r\n~/PycharmProjects/praw/praw/reddit.py in request(self, method, path, params, data, files)\r\n    661                 files=files,\r\n    662                 params=params,\r\n--> 663                 timeout=self.config.timeout,\r\n    664             )\r\n    665         except BadRequest as exception:\r\n\r\n~/.virtualenvs/praw/venv/lib/python3.7/site-packages/prawcore/sessions.py in request(self, method, path, data, files, json, params, timeout)\r\n    334             params=params,\r\n    335             timeout=timeout,\r\n--> 336             url=url,\r\n    337         )\r\n    338 \r\n\r\n~/.virtualenvs/praw/venv/lib/python3.7/site-packages/prawcore/sessions.py in _request_with_retries(self, data, files, json, method, params, timeout, url, retry_strategy_state)\r\n    233             retry_strategy_state,\r\n    234             timeout,\r\n--> 235             url,\r\n    236         )\r\n    237 \r\n\r\n~/.virtualenvs/praw/venv/lib/python3.7/site-packages/prawcore/sessions.py in _make_request(self, data, files, json, method, params, retry_strategy_state, timeout, url)\r\n    193                 json=json,\r\n    194                 params=params,\r\n--> 195                 timeout=timeout,\r\n    196             )\r\n    197             log.debug(\r\n\r\n~/.virtualenvs/praw/venv/lib/python3.7/site-packages/prawcore/rate_limit.py in call(self, request_function, set_header_callback, *args, **kwargs)\r\n     34         self.delay()\r\n     35         kwargs[\"headers\"] = set_header_callback()\r\n---> 36         response = request_function(*args, **kwargs)\r\n     37         self.update(response.headers)\r\n     38         return response\r\n\r\n~/.virtualenvs/praw/venv/lib/python3.7/site-packages/prawcore/requestor.py in request(self, timeout, *args, **kwargs)\r\n     53             return self._http.request(*args, timeout=timeout, **kwargs)\r\n     54         except Exception as exc:\r\n---> 55             raise RequestException(exc, args, kwargs)\r\n\r\nRequestException: error with request Timeout value connect was 16, but it must be an int, float or None.\r\n```\r\n\r\n**System Info**\r\n - OS: MacOS 10.14.6\r\n - Python: 3.7.7\r\n - PRAW Version: 7.0.0dev0\r\n\n", "before_files": [{"content": "\"\"\"Provides the code to load PRAW's configuration file `praw.ini`.\"\"\"\nimport configparser\nimport os\nimport sys\nfrom threading import Lock\nfrom typing import Optional\n\nfrom .exceptions import ClientException\n\n\nclass _NotSet:\n    def __bool__(self):\n        return False\n\n    __nonzero__ = __bool__\n\n    def __str__(self):\n        return \"NotSet\"\n\n\nclass Config:\n    \"\"\"A class containing the configuration for a reddit site.\"\"\"\n\n    CONFIG = None\n    CONFIG_NOT_SET = _NotSet()  # Represents a config value that is not set.\n    LOCK = Lock()\n    INTERPOLATION_LEVEL = {\n        \"basic\": configparser.BasicInterpolation,\n        \"extended\": configparser.ExtendedInterpolation,\n    }\n\n    @staticmethod\n    def _config_boolean(item):\n        if isinstance(item, bool):\n            return item\n        return item.lower() in {\"1\", \"yes\", \"true\", \"on\"}\n\n    @classmethod\n    def _load_config(cls, config_interpolation: Optional[str] = None):\n        \"\"\"Attempt to load settings from various praw.ini files.\"\"\"\n        if config_interpolation is not None:\n            interpolator_class = cls.INTERPOLATION_LEVEL[\n                config_interpolation\n            ]()\n        else:\n            interpolator_class = None\n        config = configparser.ConfigParser(interpolation=interpolator_class)\n        module_dir = os.path.dirname(sys.modules[__name__].__file__)\n        if \"APPDATA\" in os.environ:  # Windows\n            os_config_path = os.environ[\"APPDATA\"]\n        elif \"XDG_CONFIG_HOME\" in os.environ:  # Modern Linux\n            os_config_path = os.environ[\"XDG_CONFIG_HOME\"]\n        elif \"HOME\" in os.environ:  # Legacy Linux\n            os_config_path = os.path.join(os.environ[\"HOME\"], \".config\")\n        else:\n            os_config_path = None\n        locations = [os.path.join(module_dir, \"praw.ini\"), \"praw.ini\"]\n        if os_config_path is not None:\n            locations.insert(1, os.path.join(os_config_path, \"praw.ini\"))\n        config.read(locations)\n        cls.CONFIG = config\n\n    @property\n    def short_url(self) -> str:\n        \"\"\"Return the short url or raise a ClientException when not set.\"\"\"\n        if self._short_url is self.CONFIG_NOT_SET:\n            raise ClientException(\"No short domain specified.\")\n        return self._short_url\n\n    def __init__(\n        self,\n        site_name: str,\n        config_interpolation: Optional[str] = None,\n        **settings: str\n    ):\n        \"\"\"Initialize a Config instance.\"\"\"\n        with Config.LOCK:\n            if Config.CONFIG is None:\n                self._load_config(config_interpolation)\n\n        self._settings = settings\n        self.custom = dict(Config.CONFIG.items(site_name), **settings)\n\n        self.client_id = self.client_secret = self.oauth_url = None\n        self.reddit_url = self.refresh_token = self.redirect_uri = None\n        self.password = self.user_agent = self.username = None\n\n        self._initialize_attributes()\n\n    def _fetch(self, key):\n        value = self.custom[key]\n        del self.custom[key]\n        return value\n\n    def _fetch_default(self, key, default=None):\n        if key not in self.custom:\n            return default\n        return self._fetch(key)\n\n    def _fetch_or_not_set(self, key):\n        if key in self._settings:  # Passed in values have the highest priority\n            return self._fetch(key)\n\n        env_value = os.getenv(\"praw_{}\".format(key))\n        ini_value = self._fetch_default(key)  # Needed to remove from custom\n\n        # Environment variables have higher priority than praw.ini settings\n        return env_value or ini_value or self.CONFIG_NOT_SET\n\n    def _initialize_attributes(self):\n        self._short_url = (\n            self._fetch_default(\"short_url\") or self.CONFIG_NOT_SET\n        )\n        self.check_for_updates = self._config_boolean(\n            self._fetch_or_not_set(\"check_for_updates\")\n        )\n        self.kinds = {\n            x: self._fetch(\"{}_kind\".format(x))\n            for x in [\n                \"comment\",\n                \"message\",\n                \"redditor\",\n                \"submission\",\n                \"subreddit\",\n                \"trophy\",\n            ]\n        }\n\n        for attribute in (\n            \"client_id\",\n            \"client_secret\",\n            \"redirect_uri\",\n            \"refresh_token\",\n            \"password\",\n            \"user_agent\",\n            \"username\",\n        ):\n            setattr(self, attribute, self._fetch_or_not_set(attribute))\n\n        for required_attribute in (\"oauth_url\", \"reddit_url\", \"timeout\"):\n            setattr(self, required_attribute, self._fetch(required_attribute))\n", "path": "praw/config.py"}], "after_files": [{"content": "\"\"\"Provides the code to load PRAW's configuration file `praw.ini`.\"\"\"\nimport configparser\nimport os\nimport sys\nfrom threading import Lock\nfrom typing import Optional\n\nfrom .exceptions import ClientException\n\n\nclass _NotSet:\n    def __bool__(self):\n        return False\n\n    __nonzero__ = __bool__\n\n    def __str__(self):\n        return \"NotSet\"\n\n\nclass Config:\n    \"\"\"A class containing the configuration for a reddit site.\"\"\"\n\n    CONFIG = None\n    CONFIG_NOT_SET = _NotSet()  # Represents a config value that is not set.\n    LOCK = Lock()\n    INTERPOLATION_LEVEL = {\n        \"basic\": configparser.BasicInterpolation,\n        \"extended\": configparser.ExtendedInterpolation,\n    }\n\n    @staticmethod\n    def _config_boolean(item):\n        if isinstance(item, bool):\n            return item\n        return item.lower() in {\"1\", \"yes\", \"true\", \"on\"}\n\n    @classmethod\n    def _load_config(cls, config_interpolation: Optional[str] = None):\n        \"\"\"Attempt to load settings from various praw.ini files.\"\"\"\n        if config_interpolation is not None:\n            interpolator_class = cls.INTERPOLATION_LEVEL[\n                config_interpolation\n            ]()\n        else:\n            interpolator_class = None\n        config = configparser.ConfigParser(interpolation=interpolator_class)\n        module_dir = os.path.dirname(sys.modules[__name__].__file__)\n        if \"APPDATA\" in os.environ:  # Windows\n            os_config_path = os.environ[\"APPDATA\"]\n        elif \"XDG_CONFIG_HOME\" in os.environ:  # Modern Linux\n            os_config_path = os.environ[\"XDG_CONFIG_HOME\"]\n        elif \"HOME\" in os.environ:  # Legacy Linux\n            os_config_path = os.path.join(os.environ[\"HOME\"], \".config\")\n        else:\n            os_config_path = None\n        locations = [os.path.join(module_dir, \"praw.ini\"), \"praw.ini\"]\n        if os_config_path is not None:\n            locations.insert(1, os.path.join(os_config_path, \"praw.ini\"))\n        config.read(locations)\n        cls.CONFIG = config\n\n    @property\n    def short_url(self) -> str:\n        \"\"\"Return the short url or raise a ClientException when not set.\"\"\"\n        if self._short_url is self.CONFIG_NOT_SET:\n            raise ClientException(\"No short domain specified.\")\n        return self._short_url\n\n    def __init__(\n        self,\n        site_name: str,\n        config_interpolation: Optional[str] = None,\n        **settings: str\n    ):\n        \"\"\"Initialize a Config instance.\"\"\"\n        with Config.LOCK:\n            if Config.CONFIG is None:\n                self._load_config(config_interpolation)\n\n        self._settings = settings\n        self.custom = dict(Config.CONFIG.items(site_name), **settings)\n\n        self.client_id = self.client_secret = self.oauth_url = None\n        self.reddit_url = self.refresh_token = self.redirect_uri = None\n        self.password = self.user_agent = self.username = None\n\n        self._initialize_attributes()\n\n    def _fetch(self, key):\n        value = self.custom[key]\n        del self.custom[key]\n        return value\n\n    def _fetch_default(self, key, default=None):\n        if key not in self.custom:\n            return default\n        return self._fetch(key)\n\n    def _fetch_or_not_set(self, key):\n        if key in self._settings:  # Passed in values have the highest priority\n            return self._fetch(key)\n\n        env_value = os.getenv(\"praw_{}\".format(key))\n        ini_value = self._fetch_default(key)  # Needed to remove from custom\n\n        # Environment variables have higher priority than praw.ini settings\n        return env_value or ini_value or self.CONFIG_NOT_SET\n\n    def _initialize_attributes(self):\n        self._short_url = (\n            self._fetch_default(\"short_url\") or self.CONFIG_NOT_SET\n        )\n        self.check_for_updates = self._config_boolean(\n            self._fetch_or_not_set(\"check_for_updates\")\n        )\n        self.kinds = {\n            x: self._fetch(\"{}_kind\".format(x))\n            for x in [\n                \"comment\",\n                \"message\",\n                \"redditor\",\n                \"submission\",\n                \"subreddit\",\n                \"trophy\",\n            ]\n        }\n\n        for attribute in (\n            \"client_id\",\n            \"client_secret\",\n            \"redirect_uri\",\n            \"refresh_token\",\n            \"password\",\n            \"user_agent\",\n            \"username\",\n        ):\n            setattr(self, attribute, self._fetch_or_not_set(attribute))\n\n        for required_attribute in (\"oauth_url\", \"reddit_url\", \"timeout\"):\n            setattr(self, required_attribute, self._fetch(required_attribute))\n\n        for attribute, conversion in {\"timeout\": int}.items():\n            try:\n                setattr(self, attribute, conversion(getattr(self, attribute)))\n            except ValueError:\n                raise ValueError(\n                    \"An incorrect config type was given for option {}. The \"\n                    \"expected type is {}, but the given value is {}.\".format(\n                        attribute,\n                        conversion.__name__,\n                        getattr(self, attribute),\n                    )\n                )\n", "path": "praw/config.py"}]}