bugGNU Octave - Bugs: bug #62761, encoding specified in .oct-config...

 
 

bug #62761: encoding specified in .oct-config file is not used in current directory

Submitter:  Markus Mützel <mmuetzel>
Submitted:  Wed 13 Jul 2022 11:19:08 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 21 Jul 2022 06:19:26 AM UTC, comment #4: 

Thanks for testing.

Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Mon 18 Jul 2022 06:07:21 AM UTC, comment #3: 

I have tested this and it works for the original issue.

Colin Macdonald <cbm>
Thu 14 Jul 2022 11:16:58 AM UTC, comment #2: 

I think the patch from comment #1 is the right thing to fix this. (At least, I can't think of another practical one atm.)

I pushed it to the default branch here:
https://hg.savannah.gnu.org/hgweb/octave/rev/f125ddb46055

This is a new feature. And it is probably ok to keep it only partially working on the stable branch while we evaluate it on the default branch.

Marking as ready for test.

Markus Mützel <mmuetzel>
Group administrator
Wed 13 Jul 2022 11:25:45 AM UTC, comment #1: 

The attached patch fixes the issue for me by using a canonicalized path as the key in the dir_encoding map.
I'm not sure if there is a way around using the (rather expensive) `canonicalize_file_name` to get a unique and reproducible key for each path in the load path...

IIRC, that worked correctly at some point in the past. (Not 100% sure though.)
The patch also adds some tests for that feature to hopefully help not breaking it again in the future.

(file #53432)

Markus Mützel <mmuetzel>
Group administrator
Wed 13 Jul 2022 11:19:08 AM UTC, original submission:  

When the current directory contains a `.oct-config` file that specifies an encoding that differs from the default .m file encoding, that encoding (instead of the default one) should be used for files in the current folder.
That doesn't seem to be the case.

See also this downstream report: https://github.com/catch22/octave-doctest/pull/256

I'll upload a patch with a possible fix when I'll have a bug number.

Markus Mützel <mmuetzel>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by cbm (Posted a comment)
  • -email is unavailable- added by mmuetzel (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-07-21 mmuetzel StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2022-07-14 mmuetzel StatusPatch Submitted Ready For Test
    2022-07-13 mmuetzel Attached File- Added bug62761-dir-encoding.patch, #53432
        StatusNone Patch Submitted

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code