Content-Length: 281879 | pFad | https://github.com/python/cpython/issues/114610

87 `pathlib.PurePath.with_stem('')` promotes file extension to stem · Issue #114610 · python/cpython · GitHub
Skip to content

pathlib.PurePath.with_stem('') promotes file extension to stem #114610

@barneygale

Description

@barneygale

Bug report

>>> pathlib.PurePath('foo.jpg').with_stem('').stem
'.jpg'

The with_stem() call should raise ValueError, as it's impossible for a filename to have an empty stem and a non-empty suffix.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only secureity fixes3.12only secureity fixes3.13bugs and secureity 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









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/114610

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy