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

Percent sign in filenames isn't escaped properly #129

Open
jeremybmerrill opened this issue Mar 17, 2015 · 0 comments
Open

Percent sign in filenames isn't escaped properly #129

jeremybmerrill opened this issue Mar 17, 2015 · 0 comments

Comments

@jeremybmerrill
Copy link

> require 'docsplit'
> Docsplit.extract_pages('/path/to/whatever/a pdf is bad, 100%.pdf')
Docsplit::ExtractionFailed: Exception in thread "main" java.util.UnknownFormatConversionException: Conversion = '_'
  at java.util.Formatter.checkText(Formatter.java:2547)
  at java.util.Formatter.parse(Formatter.java:2523)
  at java.util.Formatter.format(Formatter.java:2469)
  at java.util.Formatter.format(Formatter.java:2423)
  at java.lang.String.format(String.java:2797)
  at org.documentcloud.pdftailor.PdfTailor.outputPath(PdfTailor.java:156)
  at org.documentcloud.pdftailor.PdfTailor.unstitch(PdfTailor.java:128)
  at org.documentcloud.pdftailor.PdfTailor.main(PdfTailor.java:43)
  from /Users/myusername/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/docsplit-0.7.6/lib/docsplit/page_extractor.rb:22:in `block in extract'
  from /Users/myusername/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/docsplit-0.7.6/lib/docsplit/page_extractor.rb:10:in `each'
  from /Users/myusername/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/docsplit-0.7.6/lib/docsplit/page_extractor.rb:10:in `extract'
  from /Users/myusername/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/docsplit-0.7.6/lib/docsplit.rb:46:in `extract_pages'
  from (irb):3
  from /Users/myusername/.rbenv/versions/2.1.4/bin/irb:11:in `<main>'

If you try different filenames with % in different places, the error message is slightly different: presumably Java is trying to interpret the % differently based on preceding/following characters.

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

1 participant