classification
Title: Document how to remove a suffix with pathlib.Path.with_suffix
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: berker.peksag, docs@python, matrixise, sotte
Priority: normal Keywords: patch

Created on 2018-08-03 09:58 by sotte, last changed 2018-08-03 21:46 by berker.peksag. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 8655 sotte, 2018-08-03 10:01
PR 8661 merged miss-islington, 2018-08-03 20:50
PR 8662 merged miss-islington, 2018-08-03 20:50
Messages (10)
msg323042 - (view) Author: Stefan Otte (sotte) * Date: 2018-08-03 09:58
Hello folks!

I didn't realize that you can remove a suffix with the `with_suffix` function of the `Path` class of `pathlib` and I always used a little utility function that I wrote.
I wanted to add that functionality (removing of a suffix) and submit a PR but then I saw that `with_suffix` has you covered already. I'm just documenting this feature with the PR I'll submit.
msg323048 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2018-08-03 13:12
Good catch, thank you.
Could you sign the CLA, without the CLA, we can't process your PR.

Thank you
msg323050 - (view) Author: Stefan Otte (sotte) * Date: 2018-08-03 13:59
I'm waiting for the CLA to be accepted. I'll get back to you ASAP.
msg323051 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2018-08-03 14:01
yep, it's a manual modification in b.p.o but after that, we can check your PR. thank you for your patience.
msg323052 - (view) Author: Stefan Otte (sotte) * Date: 2018-08-03 14:04
No problem, I'm just excited to contribute to python (as small as the contribution might be) :)
msg323053 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2018-08-03 14:12
It's the same thing for everything, for example, in Karate, you will start with the white belt and with practice, you will get the black belt.

Thank you again for your contribution.
msg323054 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-08-03 14:25
This seems like a reasonable request. The feature was added in https://github.com/python/cpython/commit/e50dafcd636ba32db890600164698bb070d40d97 (issue 20639) in Python 3.4.

I'd normally suggest adding a ".. versionchanged:: 3.4" marker, but since the change is quite old and it's already in all of the current maintenance releases, I think we don't need to add it.
msg323074 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-08-03 20:49
New changeset 46dc4e34ed8005a688d7f3512844ef227a3465f4 by Berker Peksag (Stefan Otte) in branch 'master':
bpo-34329: Doc'd how to remove suffix of pathlib.Path() (GH-8655)
https://github.com/python/cpython/commit/46dc4e34ed8005a688d7f3512844ef227a3465f4
msg323083 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-08-03 21:45
New changeset 764f9d09b03654d7cd70d59afafafd51d24f2750 by Berker Peksag (Miss Islington (bot)) in branch '3.6':
bpo-34329: Doc'd how to remove suffix of pathlib.Path() (GH-8655)
https://github.com/python/cpython/commit/764f9d09b03654d7cd70d59afafafd51d24f2750
msg323084 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-08-03 21:45
New changeset 39fcd9949832323b672f7ff05fd1498b8844a329 by Berker Peksag (Miss Islington (bot)) in branch '3.7':
bpo-34329: Doc'd how to remove suffix of pathlib.Path() (GH-8655)
https://github.com/python/cpython/commit/39fcd9949832323b672f7ff05fd1498b8844a329
History
Date User Action Args
2018-08-03 21:46:15berker.peksagsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-08-03 21:45:49berker.peksagsetmessages: + msg323084
2018-08-03 21:45:24berker.peksagsetmessages: + msg323083
2018-08-03 20:50:40miss-islingtonsetpull_requests: + pull_request8157
2018-08-03 20:50:29miss-islingtonsetpull_requests: + pull_request8156
2018-08-03 20:49:44berker.peksagsetmessages: + msg323074
2018-08-03 14:25:01berker.peksagsetnosy: + berker.peksag

messages: + msg323054
versions: + Python 3.6, Python 3.7, Python 3.8
2018-08-03 14:12:18matrixisesetmessages: + msg323053
2018-08-03 14:04:13sottesetmessages: + msg323052
2018-08-03 14:01:47matrixisesetmessages: + msg323051
2018-08-03 13:59:56sottesetmessages: + msg323050
2018-08-03 13:12:55matrixisesetnosy: + matrixise
messages: + msg323048
2018-08-03 10:01:13sottesetkeywords: + patch
stage: patch review
pull_requests: + pull_request8150
2018-08-03 09:58:05sottecreate