diff options
author | Stéphane Wirtel <stephane@wirtel.be> | 2019-03-01 20:40:54 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-03-01 20:40:54 (GMT) |
commit | 4b219ce81ed04234648a4ce4f0cb0865818abb38 (patch) | |
tree | 43d7c14161d763c8d257af45b95e4463cea854dd /Lib/http | |
parent | bda918bf65a88560ec453aaba0758a9c0d49b449 (diff) | |
download | cpython-4b219ce81ed04234648a4ce4f0cb0865818abb38.zip cpython-4b219ce81ed04234648a4ce4f0cb0865818abb38.tar.gz cpython-4b219ce81ed04234648a4ce4f0cb0865818abb38.tar.bz2 |
bpo-36043: FileCookieJar supports os.PathLike (GH-11945)
https://bugs.python.org/issue36043
Diffstat (limited to 'Lib/http')
-rw-r--r-- | Lib/http/cookiejar.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py index 0ba8200..befe765 100644 --- a/Lib/http/cookiejar.py +++ b/Lib/http/cookiejar.py @@ -28,6 +28,7 @@ http://wwwsearch.sf.net/): __all__ = ['Cookie', 'CookieJar', 'CookiePolicy', 'DefaultCookiePolicy', 'FileCookieJar', 'LWPCookieJar', 'LoadError', 'MozillaCookieJar'] +import os import copy import datetime import re @@ -1762,10 +1763,7 @@ class FileCookieJar(CookieJar): """ CookieJar.__init__(self, policy) if filename is not None: - try: - filename+"" - except: - raise ValueError("filename must be string-like") + filename = os.fspath(filename) self.filename = filename self.delayload = bool(delayload) |