This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2016年09月21日 07:31 by ethan.furman, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| open-tarfile.stoneleaf.patch | ethan.furman, 2016年09月21日 07:31 | review | ||
| issue28230_v2.diff | berker.peksag, 2016年10月10日 13:04 | review | ||
| test_tarfile_pathlike.patch | serhiy.storchaka, 2016年10月10日 21:06 | review | ||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 512 | merged | serhiy.storchaka, 2017年03月06日 11:37 | |
| PR 559 | merged | serhiy.storchaka, 2017年03月08日 09:17 | |
| Messages (9) | |||
|---|---|---|---|
| msg278414 - (view) | Author: Berker Peksag (berker.peksag) * (Python committer) | Date: 2016年10月10日 13:04 | |
Here's an updated patch with different tests and documentation changes. I simplified Lib/tarfile.py a bit (see my review comments) A slightly off-topic question: I had to update both docstrings and documentation. Should we use this as an opportunity to simplify the docstrings? |
|||
| msg278416 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2016年10月10日 13:36 | |
There are two kinds of paths in tarinfo: 1) External paths that correspond to filesystem paths. The path of the tar file itself, patches of added files and target directory for extraction. Supporting path protocol looks reasonable for them. 1) Internal paths, they are just string keys inside an archive. They come from TarFile.getnames() and always are strings. I'm not sure that pathlib have relation to this. This issue needs more thoughts. I would not haste with this. |
|||
| msg278428 - (view) | Author: Ethan Furman (ethan.furman) * (Python committer) | Date: 2016年10月10日 16:45 | |
As Serhiy was alluding to, if the incoming path is for the actual tar file and is only passed along to Python itself then we probably don't need to worry about os.fspath(). For names that will be interally stored, or are for accessing internal files, then the proper sequence is check for and call os.fspath if necessary, and then double-check that the name to be used is a str. The double-check is needed because os.fspath may return a bytes object, which tar does not allow. |
|||
| msg278444 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2016年10月10日 21:06 | |
It seems to me that tarfile already supports path protocol for all external patches and no changes for tarfile are needed. Proposed patch adds tests for (already implemented) support of pathlike protocol in tarfile. |
|||
| msg288604 - (view) | Author: Berker Peksag (berker.peksag) * (Python committer) | Date: 2017年02月26日 17:21 | |
Serhiy's patch looks good to me, but it would be nice to document the support for PathLike objects in the tarfile documentation. |
|||
| msg289096 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2017年03月06日 11:41 | |
Updated documentation. Note that path-like objects are supported only for external names. Internal names are not OS paths. |
|||
| msg289671 - (view) | Author: Berker Peksag (berker.peksag) * (Python committer) | Date: 2017年03月15日 12:52 | |
PR 512 has been merged and backported to 3.6 branch. I think this can be closed now. Thanks, Ethan and Serhiy! |
|||
| msg290265 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2017年03月24日 22:41 | |
New changeset 666165fddf499e80d10a5d9263846ec4534f6a2a by Serhiy Storchaka in branch '3.6': [3.6] bpo-28230: Document the pathlib support in tarfile and add tests. (#559) https://github.com/python/cpython/commit/666165fddf499e80d10a5d9263846ec4534f6a2a |
|||
| msg290267 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2017年03月24日 22:41 | |
New changeset c45cd167d403d7d98078d5fc4a37b16195dc7a35 by Serhiy Storchaka in branch 'master': bpo-28230: Document the pathlib support in tarfile and add tests. (#512) https://github.com/python/cpython/commit/c45cd167d403d7d98078d5fc4a37b16195dc7a35 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:37 | admin | set | github: 72417 |
| 2017年03月24日 22:41:49 | serhiy.storchaka | set | messages: + msg290267 |
| 2017年03月24日 22:41:28 | serhiy.storchaka | set | messages: + msg290265 |
| 2017年03月15日 12:52:09 | berker.peksag | set | status: open -> closed resolution: fixed messages: + msg289671 stage: patch review -> resolved |
| 2017年03月08日 09:17:05 | serhiy.storchaka | set | pull_requests: + pull_request460 |
| 2017年03月06日 11:41:06 | serhiy.storchaka | set | messages: + msg289096 |
| 2017年03月06日 11:37:55 | serhiy.storchaka | set | pull_requests: + pull_request421 |
| 2017年02月26日 17:21:40 | berker.peksag | set | messages: + msg288604 |
| 2016年10月10日 21:06:20 | serhiy.storchaka | set | files:
+ test_tarfile_pathlike.patch messages: + msg278444 |
| 2016年10月10日 18:59:40 | ned.deily | set | nosy:
+ lars.gustaebel |
| 2016年10月10日 16:45:16 | ethan.furman | set | messages: + msg278428 |
| 2016年10月10日 13:36:42 | serhiy.storchaka | set | messages: + msg278416 |
| 2016年10月10日 13:04:44 | berker.peksag | set | files:
+ issue28230_v2.diff messages: + msg278414 |
| 2016年10月05日 10:36:18 | berker.peksag | set | components: + Library (Lib) |
| 2016年10月05日 09:26:45 | berker.peksag | set | nosy:
+ berker.peksag |
| 2016年09月23日 21:34:43 | ned.deily | set | nosy:
+ ned.deily versions: + Python 3.7 |
| 2016年09月21日 08:14:19 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka |
| 2016年09月21日 07:31:34 | ethan.furman | create | |