question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pylint throws error "TypeError: Converting circular structure to JSON" when using pylint + any combination of other linters.

See original GitHub issue

Environment data

  • VS Code version: 1.30.0
  • Extension version (available under the Extensions sidebar): 2018.12.0
  • OS and version: MacOS 10.14.2 (18C54)
  • Python version (& distribution if applicable, e.g. Anaconda): python 3.6.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): venv
  • Relevant/affected Python packages and their versions:
pylint 2.2.2
astroid 2.0.4
Python 3.6.6 (default, Sep 17 2018, 16:44:58)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)]

Extension infomation:

Name: Python
Id: ms-python.python
Description: Linting, Debugging (multi-threaded, remote), Intellisense, code formatting, refactoring, unit tests, snippets, and more.
Version: 2018.12.0
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.python

Expected behaviour

Pylint work as it was

Actual behaviour

image

Steps to reproduce:

  1. Upgrade vscode python extension to 2018.12.0
  2. open any python file

Logs

Starting Microsoft Python language server.
Linting with mypy failed.
TypeError: Converting circular structure to JSON
Linting with pylint failed.
TypeError: Converting circular structure to JSON
##########Linting Output - bandit##########
94,0,MEDIUM,B104:Possible binding to all interfaces.
173,0,LOW,B101:Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
188,0,LOW,B101:Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
189,0,LOW,B101:Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Microsoft Python Language Server version 0.1.72.0
Initializing for /Users/ruohan.chen/.pyenv/versions/vpc_test-3.6.6/bin/python

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

[Extension Host] [modelines] could not find TextEditor
console.ts:134 [Extension Host] Python Extension: There was an error in running the linter mypy TypeError: Converting circular structure to JSON
	at JSON.stringify (<anonymous>)
	at module.exports.t.ProcessService.getDefaultOptions (/Users/ruohan.chen/.vscode/extensions/ms-python.python-2018.12.0/out/client/extension.js:83:315447)
	at module.exports.t.ProcessService.exec (/Users/ruohan.chen/.vscode/extensions/ms-python.python-2018.12.0/out/client/extension.js:83:314478)
	at p.<anonymous> (/Users/ruohan.chen/.vscode/extensions/ms-python.python-2018.12.0/out/client/extension.js:83:326851)
	at Generator.next (<anonymous>)
	at module.exports.i (/Users/ruohan.chen/.vscode/extensions/ms-python.python-2018.12.0/out/client/extension.js:83:324782)
	at new Promise (<anonymous>)
	at module.exports.i (/Users/ruohan.chen/.vscode/extensions/ms-python.python-2018.12.0/out/client/extension.js:83:324559)
	at p.execModule (/Users/ruohan.chen/.vscode/extensions/ms-python.python-2018.12.0/out/client/extension.js:83:326765)
	at u.<anonymous> (/Users/ruohan.chen/.vscode/extensions/ms-python.python-2018.12.0/out/client/extension.js:83:328639)
	at Generator.next (<anonymous>)
	at s (/Users/ruohan.chen/.vscode/extensions/ms-python.python-2018.12.0/out/client/extension.js:83:327651)
	at <anonymous>
t.log @ console.ts:134
notificationsAlerts.ts:40 There was an error in running the linter 'mypy'
t.onDidNotificationChange @ notificationsAlerts.ts:40
console.ts:134 [Extension Host] Python Extension: There was an error in running the linter pylint TypeError: Converting circular structure to JSON
	at JSON.stringify (<anonymous>)
	at module.exports.t.ProcessService.getDefaultOptions (/Users/ruohan.chen/.vscode/extensions/ms-python.python-2018.12.0/out/client/extension.js:83:315447)
	at module.exports.t.ProcessService.exec (/Users/ruohan.chen/.vscode/extensions/ms-python.python-2018.12.0/out/client/extension.js:83:314478)
	at p.<anonymous> (/Users/ruohan.chen/.vscode/extensions/ms-python.python-2018.12.0/out/client/extension.js:83:326851)
	at Generator.next (<anonymous>)
	at module.exports.i (/Users/ruohan.chen/.vscode/extensions/ms-python.python-2018.12.0/out/client/extension.js:83:324782)
	at new Promise (<anonymous>)
	at module.exports.i (/Users/ruohan.chen/.vscode/extensions/ms-python.python-2018.12.0/out/client/extension.js:83:324559)
	at p.execModule (/Users/ruohan.chen/.vscode/extensions/ms-python.python-2018.12.0/out/client/extension.js:83:326765)
	at u.<anonymous> (/Users/ruohan.chen/.vscode/extensions/ms-python.python-2018.12.0/out/client/extension.js:83:328639)
	at Generator.next (<anonymous>)
	at s (/Users/ruohan.chen/.vscode/extensions/ms-python.python-2018.12.0/out/client/extension.js:83:327651)
	at <anonymous>
t.log @ console.ts:134
notificationsAlerts.ts:40 There was an error in running the linter 'pylint'
t.onDidNotificationChange @ notificationsAlerts.ts:40
console.ts:134 [Extension Host] [modelines] setting editor options: {}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:23
  • Comments:8

github_iconTop GitHub Comments

6reactions
Gr1Ncommented, Dec 14, 2018

Same issue

4reactions
matthieugouelcommented, Dec 14, 2018

I have the same problem using flake8 and mypy which both fails the same way (but bandit not) but I don’t use pylint. Only on version 2018.12.0.

Starting Jedi Python language engine.
Linting with mypy failed.
TypeError: Converting circular structure to JSON
Linting with flake8 failed.
TypeError: Converting circular structure to JSON
##########Linting Output - bandit##########
Read more comments on GitHub >

github_iconTop Results From Across the Web

What is TypeError: Converting circular structure to JSON?
TypeError : Converting circular structure to JSON occurs when you try to reference your variable name within the JSON object. ... The code...
Read more >
Release highlights - Pylint 2.16.0-dev documentation
A new error check was added, invalid-metaclass , which is used whenever pylint can detect that a given class is using a metaclass...
Read more >
How to fix TypeError: Converting circular structure to JSON in ...
To fix this error, you need to make sure that your objects don't contain circular references. One way to do this is to...
Read more >
Code Issues - Embold Help Center
Embold comes with a state-of-the-art proprietary analyser. ... If any exception is thrown from within a static constructor, the type is unusable for...
Read more >
Changelog — conan 1.56.0 documentation
Docs here; Feature: Fail sooner and with a meaningful error if the specified ... Docs here; Bugfix: Fix crash in pylint plugin with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found