diff --git a/src/httpaste/helper/config.py b/src/httpaste/helper/config.py index f053cf3..29795e3 100755 --- a/src/httpaste/helper/config.py +++ b/src/httpaste/helper/config.py @@ -3,6 +3,7 @@ from pathlib import Path from configparser import ConfigParser, NoSectionError from typing import Optional, NamedTuple from os import environ +from ast import literal_eval CONFIGPATH_ENVIRON = 'HTTPASTE_CONFIGPATH' @@ -49,8 +50,9 @@ def typecast(obj: dict, aclass: type, dirname:Optional[Path] = None) -> dict: casted[k] = casted_val = dirname / v elif issubclass(bclass, bytes): - casted[k] = bclass(v.encode('utf-8')) + elif issubclass(bclass, bool): + casted[k] = literal_eval(v) else: try: casted_val = bclass(v)