-
Notifications
You must be signed in to change notification settings - Fork 133
Scraper produces incorrect output for the Anaconda 2X builtin #719
Comments
Do you have files open which are not saved to disk but are marked in VS Code as Python? (i.e. "Untitled") Setting |
No. Closed all files and reloaded the window. After that closed the folder project and reopened and then the whole code instance. All times opening a python file would trigger the error. I added Trace as the log level but doesn't seem to give more information apart from the search paths and the above stack trace. |
Can you share your search paths? |
Sure.
|
I tested with another smaller git repository I have and it there it didn't gave the above error so it must be related to a dependency in that one specific repository. |
Update on this. Switching from the virtualenv to the system python or another virtualenv doesn't trigger the error, which leads me to believe that a library in that virtualenv could be the cause. Sadly the virtualenv in question has 296 libraries installed, which it will make tracking the offending one hard. One thing I'm noticing, is that when I switch to another virtualenv or system python, I get messages in the status bar, Is there a cache that can be cleared, or something that could be analyzing old versions of the files? That's a long shot since most likely this is caused by a specific library. |
If initialization fails, it'll never get to the point where we send messages about the ongoing analysis, so that makes sense. The only caching we have is of scraped files (for example, info extracted from compiled files), which you can delete by deleting the From looking through the code, I think this may be happening because |
@CMLL , can you look up for a |
|
Fixes #719. Looking at the stack trace on that issue, `Initialize` occurs, which eventually gets an AST, which then spawns a task which eventually calls `CreateModule`, which refers back to `PythonInterpreter`, whose stub resolver has not yet been instantiated. I don't believe instantiating it earlier has any effect other than that it's there earlier so won't be `null`, as `InitializeAsync` only sets up an internal path resolver. I'm not really sure if this is the "true" fix, since it seems weird for there to be this sort of cycle, but I'm not the most familiar with this specific bit.
@CMLL This is theoretically fixed with that merged PR, so the issue was closed (we'll need to do a build), but knowing the answer to Alex's question is probably a good thing. You can find it somewhere in the Python extension directory (in one of the subdirectories with long names). |
@jakebailey That's great to hear. I'll be checking the beta channel for that new build to test it out. @AlexanderSher I found several *.pyi files in Doing a grep for Example of the imports found in those files....
|
Ignore the typeshed directory, those are included from: https://github.com/python/typeshed It's the one in the garbled directory (which is the hash of some info). |
Well, ignoring the ones in Typeshed then, these are the ones that have an import...
|
So this one is |
Correct, this is the start of that file...
|
Can you rename/remove this file from the cache (without deleting it) and try to run VSCode again? I want to compare with the newly created |
Renamed the file and launched vscode again. Seems like the new file was named |
Seems that the file only gets generated when I'm using the virtualenv that has the error. If I use a system python the |
It is probably generated in another folder |
Yeah. Seems like it is. I checked this folder
|
Looks like the problem is in the scraper. For the normal case, scraper should've created something like this:
In case of your virtualenv, it creates this:
|
@CMLL , in the |
Ok, I can reproduce it in anaconda 2.7 |
What are the arguments for
And directly passing a python file or a folder containing python files returns
If I call the script without arguments I get the output, starting with
|
Great that there is a fix for this.I downloaded the beta build this morning and noticed that it got bumped to 0.2.17. Does that include this commit? I could spin it around and test it with my virtualenv. Is there a way to know up to what commit the beta branch is built? Thanks for the fast fix. Edit: |
It includes my PR, but not Alex's. His is a broader fix which helps in another way. |
Fixes microsoft#719. Looking at the stack trace on that issue, `Initialize` occurs, which eventually gets an AST, which then spawns a task which eventually calls `CreateModule`, which refers back to `PythonInterpreter`, whose stub resolver has not yet been instantiated. I don't believe instantiating it earlier has any effect other than that it's there earlier so won't be `null`, as `InitializeAsync` only sets up an internal path resolver. I'm not really sure if this is the "true" fix, since it seems weird for there to be this sort of cycle, but I'm not the most familiar with this specific bit.
… 2X builtin (microsoft#733) * Fix microsoft#719: Scraper produces incorrect output for the Anaconda 2X builtin * Add Anaconda 3.7 to the tests interpreters
Testing the beta channel of the language server I ran into an issue starting the server. So far I've seen it happen with multiple projects a couple of seconds after a windows reload.
VSCode Info
Version: 1.32.0
Commit: 507312a3e3b34b084b467dfd983263bc7c9d87e0
Date: 2019-03-06T18:53:01.021Z
Electron: 3.1.3
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Linux x64 4.18.0-16-generic
Python 2.7.15
Virtualenv
The text was updated successfully, but these errors were encountered: