Closed hugoduncan closed 12 years ago
The arguments are an optional format string followed by optional args. I'd rather not change the code to make the interpretation of the format string dependent on whether or not there are more arguments. I think that behavior would be more complicated than necessary and harder to document.
If you're passing a fixed string in your source code, you can get a % character in the output without attempting to consume another argument by using "%%" in the format string.
If you're passing in a string from another source, you can use "%s" as the format string and pass the message string in as the next argument.
Does either of those techniques solve the problem you're seeing in an acceptable manner?
I have a workaround in place that does string substitution from % to %%. Using "%s" is cleaner - I hadn't though of that. Neither solution is very nice though, imho, for the following reasons:
Having said that, I can live with it as is.
Good points as usual. I've reconsidered and made changes to address this issue and your detailed comments. Please let me know what you think.
This is fixed in slingshot 0.10.2. Thanks!
When using throw+ to pass a fixed message string, any % characters cause an error (due to format interpretting the % as a format specifier). When no extra arguments are passed to throw+, please remove the use of format.