#1100657 Magics cannot seem to load its own JSON files

Package:
python3-magics++
Source:
python3-magics++
Description:
Python3 support for Magics++
Submitter:
Enrico Zini
Date:
2025-03-16 18:09:02 UTC
Severity:
normal
#1100657#5
Date:
2025-03-16 18:00:47 UTC
From:
To:
Hello,

thank you for maintaining Magics.

If I run the attached script, I get:

   $ python3 magics-reproducer
   b'Magics-ERROR: JSON error in file: /usr/lib/python3/dist-packages/ecmwflibs/share/magics/epsg.json: Cannot open file /usr/lib/python3/dist-packages/ecmwflibs/share/magics/epsg.json: X\xa2\xa0\n'
   fish: Job 2, 'python3 /tmp/magics-reproducer' terminated by signal SIGSEGV (Address boundary error)

The file is installed in /usr/share/magics/epsg.json instead.

If I brutally copy the file to
/usr/lib/python3/dist-packages/ecmwflibs/share/magics/epsg.json
then I get a reproducer for what looks like another Magics issue[1] which
is out of scope for this one.


Thanks,

Enrico

[1] https://www.enricozini.org/blog/2021/debian/an-educational-debugging-session/
    which now also seems to apply to Debian stable?