Open gitvavo opened 2 weeks ago
Thanks for raising this. Even if there is a workaround with start_chars
and/or name_chars
, that is not entirely obvious. I like your approach for making parsing more automatic across systems, though I wonder if having the algorithm dependent on the operating system could lead to some unexpected results for reproducing things.
I would like to rewrite/refactor this whole function TBH - it's very old code and I've refrained from touching it since it works for most typical cases I've tried. But it's not very readable.
Next time I work on this, I will have a look at this function and keep this issue in mind. Let me know if using start_chars
/name_chars
has ended up not being a good approach for you.
When parsing a text file containing file and folder names, a number of characters get stripped from names which refers to forbidden characters in Windows systems:
https://github.com/earnestt1234/seedir/blob/300a22ddae5114e19335e2be99f9faecc7e7616d/seedir/fakedir.py#L1370
It would be nice to import platform and defines the filtered chars based on the current system (or through a parameter), i.e.:
EDIT: The list of filtered characters can indeed be bypassed by providing start_chars, so this is not really an issue, sorry!