Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue36043

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:FileCookieJar constructor don't accept PathLike
Type:enhancementStage:resolved
Components:Library (Lib)Versions:Python 3.8, Python 3.7, Python 3.6
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: kapsh, matrixise, miss-islington, xtreak
Priority:normalKeywords:patch

Created on2019-02-19 18:26 bykapsh, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
cookiejar_straightforward_convert.patchkapsh,2019-02-19 18:26one minute patch
Pull Requests
URLStatusLinkedEdit
PR 11945mergedmatrixise,2019-02-19 18:54
Messages (6)
msg335993 -(view)Author: Alexander Kapshuna (kapsh)Date: 2019-02-19 18:26
FileCookieJar and it's subclasses don't accept Paths and DirEntrys.Minimal code to reproduce:===import pathlibfrom http.cookiejar import FileCookieJarsaved_cookies = pathlib.Path('my_cookies.txt')jar = FileCookieJar(saved_cookies)===Results in: "ValueError: filename must be string-like".Workaround is to convert Path explicitly or call load() which doesn't check for type, but it would be nice to see all APIs in standard library consistent.I also did quick and dirty patch which silently converts filename argument using os.fspath(). This way it won't break any existing code relying on FileCookieJar.filename being string.
msg335996 -(view)Author: Karthikeyan Singaravelan (xtreak)*(Python committer)Date: 2019-02-19 18:44
This seems like a good change to me. GitHub PRs are accepted please seehttps://devguide.python.org/ . Since this is an enhancement it can only go as part of Python 3.8 if accepted.
msg335997 -(view)Author: Stéphane Wirtel (matrixise)*(Python committer)Date: 2019-02-19 18:52
@xtreaksorry, but I have already worked on this issue :/can I publish my PR?
msg335998 -(view)Author: Stéphane Wirtel (matrixise)*(Python committer)Date: 2019-02-19 18:55
in fact, I have published my PR because I have already the tests and I have another approach for this issue.
msg336238 -(view)Author: Alexander Kapshuna (kapsh)Date: 2019-02-21 17:09
Oh sorry, I just thought that everybody has forgotten about this part of library. Nevermind my patch then, your work is certainly better, matrixise.
msg336955 -(view)Author: miss-islington (miss-islington)Date: 2019-03-01 20:40
New changeset4b219ce81ed04234648a4ce4f0cb0865818abb38 by Miss Islington (bot) (Stéphane Wirtel) in branch 'master':bpo-36043: FileCookieJar supports os.PathLike (GH-11945)https://github.com/python/cpython/commit/4b219ce81ed04234648a4ce4f0cb0865818abb38
History
DateUserActionArgs
2022-04-11 14:59:11adminsetgithub: 80224
2019-03-01 20:41:46brett.cannonsetstatus: open -> closed
resolution: fixed
stage: resolved
2019-03-01 20:40:58miss-islingtonsetnosy: +miss-islington
messages: +msg336955
2019-02-21 17:09:12kapshsetmessages: +msg336238
2019-02-19 18:55:40matrixisesetmessages: +msg335998
stage: patch review -> (no value)
2019-02-19 18:54:44matrixisesetstage: patch review
pull_requests: +pull_request11969
2019-02-19 18:52:28matrixisesetnosy: +matrixise

messages: +msg335997
versions: + Python 3.6, Python 3.7
2019-02-19 18:44:58xtreaksetnosy: +xtreak

messages: +msg335996
versions: - Python 3.6, Python 3.7
2019-02-19 18:26:02kapshcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp