Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
shutaozhenzhen opened this issue Jun 24, 2023 · 2 comments
Closed

Comments

@shutaozhenzhen
Copy link

shutaozhenzhen commented Jun 24, 2023

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'].

@JessicaTegner
Copy link
Owner

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

@JessicaTegner JessicaTegner closed this as not planned Won't fix, can't repro, duplicate, stale Aug 31, 2023
@shutaozhenzhen
Copy link
Author

shutaozhenzhen commented Aug 31, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants