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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken on latest Python 3.6 release (3.6.0b1) #1111

Closed
tianon opened this issue Sep 21, 2016 · 3 comments
Closed

Broken on latest Python 3.6 release (3.6.0b1) #1111

tianon opened this issue Sep 21, 2016 · 3 comments

Comments

@tianon
Copy link
Member

tianon commented Sep 21, 2016

Looks like the latest 3.6.0b1 release broke Hy. 馃槩

I mentioned this on IRC a little while back and @berkerpeksag mentioned it's probably an easy fix, but it's over my head. 馃槆

root@4315e0242dc3:/# python --version
Python 3.6.0b1
root@4315e0242dc3:/# pip install hy
Collecting hy
  Downloading hy-0.11.1.tar.gz (43kB)
    100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 51kB 517kB/s 
Collecting rply>=0.7.0 (from hy)
  Downloading rply-0.7.4-py2.py3-none-any.whl
Collecting astor>=0.5 (from hy)
  Downloading astor-0.5-py2.py3-none-any.whl
Collecting clint>=0.4 (from hy)
  Downloading clint-0.5.1.tar.gz
Collecting appdirs (from rply>=0.7.0->hy)
  Downloading appdirs-1.4.0-py2.py3-none-any.whl
Collecting args (from clint>=0.4->hy)
  Downloading args-0.1.0.tar.gz
Installing collected packages: appdirs, rply, astor, args, clint, hy
  Running setup.py install for args ... done
  Running setup.py install for clint ... done
  Running setup.py install for hy ... done
Successfully installed appdirs-1.4.0 args-0.1.0 astor-0.5 clint-0.5.1 hy-0.11.1 rply-0.7.4
root@4315e0242dc3:/# hy
hy 0.11.1 using CPython(default) 3.6.0b1 on Linux
=> (+ 2 2)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/hy/compiler.py", line 2304, in hy_compile
    compiler = HyASTCompiler(module_name)
  File "/usr/local/lib/python3.6/site-packages/hy/compiler.py", line 378, in __init__
    load_stdlib()
  File "/usr/local/lib/python3.6/site-packages/hy/compiler.py", line 73, in load_stdlib
    mod = importlib.import_module(module)
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 646, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 616, in _load_backward_compatible
  File "/usr/local/lib/python3.6/site-packages/hy/importer.py", line 180, in load_module
    self.path)
  File "/usr/local/lib/python3.6/site-packages/hy/importer.py", line 78, in import_file_to_module
    eval(ast_compile(_ast, fpath, "exec"), mod.__dict__)
  File "/usr/local/lib/python3.6/site-packages/hy/importer.py", line 43, in ast_compile
    return compile(ast, filename, mode, flags)
TypeError: required field "is_async" missing from comprehension
=> 

And again from Git master, for completeness:

root@4315e0242dc3:/# pip install git+https://github.com/hylang/hy.git
Collecting git+https://github.com/hylang/hy.git
  Cloning https://github.com/hylang/hy.git to /tmp/pip-4bk8r7cy-build
Requirement already satisfied (use --upgrade to upgrade): rply>=0.7.0 in /usr/local/lib/python3.6/site-packages (from hy==0.11.0)
Requirement already satisfied (use --upgrade to upgrade): astor>=0.5 in /usr/local/lib/python3.6/site-packages (from hy==0.11.0)
Requirement already satisfied (use --upgrade to upgrade): clint>=0.4 in /usr/local/lib/python3.6/site-packages (from hy==0.11.0)
Requirement already satisfied (use --upgrade to upgrade): appdirs in /usr/local/lib/python3.6/site-packages (from rply>=0.7.0->hy==0.11.0)
Requirement already satisfied (use --upgrade to upgrade): args in /usr/local/lib/python3.6/site-packages (from clint>=0.4->hy==0.11.0)
Installing collected packages: hy
  Found existing installation: hy 0.11.1
    Uninstalling hy-0.11.1:
      Successfully uninstalled hy-0.11.1
  Running setup.py install for hy ... done
Successfully installed hy-0.11.0
root@4315e0242dc3:/# hy
hy 0.11.0 using CPython(default) 3.6.0b1 on Linux
=> (+ 2 2)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/hy/compiler.py", line 2601, in hy_compile
    compiler = HyASTCompiler(module_name)
  File "/usr/local/lib/python3.6/site-packages/hy/compiler.py", line 383, in __init__
    load_stdlib()
  File "/usr/local/lib/python3.6/site-packages/hy/compiler.py", line 76, in load_stdlib
    mod = importlib.import_module(module)
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 646, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 616, in _load_backward_compatible
  File "/usr/local/lib/python3.6/site-packages/hy/importer.py", line 188, in load_module
    self.path)
  File "/usr/local/lib/python3.6/site-packages/hy/importer.py", line 79, in import_file_to_module
    eval(ast_compile(_ast, fpath, "exec"), mod.__dict__)
  File "/usr/local/lib/python3.6/site-packages/hy/importer.py", line 44, in ast_compile
    return compile(ast, filename, mode, flags)
TypeError: required field "is_async" missing from comprehension
=> 
@zackmdavis
Copy link
Contributor

a PEP 530 grammar change, grepping suggests we likely just need an is_async=False one place in _compile_generator_iterables()? Patch later

zackmdavis added a commit to zackmdavis/hy that referenced this issue Sep 22, 2016
In issue hylang#1111, @tianon reported that Hy didn't work with Python
3.6.0b1: trying to evaluate a simple expression at the REPL blew up with
`TypeError: required field "is_async" missing from comprehension`. This
was due to a grammar
change (https://www.python.org/dev/peps/pep-0530/#grammar-updates) in
the implementation (https://hg.python.org/cpython/rev/cf91a929b81a) of
PEP 530, which we can easily accomodate.
@gilch
Copy link
Member

gilch commented Sep 24, 2016

@tianon, @zackmdavis, I think it's working now. I'll close this issue.

@gilch gilch closed this as completed Sep 24, 2016
@zackmdavis
Copy link
Contributor

my pull request probably also should have mentioned that I locally tested with CPython master (3.7.0a0 python/cpython@174a57d08) and it worked

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

No branches or pull requests

3 participants