JessicaTegner/pypandoc

Need to use glob.escape when convert file with name like '[0].txt'

shutaozhenzhen opened this issue · 2 comments

Have problem in using pypandoc with path like '[0].txt', baceuse glob.glob returns [] and cause format = _identify_format_from_path(discovered_source_files[0], format) index out of range

Seems need to use glob.escape, which returns ['[[]0].txt'].

Don't exactly know what you are asking for here, so I'm going to close this for now.

Don't exactly know what you are asking for here, so I'm going to close this for now.

First, can pypandoc fix this problem that using pypandoc with path like '[0].txt' need to add glob.escape in code?
Second, if can't, I think this problem worth to be explained in pypandoc's document, that if someone is dealing file like '[0].txt', they need to use glob.escape, like output = pypandoc.convert_file(glob.escape('[0].txt'), 'rst').
Third, if still can't, I add this issue to help people who face this problem, and want to find solution in github issue like me.