@twol thanks for the fix, but I don't think simply ignoring characters is the correct way. It fixes the crash, but does not erase the file.
Question now is why file_eraser.cpp does not accept bytes in python3, if it was bytes in python2?
Can it be modified to take also bytes, I think that would be the correct fix.
It would also make sense to add try/except to RedirectOutput (including some debug output to except block if it happens)
Logging should never crash and there are other places in code where same could happen.
" It fixes the crash, but does not erase the file." - I know I am still looking at it!! Just wanted the crash removed.
The issue with your file names is that in python3 we have to use an encoding that will handle the conversion to Unicode string .... and we are guessing ... the "standard" is utf-8 (suits English speaking countries because that's the same as Ascii more or less), but doesn't handle your file names
"Question now is why file_eraser.cpp does not accept bytes in python3, if it was bytes in python2?" - it accepts a string (of bytes) which can be Ascii(py2) or Unicode (py3). Python 2 will actually handle both (ascii and Unicode if used ) transparently.
In py3 you can have either a unicode string or bytes that can be handled by core & I/O routines, where a Unicode byte can be encoded into 1-> 4 bytes in a byte string, depending on the encoding (and visa versa).
Of course, the python3 developers tell you not to touch any byte string unless you know the encoding, which is kind of nice in theory but in our case rubbish, as our inputs come at us from all over --- including helpful Windows file names.
You need to read up on py2 vs py3 - its not that simple. If it was we wouldn't have these and many other issues.... espedcially coming from an initial python2 base where we initially supported both python versions.
I agree on both your last 2 points, but we also need to be able to identify and fix the initial issue.