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 interpolating bytes with dictionary #7293

Closed
benjaminp opened this issue Aug 6, 2019 · 0 comments · Fixed by #7297
Closed

crash interpolating bytes with dictionary #7293

benjaminp opened this issue Aug 6, 2019 · 0 comments · Fixed by #7297

Comments

@benjaminp
Copy link

benjaminp commented Aug 6, 2019

$ cat example.py
print(b'%(x)s' % {b'x': b'data'})
$ python3 example.py
b'data'
$ mypy example.py --show-traceback
mypy example.py  --show-traceback
example.py:1: error: INTERNAL ERROR -- Please try using mypy master on Github:
https://mypy.rtfd.io/en/latest/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 0.720
Traceback (most recent call last):
  File "mypy/checkexpr.py", line 3404, in accept
  File "mypy/nodes.py", line 1708, in accept
  File "mypy/checkexpr.py", line 1891, in visit_op_expr__ExpressionVisitor_glue
  File "mypy/checkexpr.py", line 1906, in visit_op_expr
  File "mypy/checkstrformat.py", line 97, in check_str_interpolation
  File "mypy/checkstrformat.py", line 178, in check_mapping_str_interpolation
TypeError: StrExpr object expected
example.py:1: : note: use --pdb to drop into pdb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants