bugGNUstep - Bugs: bug #30951, The call of [NSString...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #30951: The call of [NSString -initWithContentsOfURL:encoding:error:] is breaked by an exception

Submitted by:  Sergei Golovin <svg>
Submitted on:  Fri 03 Sep 2010 07:20:12 AM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Thu 30 Sep 2010 07:31:07 AM UTC, comment #2:

This bug should be closed due to changes in NSString.m r31273.

Sergei Golovin <svg>
Fri 03 Sep 2010 07:23:33 AM UTC, comment #1:

Sorry, I didn't mention the bug category "Base/Foundation"

My environment:
ubuntu 9.10
base r31231

Sergei Golovin <svg>
Fri 03 Sep 2010 07:20:12 AM UTC, original submission:

The exception NSInvalidArgumentException is picked up at the line 1516 of NSString.m:
==================================================================
- (id) initWithContentsOfURL: (NSURL*)url
encoding: (NSStringEncoding)enc
error: (NSError**)error
{
NSData *d;
unsigned int len;

d = [[NSDataClass alloc] dataWithContentsOfURL: url]; // <- exception

==================================================================

But there is no an instance method -dataWithContentsOfURL: of NSData.

The class method +dataWithContentsOfURL: of NSData works well for me (see the attached patch).

Sergei Golovin <svg>

 

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by CaS (Updated the item)
  • -unavailable- added by svg
  • -unavailable- added by svg (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 30 Sep 2010 08:33:43 AM UTCCaSCategoryNone=>Base/Foundation
      StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Thu 30 Sep 2010 07:31:07 AM UTCsvgCarbon-Copy-=>Added cas
    Fri 03 Sep 2010 07:20:12 AM UTCsvgAttached File-=>Added NSString_dataWithContentsOfURL.patch, #21379

    Back to the top


    Powered by Savane 3.1-cleanup1