Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--debug-dump-tree throws uncaught TypeError #282

Open
mitiemann opened this issue Nov 20, 2023 · 1 comment
Open

--debug-dump-tree throws uncaught TypeError #282

mitiemann opened this issue Nov 20, 2023 · 1 comment
Labels
bug: minor Something isn't working component: core Affects the core infrastructure component: parser Affects the parser

Comments

@mitiemann
Copy link

mitiemann commented Nov 20, 2023

MISS_HIT Component affected

  • Style checker

Your MATLAB/Octave environment
none (should not be required)

Your operating system and Python version

  • Windows w/ Python 3.7.9
  • WSL Ubuntu w/ Python 3.10.12

Describe the bug
When trying to enable the --debug-dump-tree option, the call fails with an uncaugt TypeError. E.g.
python miss_hit_core/mh_style.py --debug-dump-error output.txt miss_hit.m
produces

Traceback (most recent call last):
  File "/home/mtiemann/dev/miss_hit/miss_hit_core/mh_style.py", line 1301, in <module>
    main()
  File "/home/mtiemann/dev/miss_hit/miss_hit_core/mh_style.py", line 1297, in main
    command_line.ice_handler(main_handler)
  File "/home/mtiemann/dev/miss_hit/miss_hit_core/command_line.py", line 448, in ice_handler
    main_function()
  File "/home/mtiemann/dev/miss_hit/miss_hit_core/mh_style.py", line 1288, in main_handler
    command_line.execute(mh, options, extra_options,
  File "/home/mtiemann/dev/miss_hit/miss_hit_core/command_line.py", line 432, in execute
    for results in pool.imap(process_fn, work_list, 5):
  File "/usr/lib/python3.10/multiprocessing/pool.py", line 423, in <genexpr>
    return (item for chunk in result for item in chunk)
  File "/usr/lib/python3.10/multiprocessing/pool.py", line 873, in next
    raise value
  File "/usr/lib/python3.10/multiprocessing/pool.py", line 540, in _handle_tasks
    put(task)
  File "/usr/lib/python3.10/multiprocessing/connection.py", line 206, in send
    self._send_bytes(_ForkingPickler.dumps(obj))
  File "/usr/lib/python3.10/multiprocessing/reduction.py", line 51, in dumps
    cls(buf, protocol).dump(obj)
TypeError: cannot pickle '_io.TextIOWrapper' object

Edit:
Everything works when disabling multi-threading with the --single option. Since this creates a viable workaround, I'm wondering whether requesting --debug-dump-tree should simply lead to disabling multi-threading by default and call it a day?

@florianschanda
Copy link
Owner

That might be a good idea. I am not sure why the two options should interfere though, could be a latent bug. I'll look into it.

@florianschanda florianschanda added bug: minor Something isn't working component: parser Affects the parser component: core Affects the core infrastructure labels Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: minor Something isn't working component: core Affects the core infrastructure component: parser Affects the parser
Projects
None yet
Development

No branches or pull requests

2 participants