I think the basic idea is sound here, just a couple of questions.
Are the mangled filenames going to be in the output of the external tool? If so there needs to be some unmangling code.
Can relpath be a string like u"docs/マニュアル/index.html"? If so we risk losing path components, should use 'replace' for encoding errors and then do .replace("?", "_") to make it windows-happy.
Could use `sys.getfilesystemencoding() or 'ascii'` rather than just 'ascii' as the encoding. Likewise could use `(path) or 'FILE'` rather than `'_'+(path)` to avoid the empty string.
I think the basic idea is sound here, just a couple of questions.
Are the mangled filenames going to be in the output of the external tool? If so there needs to be some unmangling code.
Can relpath be a string like u"docs/ マニュアル/index. html"? If so we risk losing path components, should use 'replace' for encoding errors and then do .replace("?", "_") to make it windows-happy.
Could use `sys.getfilesys temencoding( ) or 'ascii'` rather than just 'ascii' as the encoding. Likewise could use `(path) or 'FILE'` rather than `'_'+(path)` to avoid the empty string.