Issue Details (XML | Word | Printable)

Key: JRUBY-654
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Thomas E Enebo
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JRuby

"%01.3f" % nil should throw a TypeError

Created: 03/Mar/07 12:41 PM   Updated: 30/Apr/07 03:13 AM   Resolved: 04/Mar/07 09:04 AM
Return to search
Component/s: Core Classes/Modules
Affects Version/s: JRuby 0.9.2
Fix Version/s: JRuby 0.9.8

Time Tracking:
Not Specified

File Attachments: 1. Text File printf_format_must_die.patch (2 kB)



 Description  « Hide
"%01.3f" % nil

Should throw a TypeError



Bill Dortch added a comment - 03/Mar/07 02:48 PM

This patch will work, but it's a total hack. (The problem goes to the overall design of PrintfFormat – there isn't a clean fix.) Solves similar non-compliance issues with nil and other format specifiers.


Thomas E Enebo added a comment - 03/Mar/07 02:55 PM

I will take this for a spin...Looks reasonable and I would guess safe. This code is going away soon so a hack is fine. Thanks Bill.


Thomas E Enebo added a comment - 04/Mar/07 09:04 AM

Applied in commit 3121 with one unit test (we should add several failing format tests when rewrite lands). Thanks Bill