Bug#1100657: Magics cannot seem to load its own JSON files
Enrico Zini
enrico at enricozini.org
Sun Mar 16 18:00:47 GMT 2025
Package: python3-magics++
Version: 2:1.5.8-3
Severity: important
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?
-- System Information:
Debian Release: trixie/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 6.12.12-amd64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8), LANGUAGE=en_IE:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages python3-magics++ depends on:
ii python3 3.13.2-2
ii python3-ecmwflibs 2:0.6.3-2+b1
ii python3-findlibs 0.0.5-1
ii python3-jinja2 3.1.5-2
ii python3-numpy 1:2.2.3+ds-2+b1
ii python3-simplejson 3.19.3-1+b2
python3-magics++ recommends no packages.
python3-magics++ suggests no packages.
-- no debconf information
-------------- next part --------------
import Magics
from Magics import macro
output = macro.output(output_formats=["png"], output_name="output")
parts = []
parts.append(
macro.mmap(
**{
"subpage_map_projection": "mercator",
"subpage_lower_left_longitude": 5.1,
"subpage_lower_left_latitude": 43.0,
"subpage_upper_right_longitude": 15.0,
"subpage_upper_right_latitude": 47.5,
"subpage_map_vertical_longitude": 10.3,
}
)
)
parts.append(
macro.msymb(
**{
"symbol_type": "marker",
"symbol_marker_index": 15,
"legend": "off",
"symbol_colour": "black",
"symbol_height": 0.28,
}
)
)
macro.plot(output, *parts)
More information about the debian-science-maintainers
mailing list