cp2k / cp2k-input-tools

Fully validating pure-python CP2K input file tools including preprocessing capabilities
MIT License
47 stars 10 forks source link

Accept bytes object as a file path. #61

Closed yakutovicha closed 2 years ago

yakutovicha commented 2 years ago

fixes #60

yakutovicha commented 2 years ago

I am not sure why tests are failing, but I believe this is not related to the PR.

yakutovicha commented 2 years ago

@dev-zero please have a look.

dev-zero commented 2 years ago

@yakutovicha thanks a lot! Will do, need to figure out why we suddenly get bytes there. Tests are definitely unrelated, need to update the GHA workflows.

dev-zero commented 2 years ago

Ok, I found the issue: I was testing with click 8, and you're likely still using click 7 and the behavior of path_type changed: in click 7 it says it should be a string type, while click 8 says explicitly it can be a pathlib.Path.

dev-zero commented 2 years ago

ok, it seems that when converting bytes which are supposed to be a path, one should use os.fsdecode.