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

Crash when analyzing f-strings #41

Closed
refi64 opened this issue Oct 17, 2016 · 1 comment
Closed

Crash when analyzing f-strings #41

refi64 opened this issue Oct 17, 2016 · 1 comment

Comments

@refi64
Copy link

refi64 commented Oct 17, 2016

ryan@DevPC-LX /media/ryan/stuff/pytype master $ cat x.py
print(f'{a}')
ryan@DevPC-LX /media/ryan/stuff/pytype master $ pytype -V 3.6 x.py
Traceback (most recent call last):
  File "/usr/local/bin/pytype", line 272, in <module>
    sys.exit(main(sys.argv) or 0)
  File "/usr/local/bin/pytype", line 224, in main
    return _run_pytype(options)
  File "/usr/local/bin/pytype", line 265, in _run_pytype
    errors_csv_file=errors_csv_file)
  File "/usr/local/bin/pytype", line 172, in process_one_file
    options=options)
  File "/usr/local/bin/pytype", line 52, in check_pyi
    cache_unknowns=options.cache_unknowns)
  File "/usr/local/lib/python2.7/dist-packages/pytype/infer.py", line 585, in check_types
    py_src, py_filename, init_maximum_depth, run_builtins)
  File "/usr/local/lib/python2.7/dist-packages/pytype/vm.py", line 544, in run_program
    node, f_globals, f_locals, builtin_names = self.preload_builtins(node)
  File "/usr/local/lib/python2.7/dist-packages/pytype/vm.py", line 514, in preload_builtins
    builtins_code = self.compile_src(src)
  File "/usr/local/lib/python2.7/dist-packages/pytype/vm.py", line 499, in compile_src
    filename=filename, mode=mode)
  File "/usr/local/lib/python2.7/dist-packages/pytype/pyc/pyc.py", line 139, in compile_src
    code = parse_pyc_string(pyc_data)
  File "/usr/local/lib/python2.7/dist-packages/pytype/pyc/pyc.py", line 110, in parse_pyc_string
    return parse_pyc_stream(StringIO.StringIO(data))
  File "/usr/local/lib/python2.7/dist-packages/pytype/pyc/pyc.py", line 90, in parse_pyc_stream
    python_version = magic.magic_word_to_version(magic_word)
  File "/usr/local/lib/python2.7/dist-packages/pytype/pyc/magic.py", line 105, in magic_word_to_version
    return PYTHON_MAGIC[magic_word]
KeyError: 3377
ryan@DevPC-LX /media/ryan/stuff/pytype master $ 
@matthiaskramm
Copy link
Contributor

Yeah, looks like pytype isn't even aware of Python 3.6 yet. It crashes when reading out the version number.

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