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

pathlib.Path.with_suffix(None) became allowed in Python 3.13b1 #119113

Closed
Labels
3.13bugs and security fixestopic-pathlibtype-bugAn unexpected behavior, bug, or error
@bluetech

Description

@bluetech

Bug report

Bug description:

In Python 3.13b1 (compared to Python 3.12 and earlier), the behavior ofpathlib.Path.with_suffix(None) changed from raising an incidentalTypeError to removing the suffix. This casues acertain test in pytest to fail. I am going to fix pytest to not rely on this in any case, but I think pathlib should either:

  • Restore the previous behavior if it was unintended, or
  • Updatethe doc thatNone is now accepted. Currently it says " If the suffix is an empty string, the original suffix is removed".

CPython versions tested on:

3.12, 3.13

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixestopic-pathlibtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp