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.

Title: pathlib.Path.with_name() and .with_suffix do not allow combining with an empty Path
Type: behavior Stage: resolved
Components: Versions: Python 3.6, Python 3.5
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: ethan.furman, pitrou, serhiy.storchaka
Priority: normal Keywords:

Created on 2016-04-01 03:04 by ethan.furman, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg262717 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2016-04-01 03:04
The methods .with_name() and .with_suffix() of pathlib.Path (and friends) do not allow a name or suffix to be added to a path alone -- I get ValueError(... has an empty name...).

This is the documented behavior, but it seems incredibly user-unfriendly.
msg262720 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-04-01 04:46
There is no a bug. This is the documented and reasonable behavior. What behavior you expect?
msg262723 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2016-04-01 06:13
Never mind.
Date User Action Args
2022-04-11 14:58:29adminsetgithub: 70871
2016-04-01 06:13:00ethan.furmansetstatus: open -> closed
resolution: not a bug
messages: + msg262723

stage: resolved
2016-04-01 04:46:29serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg262720
2016-04-01 03:04:49ethan.furmancreate