error loading matlab a2l generated file #71
Replies: 5 comments
-
|
I forgot to upload the file: I renamed it from .a2l to .txt to overcome the file extension limitations of github. |
Beta Was this translation helpful? Give feedback.
-
|
@tuttoaldoc Yes, it was indeed a version issue, but the root cause was the B905 `zip()` without an explicit `strict=` parameterThis is fixed now, have fun! |
Beta Was this translation helpful? Give feedback.
-
|
Thank you Christoph, |
Beta Was this translation helpful? Give feedback.
-
|
0.14.5? |
Beta Was this translation helpful? Give feedback.
-
|
Thank you, I have problems installing last version. It seems pip sees up to 0.14.5. I tried to install manually but then I have the same problem with dependencies .. At the end I corrected by hand 0.14.5 as you did and everything is working fine. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Cristoph,
I'm still Michele here :). Now that pyxcp works fine with matlab executables I would like to parse also the generated a2l file. I tried your library but I got an error at db write.
Looking online it seems sometimes a problem of version of python .. can you give me any hint?
Thank you very much for the support
Michele
[2025-03-27 11:26:28.699] [preprocessor] [info] Preprocessing and tokenizing 'matlab_example\ex_slrt_cal_osc_vCal_CoderXCPServer.a2l'.
[2025-03-27 11:26:28.708] [a2l] [info] Elapsed Time: 0.008[s]
[2025-03-27 11:26:28.708] [a2l] [info] Start parsing...
[2025-03-27 11:26:28.712] [a2l] [info] Elapsed Time: 0.003[s]
[2025-03-27 11:26:28.712] [a2l] [info] Number of keywords: 129
⠋ writing to DB... ╸━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2% Elapsed: 0:00:00 Remaining: -:--:--
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ C:\Program Files\Python\lib\runpy.py:197 in _run_module_as_main │
│ │
│ 194 │ main_globals = sys.modules["main"].dict │
│ 195 │ if alter_argv: │
│ 196 │ │ sys.argv[0] = mod_spec.origin │
│ ❱ 197 │ return _run_code(code, main_globals, None, │
│ 198 │ │ │ │ │ "main", mod_spec) │
│ 199 │
│ 200 def run_module(mod_name, init_globals=None, │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ alter_argv = False │ │
│ │ code = <code object at 0x00000215C0EBADF0, file │ │
│ │ "c:\Soft\vscode\data\extensions\ms-python.debugpy-2025.4.1-win32-x64\bundled… │ │
│ │ line 5> │ │
│ │ main_globals = { │ │
│ │ │ 'name': 'main', │ │
│ │ │ 'doc': None, │ │
│ │ │ 'package': '', │ │
│ │ │ 'loader': <_frozen_importlib_external.SourceFileLoader object at │ │
│ │ 0x00000215C11D94F0>, │ │
│ │ │ 'spec': ModuleSpec(name='main', │ │
│ │ loader=<_frozen_importlib_external.SourceFileLoader object at │ │
│ │ 0x00000215C11D94F0>, │ │
│ │ origin='c:\Soft\vscode\data\extensions\ms-python.debugpy-2025.4.1-win32… │ │
│ │ │ 'annotations': {}, │ │
│ │ │ 'builtins': <module 'builtins' (built-in)>, │ │
│ │ │ 'file': │ │
│ │ 'c:\Soft\vscode\data\extensions\ms-python.debugpy-2025.4.1-win32-x64\b… │ │
│ │ │ 'cached': │ │
│ │ 'c:\Soft\vscode\data\extensions\ms-python.debugpy-2025.4.1-win32-x64\b… │ │
│ │ │ 'sys': <module 'sys' (built-in)>, │ │
│ │ │ ... +2 │ │
│ │ } │ │
│ │ mod_name = 'main' │ │
│ │ mod_spec = ModuleSpec(name='main', │ │
│ │ loader=<_frozen_importlib_external.SourceFileLoader object at │ │
│ │ 0x00000215C11D94F0>, │ │
│ │ origin='c:\Soft\vscode\data\extensions\ms-python.debugpy-2025.4.1-win32… │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ C:\Program Files\Python\lib\runpy.py:87 in _run_code │
│ │
│ 84 │ │ │ │ │ loader = loader, │
│ 85 │ │ │ │ │ package = pkg_name, │
│ 86 │ │ │ │ │ spec = mod_spec) │
│ ❱ 87 │ exec(code, run_globals) │
│ 88 │ return run_globals │
│ 89 │
│ 90 def _run_module_code(code, init_globals=None, │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ cached = 'c:\Soft\vscode\data\extensions\ms-python.debugpy-2025.4.1-win32-x64\b… │ │
│ │ code = <code object at 0x00000215C0EBADF0, file │ │
│ │ "c:\Soft\vscode\data\extensions\ms-python.debugpy-2025.4.1-win32-x64\bundled… │ │
│ │ line 5> │ │
│ │ fname = 'c:\Soft\vscode\data\extensions\ms-python.debugpy-2025.4.1-win32-x64\b… │ │
│ │ init_globals = None │ │
│ │ loader = <_frozen_importlib_external.SourceFileLoader object at 0x00000215C11D94F0> │ │
│ │ mod_name = 'main' │ │
│ │ mod_spec = ModuleSpec(name='main', │ │
│ │ loader=<_frozen_importlib_external.SourceFileLoader object at │ │
│ │ 0x00000215C11D94F0>, │ │
│ │ origin='c:\Soft\vscode\data\extensions\ms-python.debugpy-2025.4.1-win32… │ │
│ │ pkg_name = '' │ │
│ │ run_globals = { │ │
│ │ │ 'name': 'main', │ │
│ │ │ 'doc': None, │ │
│ │ │ 'package': '', │ │
│ │ │ 'loader': <_frozen_importlib_external.SourceFileLoader object at │ │
│ │ 0x00000215C11D94F0>, │ │
│ │ │ 'spec': ModuleSpec(name='main', │ │
│ │ loader=<_frozen_importlib_external.SourceFileLoader object at │ │
│ │ 0x00000215C11D94F0>, │ │
│ │ origin='c:\Soft\vscode\data\extensions\ms-python.debugpy-2025.4.1-win32… │ │
│ │ │ 'annotations': {}, │ │
│ │ │ 'builtins': <module 'builtins' (built-in)>, │ │
│ │ │ 'file': │ │
│ │ 'c:\Soft\vscode\data\extensions\ms-python.debugpy-2025.4.1-win32-x64\b… │ │
│ │ │ 'cached': │ │
│ │ 'c:\Soft\vscode\data\extensions\ms-python.debugpy-2025.4.1-win32-x64\b… │ │
│ │ │ 'sys': <module 'sys' (built-in)>, │ │
│ │ │ ... +2 │ │
│ │ } │ │
│ │ script_name = None │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ ... 11 frames hidden ... │
│ │
│ c:\Dev\hot_upgrade\atp_core\socomecenv\socomecenv\lib\site-packages\pya2l\a2lparser.py:408 in │
│ traverse │
│ │
│ 405 │ │ │ mult = tree.get_multiple_values() │
│ 406 │ │ │ if_data = tree.if_data │
│ 407 │ │ │ │
│ ❱ 408 │ │ │ values = zipper(params, mult) │
│ 409 │ │ │ if name not in ("ReadOnly", "GuardRails", "Discrete"): │
│ 410 │ │ │ │ inst = table(**values) │
│ 411 │
│ │
│ ╭─────────────────────────────────── locals ───────────────────────────────────╮ │
│ │ attr = 'fake' │ │
│ │ if_data = '' │ │
│ │ inst = None │ │
│ │ level = 1 │ │
│ │ mult = [] │ │
│ │ multiple = False │ │
│ │ name = 'Asap2Version' │ │
│ │ params = [1, 31] │ │
│ │ parent = <pya2l.a2lparser.FakeRoot object at 0x00000215C7FD4BB0> │ │
│ │ self = <pya2l.a2lparser.A2LParser object at 0x00000215C2249B50> │ │
│ │ tree = <pya2l.a2lparser_ext.ValueContainer object at 0x00000215C7FE7FB0> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ c:\Dev\hot_upgrade\atp_core\socomecenv\socomecenv\lib\site-packages\pya2l\a2lparser.py:258 in │
│ zipper │
│ │
│ 255 │ │ │ │
│ 256 │ │ │ def zipper(values, mult_values: list[typing.Any]): │
│ 257 │ │ │ │ # Standard case -- all scalar values. │
│ ❱ 258 │ │ │ │ return dict(zip([p.name for p in kw.required_parameters], values, st │
│ 259 │ │
│ 260 │ else: │
│ 261 │
│ │
│ ╭─────── locals ────────╮ │
│ │ mult_values = [] │ │
│ │ values = [1, 31] │ │
│ ╰───────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: zip() takes no keyword arguments
Beta Was this translation helpful? Give feedback.
All reactions