summaryrefslogtreecommitdiffstats
path: root/Lib/http
diff options
context:
space:
mode:
authorStéphane Wirtel <stephane@wirtel.be>2019-03-01 20:40:54 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-03-01 20:40:54 (GMT)
commit4b219ce81ed04234648a4ce4f0cb0865818abb38 (patch)
tree43d7c14161d763c8d257af45b95e4463cea854dd /Lib/http
parentbda918bf65a88560ec453aaba0758a9c0d49b449 (diff)
downloadcpython-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.py6
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)