tomerfiliba / plumbum

Plumbum: Shell Combinators
https://plumbum.readthedocs.io
MIT License
2.8k stars 182 forks source link

Documentation suggestion: suffix methods need a leading period #554

Open wtanksleyjr opened 3 years ago

wtanksleyjr commented 3 years ago

I spent about 15 minutes trying to find why "tmp" is not a legal suffix. Suggestion: either the error message should say a leading dot is required, or something in the documentation should mention it. Also a suggestion: mention the word "extension" in the doc for the suffix functions, it's commonly searched for. Not as big a deal though.

>>> m = local.path('.') / 'mkdestination.py'
>>> m.is_file()
True
>>> m.with_suffix('tmp', 0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/william/.local/lib/python3.8/site-packages/plumbum/path/local.py", line 164, in with_suffix
    raise ValueError("Invalid suffix %r" % (suffix))
ValueError: Invalid suffix 'tmp'