Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Bug description:
This came up inpython/typeshed#11310: When passing an empty sequence tocommonpath(), aValueError is raised with an appropriate error message. When an "empty" iterable is passed, anIndexError is raised instead, although iterables otherwise work fine:
fromposixpathimportcommonpathcommonpath([])# -> ValueError: commonpath() arg is an empty sequencecommonpath(iter([]))# -> IndexError: tuple index out of range
The fix is trivial, I'll send a PR. Technically this is an API change, though, although the old API is unexpected.
CPython versions tested on:
3.11, 3.12
Operating systems tested on:
Linux