# Buggy code
def _initialize_attributes(self):
    self._short_url = self._fetch_default("short_url") or self.CONFIG_NOT_SET
    self.check_for_updates = self._config_boolean(
        self._fetch_or_not_set("check_for_updates")
    )
    self.kinds = {
        x: self._fetch("{}_kind".format(x))
        for x in [
            "comment",
            "message",
            "redditor",
            "submission",
            "subreddit",
            "trophy",
        ]
    }

    for attribute in (
        "client_id",
        "client_secret",
        "redirect_uri",
        "refresh_token",
        "password",
        "user_agent",
        "username",
    ):
        setattr(self, attribute, self._fetch_or_not_set(attribute))

    for required_attribute in ("oauth_url", "reddit_url", "timeout"):
        setattr(self, required_attribute, self._fetch(required_attribute))


# Traceback (TypeError)
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.

# Fixed code
def _initialize_attributes(self):
    self._short_url = self._fetch_default("short_url") or self.CONFIG_NOT_SET
    self.check_for_updates = self._config_boolean(
        self._fetch_or_not_set("check_for_updates")
    )
    self.kinds = {
        x: self._fetch("{}_kind".format(x))
        for x in [
            "comment",
            "message",
            "redditor",
            "submission",
            "subreddit",
            "trophy",
        ]
    }

    for attribute in (
        "client_id",
        "client_secret",
        "redirect_uri",
        "refresh_token",
        "password",
        "user_agent",
        "username",
    ):
        setattr(self, attribute, self._fetch_or_not_set(attribute))

    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),
                )
            )