Forum Bugs

Prince does not play well with # in filenames on OS X

trevordevore
If I try to output a PDF document with a # in the output name then Prince exits with this error:

prince: ~/Desktop/test: error: can't open output file: No such file or directory

Sample command:

../../bin/prince prince_test.html -o "~/Desktop/test#.pdf"

This is a valid filename on OS X.

Trevor DeVore
Blue Mango Learning Systems
http://www.screensteps.com - http://www.clarify-it.com

mikeday
Prince seems to be dropping everything after the # in the output filename. Perhaps that is related to URL processing, where # marks the end of the URL and the beginning of the fragment identifier. However, the file should still write successfully in this case. Should "-/Desktop" be "~/Desktop", eg. tilde instead of hyphen?
trevordevore
I am using "~" (tilde) in my test. You're right though, the file does indeed get created with a name comprising the characters up to the #.

Trevor DeVore
Blue Mango Learning Systems
http://www.screensteps.com - http://www.clarify-it.com

mikeday
We will change this behaviour in Prince 8.1, so that filenames provided on the command-line will not be parsed as URLs and chopped off after # unless they explicitly begin with a URL scheme, eg. http://. This should fix the problem. :)
trevordevore
Thank you.

Trevor DeVore
Blue Mango Learning Systems
http://www.screensteps.com - http://www.clarify-it.com

mikeday
Prince 8.1 is now available for download and includes a fix for this issue. Thanks for letting us know about it. :)