[Mono-bugs] [Bug 649464] New: System.IO.File.ReadLines disposes the StreamReader in the middle of reading

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Oct 26 21:52:21 EDT 2010


https://bugzilla.novell.com/show_bug.cgi?id=649464

https://bugzilla.novell.com/show_bug.cgi?id=649464#c0


           Summary: System.IO.File.ReadLines disposes the StreamReader in
                    the middle of reading
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.8.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: gerber.matthew at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.11)
Gecko/20101013 Ubuntu/10.04 (lucid) Firefox/3.6.11

Calling System.IO.File.ReadLines results in a System.ObjectDisposedException.
No reading is done. I have tried the Mono version of File.cs verbatim under
Microsoft .NET and get the exact same result. I believe the StreamReader object
is going out of the "using" scope and is being disposed of in the middle of
reading because the "yield" statement is used.

Reproducible: Always

Steps to Reproduce:
1. Call Console.Out.WriteLine(System.IO.File.ReadLines("somefile").Count() + "
lines");
Actual Results:  
Throws exception.

Expected Results:  
Prints number of lines.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list