[New-bugs-announce] [issue38222] pathlib Path objects should support __format__

Miki Tebeka report at bugs.python.org
Thu Sep 19 02:01:05 EDT 2019


New submission from Miki Tebeka <miki.tebeka at gmail.com>:

Currently pathlib.Path cannot be used with string formatting directives. IMO it should.

>>> from pathlib import Path
>>> path = Path('/path/to/enlightenment')
>>> print(f'path is: {path:>50}')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported format string passed to PosixPath.__format__

----------
components: Library (Lib)
messages: 352771
nosy: tebeka
priority: normal
severity: normal
status: open
title: pathlib Path objects should support __format__
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38222>
_______________________________________


More information about the New-bugs-announce mailing list