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 2014年01月02日 20:29 by july, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg207185 - (view) | Author: July Tikhonov (july) * | Date: 2014年01月02日 20:29 | |
This is not a real-world example, but it brokes some invariant (part of path must not contain separator):
>>> pathlib.PurePath('/a/b.c.d').with_suffix('///')
PurePosixPath('/a/b.c///')
>>> pathlib.PurePath('/a/b.c.d').with_suffix('/not/split/into/parts').parts
('/', 'a', 'b.c/not/split/into/parts')
I think these cases should raise an error.
I would also like to consider the following to be an error, since the argument of with_suffix() is not exactly a suffix:
>>> PurePath('/a/b.c.d').with_suffix('e')
PurePosixPath('/a/b.ce')
but I'm far less sure in this case.
|
|||
| msg207196 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2014年01月02日 22:52 | |
Thank you for reporting this! You're right, this is a bug. |
|||
| msg207197 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2014年01月02日 23:07 | |
New changeset ef2b2ddd27c8 by Antoine Pitrou in branch 'default': Issue #20111: pathlib.Path.with_suffix() now sanity checks the given suffix. http://hg.python.org/cpython/rev/ef2b2ddd27c8 |
|||
| msg207198 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2014年01月02日 23:08 | |
I've committed a fix: ValueError is now raised for invalid suffixes. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:56 | admin | set | github: 64310 |
| 2014年01月02日 23:08:25 | pitrou | set | status: open -> closed versions: - Python 3.5 messages: + msg207198 resolution: fixed stage: resolved |
| 2014年01月02日 23:07:36 | python-dev | set | nosy:
+ python-dev messages: + msg207197 |
| 2014年01月02日 22:52:39 | pitrou | set | messages: + msg207196 |
| 2014年01月02日 20:54:13 | r.david.murray | set | nosy:
+ r.david.murray |
| 2014年01月02日 20:33:27 | july | set | type: behavior |
| 2014年01月02日 20:29:00 | july | create | |