From 6449d15c0a60b83e76079c8aaab4e20bbae2a3e0 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" <1330696+mr-c@users.noreply.github.com> Date: Tue, 29 Aug 2023 17:04:13 +0200 Subject: [PATCH] FileCache.directory: explictly allow pathlib.Path (#322) --- cachecontrol/caches/file_cache.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cachecontrol/caches/file_cache.py b/cachecontrol/caches/file_cache.py index 523bb1a..76af2cb 100644 --- a/cachecontrol/caches/file_cache.py +++ b/cachecontrol/caches/file_cache.py @@ -6,7 +6,8 @@ import hashlib import os from textwrap import dedent -from typing import IO, TYPE_CHECKING +from typing import IO, TYPE_CHECKING, Union +from pathlib import Path from cachecontrol.cache import BaseCache, SeparateBodyBaseCache from cachecontrol.controller import CacheController @@ -63,7 +64,7 @@ class _FileCacheMixin: def __init__( self, - directory: str, + directory: Union[str, Path], forever: bool = False, filemode: int = 0o0600, dirmode: int = 0o0700,