evhub / coconut

Simple, elegant, Pythonic functional programming.
http://coconut-lang.org
Apache License 2.0
4.04k stars 120 forks source link

AttributeError: 'frozenset' object has no attribute 'append' #804

Closed caedmon-kitty closed 9 months ago

caedmon-kitty commented 9 months ago

Just setup a venv and "pip install coconut". Tried one of the examples in the tutorial and got many many lines of error.

~$ source coconut/bin/activate (coconut) ~$ cd python/coconut/ (coconut) ~$ bin/coconut Coconut Interpreter v3.0.3 (Python 3.12): (enter 'exit()' or press Ctrl-D to end)


>>> "hello world"|>print File
"/home/me/coconut/lib64/python3.12/site-packages/coconut/command/command.py", line 476, in handling_exceptions
 yield

...

File "/home/me/coconut/lib64/python3.12/site-packages/coconut/compiler/util.py", line 684, in parseImpl with self.wrapped_context(): File "/usr/lib64/python3.12/contextlib.py", line 137, in __enter__ return next(self.gen) ^^^^^^^^^^^^^^ File "/home/me/coconut/lib64/python3.12/site-packages/coconut/compiler/util.py", line 669, in wrapped_context ParserElement.packrat_context.append(self.wrapper) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'frozenset' object has no attribute 'append' (you should report this at https://github.com/evhub/coconut/issues/new) Coconut exiting with error: AttributeError (coconut) $ which python /home/me/coconut/bin/python (coconut) $ python --version Python 3.12.0 Same thin happens every time so repro is easy. Let me know if you need additional information or the complete traceback.
evhub commented 9 months ago

Yep; I'm well aware of this problem—I'll try to get out a new coconut version that fixes it soon. It has to do with an incompatibility between the current released coconut and the current released cPyparsing, so you can solve the issue by downgrading cPyparsing with:

pip install cPyparsing==2.4.7.2.2.1
caedmon-kitty commented 9 months ago

Thank you for the quick response and the solution! Worked perfectly. I was going through coconut withdrawal! :-)