In article <1107624628.854571.118950 / o13g2000cwo.googlegroups.com>,
  "Daniel Berger" <djberg96 / hotmail.com> writes:

> Ruby 1.8.2
> Windows XP Pro

> irb(main):003:0> pp File.stat("test.rb")
> #<File::StatNoMethodError: undefined method `name' for nil:NilClass
>         from c:/ruby/lib/ruby/1.8/pp.rb:410:in `pretty_print'

OS dependent?

Does following patch fix it?

Index: lib/pp.rb
===================================================================
RCS file: /src/ruby/lib/pp.rb,v
retrieving revision 1.38
diff -u -p -r1.38 pp.rb
--- lib/pp.rb	14 Nov 2004 04:27:12 -0000	1.38
+++ lib/pp.rb	6 Feb 2005 01:28:00 -0000
@@ -407,18 +407,24 @@ class File
         q.group {
           q.text "uid="; q.pp self.uid
           begin
-            name = Etc.getpwuid(self.uid).name
-            q.breakable; q.text "(#{name})"
+            pw = Etc.getpwuid(self.uid)
           rescue ArgumentError
           end
+          if pw
+            name = pw.name
+            q.breakable; q.text "(#{name})"
+          end
         }
         q.comma_breakable
         q.group {
           q.text "gid="; q.pp self.gid
           begin
-            name = Etc.getgrgid(self.gid).name
-            q.breakable; q.text "(#{name})"
+            gr = Etc.getgrgid(self.gid)
           rescue ArgumentError
+          end
+          if gr
+            name = gr.name
+            q.breakable; q.text "(#{name})"
           end
         }
         q.comma_breakable
-- 
Tanaka Akira