insitro / redun

Yet another redundant workflow engine
https://insitro.github.io/redun/
Apache License 2.0
510 stars 43 forks source link

File/Dir - cannot use path made of non-utf8 bytestrings #79

Open gabriel-v opened 1 year ago

gabriel-v commented 1 year ago

All the code in redun.File and friends assumes we have a single valid utf-8 string for the path.

But python accepts bytes as the path objects too. This is needed when we're working with filesystems that encode filenames using something else than UTF-8.

There's some functions that crash when trying to give File a bytes path:

The workaround is to hack:

I also tried changing the self.classes.File but it can't be overwritten (uses getitem) - so one would have to replace this whole FileClasses thing.

I think one of two things can be done here:

What do you think?