weird python type check issue… :thread:
# general
c
weird python type check issue… 🧵
1
just hoping, if this looks familiar to anyone by any chance… 🤞 ?
Copy code
16:10:06.75 [ERROR] Completed: Typecheck using MyPy - mypy failed (exit code 1).
Traceback (most recent call last):
  File "/private/var/folders/y2/6t5bbk554wv5h6w_qlgpcpnm0000gr/T/pants-sandbox-dSFLgJ/.cache/pex_root/venvs/b937c74c22b0d000ebb91030e0cdc9d4c9d625c4/b804a7d1f8bd9cd2ff386af6a48d90174070910e/pex", line 246, in <module>
    sys.exit(func())
  File "/Users/andreas.stenius/.cache/pants/named_caches/pex_root/venvs/s/e5420cff/venv/lib/python3.8/site-packages/mypy/__main__.py", line 12, in console_entry
    main(None, sys.stdout, sys.stderr)
  File "mypy/main.py", line 96, in main
  File "mypy/main.py", line 173, in run_build
  File "mypy/build.py", line 154, in build
  File "mypy/build.py", line 230, in _build
  File "mypy/build.py", line 2729, in dispatch
  File "mypy/build.py", line 3087, in process_graph
  File "mypy/build.py", line 3205, in process_stale_scc
  File "mypy/build.py", line 2313, in write_cache
  File "mypy/build.py", line 1471, in write_cache
  File "mypy/build.py", line 1424, in json_dumps
  File "/Users/andreas.stenius/.pyenv/versions/3.8.13/lib/python3.8/json/__init__.py", line 234, in dumps
    return cls(
  File "/Users/andreas.stenius/.pyenv/versions/3.8.13/lib/python3.8/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/Users/andreas.stenius/.pyenv/versions/3.8.13/lib/python3.8/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/Users/andreas.stenius/.pyenv/versions/3.8.13/lib/python3.8/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type AnyType is not JSON serializable
not sure what I’ve done to get here 😛 but I’ll guess I’ll have to revert changes one by one to get back to a working state… (private repo tho, so can’t share the actual diff..)
👀 1
🤷 1
Ah, yes, upgrading
django-stubs
to
1.12.0
solved it.. 😅