Add methods to perform path validation to pathlib.Path

I was reading https://stackoverflow.com/questions/7406102/create-sane-safe-filename-from-a... and was thinking that functionality to create safe paths from unsafe paths and check if a Path would work on a given filesystem would well in Pathlib.

this actually came up fairly recently on this very list -- go poke around in the archives to find it. But the short version is that there is no clear definition of a "sanitized" filename -- see that SO thread to get the idea. So you really want a solution that works for your use case, so not really a candidate for the standard library. There are a number of packages on PyPi that might help: https://pypi.org/project/pathvalidate/ https://pypi.org/project/awesome-slugify/ just to name two. -CHB On Tue, Aug 11, 2020 at 10:51 PM Charles Machalow <csm10495@gmail.com> wrote:
-- Christopher Barker, PhD Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython

this actually came up fairly recently on this very list -- go poke around in the archives to find it. But the short version is that there is no clear definition of a "sanitized" filename -- see that SO thread to get the idea. So you really want a solution that works for your use case, so not really a candidate for the standard library. There are a number of packages on PyPi that might help: https://pypi.org/project/pathvalidate/ https://pypi.org/project/awesome-slugify/ just to name two. -CHB On Tue, Aug 11, 2020 at 10:51 PM Charles Machalow <csm10495@gmail.com> wrote:
-- Christopher Barker, PhD Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython
participants (2)
-
Charles Machalow
-
Christopher Barker