Title: Strange parsing errors · Issue #1543 · microsoft/python-language-server · GitHub
Open Graph Title: Strange parsing errors · Issue #1543 · microsoft/python-language-server
X Title: Strange parsing errors · Issue #1543 · microsoft/python-language-server
Description: Environment data Language Server version: 0.4.10.0 OS and version:Windows 10 Python version (& distribution if applicable, e.g. Anaconda): 3.6.4 64-bit Expected behaviour Actual behaviour There are strange parsing errors, occurring on an...
Open Graph Description: Environment data Language Server version: 0.4.10.0 OS and version:Windows 10 Python version (& distribution if applicable, e.g. Anaconda): 3.6.4 64-bit Expected behaviour Actual behaviour There are...
X Description: Environment data Language Server version: 0.4.10.0 OS and version:Windows 10 Python version (& distribution if applicable, e.g. Anaconda): 3.6.4 64-bit Expected behaviour Actual behaviour There...
Opengraph URL: https://github.com/microsoft/python-language-server/issues/1543
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Strange parsing errors","articleBody":"\u003c!-- \r\nRead the guidelines for filing an issue first. \r\n\r\nhttps://github.com/microsoft/python-language-server/blob/master/TROUBLESHOOTING.md#filing-an-issue\r\n-->\r\n\r\n## Environment data\r\n\u003c!--\r\nTo find your version: \r\n\r\nSelect \"View: Toggle Output\" from the command palette (Ctrl+Shift+P on Windows/Linux, Command+Shift+P on macOS), then select \"Python\" in the dropdown on the right (\"Python Language Server\" if running Insiders build of VS Code). Look for the line Microsoft Python Language Server version X in the console.\r\n-->\r\n\r\n- Language Server version: 0.4.10.0 \r\n- OS and version:Windows 10\r\n- Python version (& distribution if applicable, e.g. Anaconda): 3.6.4 64-bit\r\n\r\n## Expected behaviour\r\n\r\n\r\n\r\n## Actual behaviour\r\n\r\nThere are strange parsing errors, occurring on an empty line, and complaining about a non-existent token. Could this be because of some synchronization issue? As shown in the log below, the file formatted by python black is sometimes not the original file. \r\n\r\nAlso, this behavior does not show up immediately after reload, but after some time it starts to pop up. There is no syntax error in the code as it can be run successfully.\r\n\r\n\r\n## Logs\r\n\r\n\u003c!-- \r\nEnable trace logging by adding \"python.analysis.logLevel\": \"Trace\" to your settings.json configuration file.\r\n\r\nAdding this will cause a large amount of info to be printed to the Python output panel. This should not be left long term, as the performance impact of the logging is significant.\r\n-->\r\n\r\nOutput from Python Panel:\r\n\r\n```\r\nUser belongs to experiment group 'ShowPlayIcon - runFile'\r\nUser belongs to experiment group 'ShowExtensionSurveyPrompt - enabled'\r\n> conda --version\r\n> pyenv root\r\n> python3.7 -c \"import sys;print(sys.executable)\"\r\n> python3.6 -c \"import sys;print(sys.executable)\"\r\n> python3 -c \"import sys;print(sys.executable)\"\r\n> python2 -c \"import sys;print(sys.executable)\"\r\n> python -c \"import sys;print(sys.executable)\"\r\n> py -3.7 -c \"import sys;print(sys.executable)\"\r\n> py -3.6 -c \"import sys;print(sys.executable)\"\r\n> py -3 -c \"import sys;print(sys.executable)\"\r\n> py -2 -c \"import sys;print(sys.executable)\"\r\n> C:\\Programs\\Python3.6\\python.exe -c \"import sys;print(sys.executable)\"\r\n> conda info --json\r\n> ~\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe ~\\.vscode\\extensions\\ms-python.python-2019.9.34911\\pythonFiles\\interpreterInfo.py\r\n> ~\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe ~\\.vscode\\extensions\\ms-python.python-2019.9.34911\\pythonFiles\\interpreterInfo.py\r\n> ~\\AppData\\Local\\Microsoft\\WindowsApps\\python3.exe ~\\.vscode\\extensions\\ms-python.python-2019.9.34911\\pythonFiles\\interpreterInfo.py\r\n> ~\\AppData\\Local\\Microsoft\\WindowsApps\\python3.exe ~\\.vscode\\extensions\\ms-python.python-2019.9.34911\\pythonFiles\\interpreterInfo.py\r\n> ~\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe ~\\.vscode\\extensions\\ms-python.python-2019.9.34911\\pythonFiles\\interpreterInfo.py\r\n> ~\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe ~\\.vscode\\extensions\\ms-python.python-2019.9.34911\\pythonFiles\\interpreterInfo.py\r\n> ~\\AppData\\Local\\Microsoft\\WindowsApps\\python3.exe ~\\.vscode\\extensions\\ms-python.python-2019.9.34911\\pythonFiles\\interpreterInfo.py\r\n> ~\\AppData\\Local\\Microsoft\\WindowsApps\\python3.exe ~\\.vscode\\extensions\\ms-python.python-2019.9.34911\\pythonFiles\\interpreterInfo.py\r\nStarting Microsoft Python language server.\r\n> C:\\Programs\\Python3.6\\python.exe -m black -S --diff --quiet \u003cproject_root>\\1001-1100\\1093\\sol.py\r\ncwd: \u003cproject_root>\r\n> C:\\Programs\\Python3.6\\python.exe -m black -S --diff --quiet \u003cproject_root>\\1001-1100\\1093\\sol.py\r\ncwd: \u003cproject_root>\r\n> conda info --json\r\n> conda --version\r\n> C:\\Programs\\Python3.6\\python.exe -m black -S --diff --quiet \u003cproject_root>\\1001-1100\\1093\\sol.py\r\ncwd: \u003cproject_root>\r\n...\r\n> C:\\Programs\\Python3.6\\python.exe -m black -S --diff --quiet \u003cproject_root>\\1001-1100\\1093\\sol.py.1155b78ffef3cae68e5d7f36d7c73122.py\r\n...\r\n```\r\n\r\nOutput from Python Language Server Panel:\r\n\r\n```\r\n[Info - 6:20:35 PM] Microsoft Python Language Server version 0.4.10.0\r\n[Info - 6:20:35 PM] Workspace root: \u003cproject_root>\r\n[Info - 6:20:35 PM] Analysis cache path: C:\\Users\\\u003cusername>\\AppData\\Local\\Microsoft\\Python Language Server\r\n[Info - 6:20:35 PM] GetCurrentSearchPaths C:\\Programs\\Python3.6\\python.exe \r\n[Info - 6:20:35 PM] Interpreter search paths:\r\n[Info - 6:20:35 PM] c:\\programs\\python3.6\\dlls\r\n[Info - 6:20:35 PM] c:\\programs\\python3.6\\lib\r\n[Info - 6:20:35 PM] c:\\programs\\python3.6\r\n[Info - 6:20:35 PM] c:\\users\\\u003cusername>\\appdata\\roaming\\python\\python36\\site-packages\r\n[Info - 6:20:35 PM] c:\\programs\\python3.6\\lib\\site-packages\r\n[Info - 6:20:35 PM] User search paths:\r\n[Info - 6:20:38 PM] Initializing for C:\\Programs\\Python3.6\\python.exe\r\nWatching c:\\programs\\python3.6\r\nWatching c:\\users\\\u003cusername>\\appdata\\roaming\\python\\python36\\site-packages\r\nOpening document file:///\u003cproject_root>/1001-1100/1093/sol.py\r\nAnalysis of sol(User) queued\r\nAnalysis version 2 of 1 entries has started.\r\nAnalysis of sol (User) on depth 0 completed in 22.763 ms.\r\nAnalysis complete: 1 modules in 23.4171 ms.\r\nAnalysis version 2 of 1 entries has been completed in 22.9905 ms.\r\n...\r\nAnalysis version 693 of 1 entries has started.\r\nAnalysis of sol (User) on depth 0 completed in 0.5606 ms.\r\nAnalysis complete: 1 modules in 0.7808 ms.\r\nAnalysis version 693 of 1 entries has been completed in 0.6874 ms.\r\nHover in file:///\u003cproject_root>/1001-1100/1093/sol.py at (46, 35)\r\nHover in file:///\u003cproject_root>/1001-1100/1093/sol.py at (46, 15)\r\nHover in file:///\u003cproject_root>/1001-1100/1093/sol.py at (48, 21)\r\nHover in file:///\u003cproject_root>/1001-1100/1093/sol.py at (35, 8)\r\n```\r\n\r\n## Code Snippet / Additional lnformation\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\nThere are multiple issues on line 48, which is an empty line. Also, there is no 'tluserer' token in the file.\r\n\r\n\r\n\r\n\r\n```python\r\n for i, freq in enumerate(count):\r\n if not median_pos:\r\n break\r\n if not freq:\r\n continue\r\n\r\n cnt += freq\r\n while median_pos and freq >= median_pos[-1]:\r\n median_pos.pop()\r\n total += i\r\n\r\n result[3] = total / (2 - (cnt & 1))\r\n\r\n return result\r\n```\r\n\r\n\r\n","author":{"url":"https://github.com/haollhao","@type":"Person","name":"haollhao"},"datePublished":"2019-09-13T22:52:49Z","url":"https://github.com/microsoft/python-language-server/issues/1543"}
| 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:70235546-466b-5b40-21b8-c8dc909394c1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9892:2D7641:38EE52:4A691A:6AFE618B |
| html-safe-nonce | d36ea6b01c0776711c67c20c48201e1b303cc8c77c6970f4cf0c8b3694f4c3de |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODkyOjJENzY0MTozOEVFNTI6NEE2OTFBOjZBRkU2MThCIiwidmlzaXRvcl9pZCI6IjMwMjY3NjE4NTcyODE5NzQ2NjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3e47bed03c69b29a54c4c265f1d8ab09261785f4b8a63d88be881da2dbc6f394 |
| hovercard-subject-tag | issue:493545252 |
| 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/1543/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9560bf5e438393a06c91da8e933278428636a0cd9a95283465a0fc21f99313c7/microsoft/python-language-server/issues/1543 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9560bf5e438393a06c91da8e933278428636a0cd9a95283465a0fc21f99313c7/microsoft/python-language-server/issues/1543 |
| og:image:alt | Environment data Language Server version: 0.4.10.0 OS and version:Windows 10 Python version (& distribution if applicable, e.g. Anaconda): 3.6.4 64-bit Expected behaviour Actual behaviour There are... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | haollhao |
| 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