Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on OpenBSD's Pledge and Unveil from Python.
Or a pathlib.Path, hence os.fspath.
In fact for this specific use case there’s even better:
> os.fsencode(filename)
> Encode path-like filename to the filesystem encoding with 'surrogateescape' error handler, or 'strict' on Windows; return bytes unchanged.
There are no comments on this comment yet.
Or a pathlib.Path, hence os.fspath.
In fact for this specific use case there’s even better:
> os.fsencode(filename)
> Encode path-like filename to the filesystem encoding with 'surrogateescape' error handler, or 'strict' on Windows; return bytes unchanged.