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

hy script.hy crashes on Python 3.12.6 #2598

Closed
natrys opened this issue Sep 8, 2024 · 2 comments · Fixed by #2599
Closed

hy script.hy crashes on Python 3.12.6 #2598

natrys opened this issue Sep 8, 2024 · 2 comments · Fixed by #2599
Labels

Comments

@natrys
Copy link

natrys commented Sep 8, 2024

Running hy on its own works and starts the repl, but running a script by passing a file argument seems to fail. Tested on my OS (void linux) python that was updated this morning, but also found a docker image that can reproduce it:

λ podman run --rm -it bitnami/python:3.12.6 /bin/bash
root@a649c1b214dd:/app# python -m venv venv

root@a649c1b214dd:/app# source venv/bin/activate

(venv) root@a649c1b214dd:/app# pip install git+https://github.com/hylang/hy
Collecting git+https://github.com/hylang/hy
  Cloning https://github.com/hylang/hy to /tmp/pip-req-build-5bgwh8n6
  Running command git clone --filter=blob:none --quiet https://github.com/hylang/hy /tmp/pip-req-build-5bgwh8n6
  Resolved https://github.com/hylang/hy to commit ed524c61c54ab5a466fa8519b5233b5d1afce0dc
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting funcparserlib~=1.0 (from hy==0.0.0)
  Using cached funcparserlib-1.0.1-py2.py3-none-any.whl.metadata (7.1 kB)
Using cached funcparserlib-1.0.1-py2.py3-none-any.whl (17 kB)
Building wheels for collected packages: hy
  Building wheel for hy (pyproject.toml) ... done
  Created wheel for hy: filename=hy-0.0.0-py3-none-any.whl size=115106 sha256=09d5c5cdd41c4cbf074fd80197b170e9ae14cde7cc02ab3a71bde94c47157a83
  Stored in directory: /tmp/pip-ephem-wheel-cache-na5a_xk8/wheels/5f/d2/29/c1fef11f15b05514e2234c0334158a097f5b2f2bd25c9e6793
Successfully built hy
Installing collected packages: funcparserlib, hy
Successfully installed funcparserlib-1.0.1 hy-0.0.0

(venv) root@a649c1b214dd:/app# echo '(print "hello")' > test.hy

(venv) root@a649c1b214dd:/app# hy test.hy
Traceback (most recent call last):
  File "/app/venv/bin/hy", line 8, in <module>
    sys.exit(hy_main())
             ^^^^^^^^^
  File "<frozen runpy>", line 287, in run_path
  File "<frozen runpy>", line 98, in _run_module_code
  File "<frozen runpy>", line 88, in _run_code
TypeError: exec() arg 1 must be a string, bytes or code object
@Kodiologist
Copy link
Member

Thanks for the quick report. I can reproduce this with a freshly compiled Python 3.12.6 on Ubuntu. I'm looking into it.

@Kodiologist
Copy link
Member

It's likely due to changes to runpy that we need to adapt to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants