Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

posixpath.commonpath: Check for empty iterables broken #114709

Closed
Labels
type-featureA feature request or enhancement
@srittau

Description

@srittau

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

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp