bugGNU Octave - Bugs: bug #52242, [octave-forge] io: read_namelist...

 
 

bug #52242: [octave-forge] io: read_namelist fails for some positions of the ending character /

Submitted by:  None
Submitted on:  Tue 17 Oct 2017 03:00:45 PM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: Philip Nienhuis <philipnienhuis>
Originator Name: Brice DAVIEROriginator Email: -unavailable-
Open/Closed: ClosedRelease: other
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 20 Oct 2017 03:00:22 PM UTC, comment #5:

Sure, I understand.
But as Jordi (core dev) once told me: "Be brave..."
It's just software after all, nothing can break physically. Patches & csets still go through a review process anyway.

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Fri 20 Oct 2017 02:01:45 PM UTC, comment #4:

Great!
I didn't want to pull the repo since I never used mercurial before, "diff -u" is what I was looking for (but failed to find...). Will do better next time ;-)

Anonymous
Fri 20 Oct 2017 01:46:10 PM UTC, comment #3:

Thanks,
I applied your fix here:
http://hg.code.sf.net/p/octave/io/rev/e0b7733c65c1

BTW next time please supply a "diff -u" as Mercurial swallows that more easily (or even better, provide a cset) :-)

Closing report.

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Wed 18 Oct 2017 10:41:58 AM UTC, comment #2:

Attached is a patch including a test based on the one at the bottom of the file.

(file #42188)

Anonymous
Tue 17 Oct 2017 07:58:51 PM UTC, comment #1:

Thanks for the bug report & patch.

read_namelist.m is not my code, I do very little or even nothing with Fortran these days.
Can you please also add a test? see bottom of read_namelist.m for an example. I think you can base such a test on your example.nml file.

I plan to release 2.4.8 soon, it would be nice to include this fix & test.

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Tue 17 Oct 2017 03:00:45 PM UTC, original submission:

On version 2.4.7 of the io package, the read_namelist function to read Fortran namelist files shows an error when the character ending the namelist (/) is not the first character on its line.

At least on version 4.8.5, gfortran puts a space before the ending / when writing a namelist to a file, causing the error when loading it in octave.
The attached file 'example.nml' was generated with this Fortran code:

The attached patch makes sure the / character is not included in the evaluation of the last variable of the namelist.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #42188:  patch2.diff added by None (457B - text/x-patch - Add a test)
file #42182:  example.nml added by None (28B - application/vnd.enliven)
file #42183:  patch.diff added by None (116B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by None (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 project members can vote.

     

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

     

     

    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 20 Oct 2017 01:46:10 PM UTCphilipnienhuisStatusNone=>Fixed
      Assigned toNone=>philipnienhuis
      Open/ClosedOpen=>Closed
      Release3.8.2=>other
      Operating SystemGNU/Linux=>Any
      Summaryio package: read_namelist fails for some positions of the ending character /=>[octave-forge] io: read_namelist fails for some positions of the ending character /
    Wed 18 Oct 2017 10:41:58 AM UTCNoneAttached File-=>Added patch2.diff, #42188
    Tue 17 Oct 2017 03:00:45 PM UTCNoneAttached File-=>Added example.nml, #42182
      Attached File-=>Added patch.diff, #42183

    Back to the top


    Powered by Savane 3.1-cleanup1