Closed thekugelmeister closed 2 years ago
I have not diagnosed why this occurs, but I propose the following solution:
pathlib.Path
objects for handling pathsRather than go through the hassle of diagnosing the problem and implementing a fix, why not let python's builtin path abstraction capabilities do the job for us? See https://docs.python.org/3/library/pathlib.html for more detail.
Clarification: adding pathlib
will not actually address this issue, as the preceding forward slash makes it a valid file path that points somewhere different. However, adding more robust path handling will help future-proof in other ways.
On cleanup branch removed preceding forward slash in examples since that was an error, and I agree implementing pathlib
sounds great.
After discussion decided will eventually switch to pathlib
and will use moving forward but for now the issue is fixed by providing a valid file path for example code.
I am using the Windows Linux Subsystem to test this. When I try to run the example code from the documentation, e.g.
I get the following error:
Removing the leading forward slash from the output file argument fixes the problem. Somehow, the file specifications are not system-agnostic right now.