Title: Python parser becomes mad · Issue #2026 · microsoft/python-language-server · GitHub
Open Graph Title: Python parser becomes mad · Issue #2026 · microsoft/python-language-server
X Title: Python parser becomes mad · Issue #2026 · microsoft/python-language-server
Description: Environment data VS Code version: Version: 1.44.0 (user setup) Commit: Extension version (available under the Extensions sidebar): 2020.4.76186 + reload required. So most likely 2020.4.0 OS and version: OS: Windows_NT x64 10.0.18362 Pyth...
Open Graph Description: Environment data VS Code version: Version: 1.44.0 (user setup) Commit: Extension version (available under the Extensions sidebar): 2020.4.76186 + reload required. So most likely 2020.4.0 OS and ver...
X Description: Environment data VS Code version: Version: 1.44.0 (user setup) Commit: Extension version (available under the Extensions sidebar): 2020.4.76186 + reload required. So most likely 2020.4.0 OS and ver...
Opengraph URL: https://github.com/microsoft/python-language-server/issues/2026
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Python parser becomes mad","articleBody":"\u003c!-- Please search existing issues to avoid creating duplicates. -->\r\n\r\n## Environment data\r\n\r\n- VS Code version: Version: 1.44.0 (user setup) Commit: \r\n- Extension version (available under the Extensions sidebar): 2020.4.76186 + reload required. So most likely 2020.4.0\r\n- OS and version: OS: Windows_NT x64 10.0.18362\r\n- Python version: 3.7.4\r\n- Type of virtual environment used: N/A\r\n- Jedi or Language Server? (i.e. what is `\"python.jediEnabled\"` set to; more info microsoft/vscode-python#3977): Jedi\r\n- Value of the `python.languageServer` setting: Microsoft\r\n\r\n## Expected behaviour\r\n\r\nI expect python parser, linter and intellisense to remain sane.\r\n\r\n## Actual behaviour\r\n\r\nFirst comes linter amnesia. Linter stops recognizing some (say, every 5th) pythons standard library imports, function parameters, functions etc (\"undefined variable\").\r\nThen the parser starts going mad. It starts blabbling nonsense and putting red squiggles under, say part of the called function name (not the whole name) or starts complaining about completely empty lines.\r\nThen the parser goes completely mad.\r\nSee the screenshot:\r\nSee, for example, how it gets mad about the following line:\r\n```\r\n stream.seek(0)\r\n~~~~~~ --- ~~~~~~ ~\r\n```\r\n\r\n\r\n\r\nReopening the file does not solve the problem.\r\n\r\n\r\n## Steps to reproduce:\r\n\r\nUse VSCode to edit python files for awhile.\r\n\r\n1. XXX\r\n\r\n\u003c!--\r\nNote: If you think a GIF of what is happening would be helpful, consider tools like https://www.cockos.com/licecap/, https://github.com/phw/peek or https://www.screentogif.com/ .\r\n-->\r\n\r\n## Logs\r\n\r\n\u003cdetails>\r\n\r\n\u003csummary>Output for \u003ccode>Python\u003c/code> in the \u003ccode>Output\u003c/code> panel (\u003ccode>View\u003c/code>→\u003ccode>Output\u003c/code>, change the drop-down the upper-right of the \u003ccode>Output\u003c/code> panel to \u003ccode>Python\u003c/code>)\r\n\u003c/summary>\r\n\r\n\u003cp>\r\n\r\n```\r\n ~\\AppData\\Local\\Programs\\Python\\Python37\\python.exe c:\\Users\\Ark\\.vscode\\extensions\\ms-python.python-2020.4.74986\\pythonFiles\\pyvsc-run-isolated.py pylint --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text a:\\_All\\My.Work\\2018.Google\\pipelines_worktree3\\sdk\\python\\kfp\\components\\_components.py\r\ncwd: a:\\_All\\My.Work\\2018.Google\\pipelines_worktree3\r\n> ~\\AppData\\Local\\Programs\\Python\\Python37\\python.exe c:\\Users\\Ark\\.vscode\\extensions\\ms-python.python-2020.4.74986\\pythonFiles\\pyvsc-run-isolated.py pylint --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text a:\\_All\\My.Work\\2018.Google\\pipelines_worktree3\\sdk\\python\\kfp\\components\\_components.py\r\ncwd: a:\\_All\\My.Work\\2018.Google\\pipelines_worktree3\r\n##########Linting Output - pylint##########\r\n************* Module kfp.components._components\r\n\r\n...\r\n28,0,warning,unused-wildcard-import:Unused import ModelBase from wildcard import\r\n28,0,warning,unused-wildcard-import:Unused import v1 from wildcard import\r\n\r\n--------------------------------------------------------------------\r\n\r\nYour code has been rated at -6.46/10 (previous run: -7.47/10, +1.01)\r\n\r\n```\r\n\r\n\u003c/p>\r\n\u003c/details>\r\n\r\n\u003cbr />\r\n\r\n\u003cdetails>\r\n\r\n\u003csummary>\r\nOutput from \u003ccode>Console\u003c/code> under the \u003ccode>Developer Tools\u003c/code> panel (toggle Developer Tools on under \u003ccode>Help\u003c/code>; turn on source maps to make any tracebacks be useful by running \u003ccode>Enable source map support for extension debugging\u003c/code>)\r\n\u003c/summary>\r\n\r\n\u003cp>\r\n\r\n```\r\n[Extension Host] Info Python Extension: 2020-05-08 00:33:38: Get Interpreters, Class name = m, completed in 3ms, has a truthy return value, Arg 1: \u003cUri:extension-output-#4>, Return Value: [{\"architecture\":3,\"path\":\"C:\\\\Users\\\\Ark\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python36\\\\python.exe\",\"version\":{\"options\":{\"loose\":false,\"includePrerelease\":false},\"loose\":false,\"raw\":\"3.6.8-final\",\"major\":3,\"minor\":6,\"patch\":8,\"prerelease\":[\"final\"],\"build\":[],\"version\":\"3.6.8-final\"},\"sysPrefix\":\"C:\\\\Users\\\\Ark\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python36\",\"fileHash\":\"d8960e12ef07ddaee6375e767551fbfd0694ab5d58f1d8622d33f38c6fe51446664190bf3ac8243070f7c81292f440552fcc9dbe98bd725da821975be7805025\",\"companyDisplayName\":\"Python Software Foundation\",\"type\":\"Unknown\"},{\"architecture\":3,\"path\":\"C:\\\\Users\\\\Ark\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python37\\\\python.exe\",\"version\":{\"options\":{\"loose\":false,\"includePrerelease\":false},\"loose\":false,\"raw\":\"3.7.4-final\",\"major\":3,\"minor\":7,\"patch\":4,\"prerelease\":[\"final\"],\"build\":[],\"version\":\"3.7.4-final\"},\"sysPrefix\":\"C:\\\\Users\\\\Ark\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python37\",\"fileHash\":\"d591d478a633ceff71969a58af7ba651bb29d7736de0b464e7c67e8f7b5d156de6b92ce7af76e761879b679422a72aec2efbf3569b890f0b764651097b5f7b6e\",\"companyDisplayName\":\"Python Software Foundation\",\"type\":\"Unknown\"},{\"architecture\":3,\"path\":\"C:\\\\Users\\\\Ark\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python38\\\\python.exe\",\"version\":{\"options\":{\"loose\":false,\"includePrerelease\":false},\"loose\":false,\"raw\":\"3.8.0-final\",\"major\":3,\"minor\":8,\"patch\":0,\"prerelease\":[\"final\"],\"build\":[],\"version\":\"3.8.0-final\"},\"sysPrefix\":\"C:\\\\Users\\\\Ark\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python38\",\"fileHash\":\"ed512353e78684e176ddff3b84fe349ab306ec6012a7b002a86592a2eb55cba0908251c2a10e82d4834e45d329f860b4eda06f1b6ff428a4c58613d3c0de1933\",\"companyDisplayName\":\"Python Software Foundation\",\"type\":\"Unknown\"},{\"architecture\":3,\"path\":\"C:\\\\Users\\\\Ark\\\\.conda\\\\envs\\\\cntk-py36\\\\python.exe\",\"version\":{\"options\":{\"loose\":false,\"includePrerelease\":false},\"loose\":false,\"raw\":\"3.6.3-final\",\"major\":3,\"minor\":6,\"patch\":3,\"prerelease\":[\"final\"],\"build\":[],\"version\":\"3.6.3-final\"},\"sysPrefix\":\"C:\\\\Users\\\\Ark\\\\.conda\\\\envs\\\\cntk-py36\",\"fileHash\":\"a0bd41de85351be4071992206e7ffed3fb9e599cd024a75736f319df12ba9410bff6663c6366192c5d63e3f19d48f8f823083ff77ea7cf831a19ea8260d7b0bb\",\"companyDisplayName\":\"Custom environment\",\"type\":\"Conda\",\"envName\":\"cntk-py36\",\"envPath\":\"C:\\\\Users\\\\Ark\\\\.conda\\\\envs\\\\cntk-py36\"},{\"architecture\":3,\"path\":\"C:\\\\Program Files (x86)\\\\Microsoft Visual Studio\\\\Shared\\\\Python37_64\\\\python.exe\",\"version\":{\"options\":{\"loose\":false,\"includePrerelease\":false},\"loose\":false,\"raw\":\"3.7.3-final\",\"major\":3,\"minor\":7,\"patch\":3,\"prerelease\":[\"final\"],\"build\":[],\"version\":\"3.7.3-final\"},\"sysPrefix\":\"C:\\\\Program Files (x86)\\\\Microsoft Visual Studio\\\\Shared\\\\Python37_64\",\"fileHash\":\"8b14b406fe0312567826cda18b2ef868b1e9b5efae0f9a42957223ce946b08797d08ea2ca2ff928f5bd93803962851270e572cfa8e3eac63e248ef703cbc1ae5\",\"companyDisplayName\":\"Python Software Foundation\",\"type\":\"Unknown\"},{\"architecture\":3,\"path\":\"C:\\\\Users\\\\Ark\\\\.conda\\\\envs\\\\tensorflow35\\\\python.exe\",\"version\":{\"options\":{\"loose\":false,\"includePrerelease\":false},\"loose\":false,\"raw\":\"3.5.3-final\",\"major\":3,\"minor\":5,\"patch\":3,\"prerelease\":[\"final\"],\"build\":[],\"version\":\"3.5.3-final\"},\"sysPrefix\":\"C:\\\\Users\\\\Ark\\\\.conda\\\\envs\\\\tensorflow35\",\"fileHash\":\"a3a5a8b24569b4c7f3168897abccc23a3d6d37348b387b92dc3876432086347fd57d7837cd172f8d69b046f877269365f014b6d2c0b7d8553ed8706f3cc81305\",\"companyDisplayName\":\"Anaconda, Inc.\",\"type\":\"Conda\",\"envPath\":\"C:\\\\Users\\\\Ark\\\\.conda\\\\envs\\\\tensorflow35\",\"envName\":\"tensorflow35\"}]\r\n```\r\n\r\n\u003c/p>\r\n\u003c/details>\r\n\r\nPython language server logs only have intellisense exceptions:\r\n```\r\n[Error - 23:59:38] Exception in IntelliCode extension for Microsoft Python Language Server: System.IO.IOException: The process cannot access the file 'c:\\Users\\Ark\\.vscode\\extensions\\visualstudioexptteam.vscodeintellicode-1.2.6\\cache\\15708AE89896CA5DF1690433B7A8D93D28B7_215F8B4FAB1F4663ABD624559FD205B9' because it is being used by another process.\r\n at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)\r\n at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)\r\n at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)\r\n at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)\r\n at System.IO.Compression.ZipFile.Open(String archiveFileName, ZipArchiveMode mode, Encoding entryNameEncoding)\r\n at System.IO.Compression.ZipFile.ExtractToDirectory(String sourceArchiveFileName, String destinationDirectoryName, Encoding entryNameEncoding, Boolean overwriteFiles)\r\n at System.IO.Compression.ZipFile.ExtractToDirectory(String sourceArchiveFileName, String destinationDirectoryName, Boolean overwriteFiles)\r\n at Microsoft.PythonTools.Analysis.Pythia.PythiaModelLoader.LoadModel(String modelPath, ILogger logger, IDictionary`2& tokenIdMap, IList`1& tokens, InferenceSession& session, PythiaModelMetaData& modelMetaData)\r\n at Microsoft.PythonTools.Analysis.Pythia.PythiaService.\u003cLoadModel>b__18_0()\r\n at System.Threading.Tasks.Task.InnerInvoke()\r\n at System.Threading.Tasks.Task.\u003c>c.\u003c.cctor>b__274_0(Object obj)\r\n at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at Microsoft.PythonTools.Analysis.Pythia.PythiaService.GetRecommendationsAsync(IDocumentAnalysis analysis, CompletionList completionList, SourceLocation location, Int32 recommendataionLimit, CancellationToken cancellationToken)\r\n at Microsoft.PythonTools.Analysis.Pythia.LanguageServerExtension.HandleCompletionAsync(IDocumentAnalysis analysis, SourceLocation location, CompletionList completionList, CancellationToken token)\r\n[Error - 23:59:38] For more information about IntelliCode deep learning model, see https://aka.ms/intellicode/vscode-experiments\r\n```\r\n","author":{"url":"https://github.com/Ark-kun","@type":"Person","name":"Ark-kun"},"datePublished":"2020-05-08T07:56:52Z","url":"https://github.com/microsoft/python-language-server/issues/2026"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d16ac9bc-6bdc-2bd1-2289-042fce2e5ae4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 911E:1325C0:3E0F52:516EAA:6AFE6186 |
| html-safe-nonce | c2842f430f57c7a5d0f1711e9643d8245604e2242896719cd31809ff33195326 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTFFOjEzMjVDMDozRTBGNTI6NTE2RUFBOjZBRkU2MTg2IiwidmlzaXRvcl9pZCI6IjcyNDI0ODMxNjY5NzAwMTIwMzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6ddc8455677a53e2ce75350b02dbd2574e68853fca979dae289a5cfd0c9b97c0 |
| hovercard-subject-tag | issue:616051571 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/python-language-server/2026/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dd9f882ca7efbc2c430eb9103b11fa74c9ace83a8622158a7ff158e589aa432f/microsoft/python-language-server/issues/2026 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dd9f882ca7efbc2c430eb9103b11fa74c9ace83a8622158a7ff158e589aa432f/microsoft/python-language-server/issues/2026 |
| og:image:alt | Environment data VS Code version: Version: 1.44.0 (user setup) Commit: Extension version (available under the Extensions sidebar): 2020.4.76186 + reload required. So most likely 2020.4.0 OS and ver... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Ark-kun |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/python-language-server git https://github.com/microsoft/python-language-server.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 145901977 |
| octolytics-dimension-repository_nwo | microsoft/python-language-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 145901977 |
| octolytics-dimension-repository_network_root_nwo | microsoft/python-language-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width