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.

classification
Title: Path.with_suffix() raises TypeError when doing %-formatting
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: berker.peksag Nosy List: berker.peksag, pitrou
Priority: normal Keywords: patch

Created on 2018-08-03 21:03 by berker.peksag, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 8663 merged berker.peksag, 2018-08-03 21:07
PR 8731 merged miss-islington, 2018-08-11 05:45
Messages (3)
msg323078 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-08-03 21:03
import pathlib

path = pathlib.Path('TR')
with_suffix = path.with_suffix(('/', '.md'))

The snippet I shared above will raise:

    TypeError: not all arguments converted during string formatting

While we are relying on duck typing, I think this can be considered as a bug in this case.
msg323398 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-08-11 05:45
New changeset 423d05f6f59b24c91b9ef6b2e4ac130316764382 by Berker Peksag in branch 'master':
bpo-34333: Fix %-formatting in Path.with_suffix() (GH-8663)
https://github.com/python/cpython/commit/423d05f6f59b24c91b9ef6b2e4ac130316764382
msg323399 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-08-11 06:00
New changeset c614121224a5a81d958643471720645b1cb3166e by Berker Peksag (Miss Islington (bot)) in branch '3.7':
bpo-34333: Fix %-formatting in Path.with_suffix() (GH-8663)
https://github.com/python/cpython/commit/c614121224a5a81d958643471720645b1cb3166e
History
Date User Action Args
2022-04-11 14:59:04adminsetgithub: 78514
2018-08-11 06:00:36berker.peksagsetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: - Python 3.6
2018-08-11 06:00:13berker.peksagsetmessages: + msg323399
2018-08-11 05:45:34miss-islingtonsetpull_requests: + pull_request8217
2018-08-11 05:45:12berker.peksagsetmessages: + msg323398
2018-08-03 21:07:43berker.peksagsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request8158
2018-08-03 21:03:06berker.peksagcreate