Bug #4376
closedrdoc can't handle correctly the return value when the file has invalid character
Description
=begin
From r30806 to r30813, make rdoc raises error on LANG=C environment like:
http://59.106.172.211/~chkbuild/ruby-trunk/log/20110207T010100Z.log.html.gz
This is because the encoding of output is set to US-ASCII, failed character
encoding conversion on doc/re.rdoc, and wrongly treated nil as String.
The main bug is set to US-ASCII, so I fixed it in r30813.
But nil treatment should be rdoc's bug, so I report this.
Generating RDoc documentation
Parsing sources...
unable to convert U+6771 from UTF-8 to US-ASCII for ../../ruby/doc/re.rdoc, skipping
Before reporting this, could you check that the file you're documenting
has proper syntax:
/home/naruse/local/ruby/bin/ruby -c ../../ruby/re.c
RDoc is not a full Ruby parser and will fail when fed invalid ruby programs.
The internal error was:
(NoMethodError) undefined method `sub' for nil:NilClass
/home/naruse/ruby/lib/rdoc/markup/pre_process.rb:126:in include_file' /home/naruse/ruby/lib/rdoc/markup/pre_process.rb:76:in
block in handle'
/home/naruse/ruby/lib/rdoc/markup/pre_process.rb:61:in gsub!' /home/naruse/ruby/lib/rdoc/markup/pre_process.rb:61:in
handle'
/home/naruse/ruby/lib/rdoc/parser/c.rb:867:in look_for_directives_in' /home/naruse/ruby/lib/rdoc/parser/c.rb:516:in
find_class_comment'
/home/naruse/ruby/lib/rdoc/parser/c.rb:687:in handle_class_module' /home/naruse/ruby/lib/rdoc/parser/c.rb:204:in
block in do_classes'
/home/naruse/ruby/lib/rdoc/parser/c.rb:199:in scan' /home/naruse/ruby/lib/rdoc/parser/c.rb:199:in
do_classes'
/home/naruse/ruby/lib/rdoc/parser/c.rb:987:in scan' /home/naruse/ruby/lib/rdoc/rdoc.rb:322:in
parse_file'
/home/naruse/ruby/lib/rdoc/rdoc.rb:367:in block in parse_files' /home/naruse/ruby/lib/rdoc/rdoc.rb:365:in
map'
/home/naruse/ruby/lib/rdoc/rdoc.rb:365:in parse_files' /home/naruse/ruby/lib/rdoc/rdoc.rb:423:in
document'
../../ruby/bin/rdoc:15:in <main>' uh-oh! RDoc had a problem: undefined method
sub' for nil:NilClass
run with --debug for full backtrace
*** Error code 1
Stop in /home/naruse/obj/ruby.
=end
Updated by drbrain (Eric Hodel) about 13 years ago
=begin
I have a fix for this bug, but it has uncovered a second bug.
I am still investigating.
=end
Updated by drbrain (Eric Hodel) about 13 years ago
- Status changed from Assigned to Closed
=begin
Fixed by import RDoc 3.5.3, 30815.
I have found further inconsistencies in the result encoding for some String methods, I will file those bugs separately.
=end