Skip to content

Completion server locks in-place built pyd files #2458

Closed

Description

Environment data

  • VS Code version: 1.26.1
  • Extension version (available under the Extensions sidebar): 2018.7.1
  • OS and version: Windows 10.0.17134.228 x64
  • Python version (& distribution if applicable, e.g. Anaconda): CPython 3.7.0 x64
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A or virtualenv

Actual behavior

The completion server seems to lock pyd files that are built in-place making it impossible to rebuild them without reloading VS Code, since there doesn't seem to be a way to restart it otherwise.

C:\hello_mod>python setup.py build_ext --inplace
running build_ext
copying build\lib.win-amd64-3.7\_hello.cp37-win_amd64.pyd ->
error: could not delete '_hello.cp37-win_amd64.pyd': Access is denied

Expected behavior

It shouldn't lock them like that. It makes it a pain to develop extension modules in VS Code on Windows. At least a command to restart the completion server without reloading the entirety of VS Code can help a bit.

Steps to reproduce:

  1. Download: hello_mod.zip
  2. Build it in-place: python setup.py build_ext --inplace.
  3. Play around with hello.py in VS Code.
  4. Try to rebuild it in-place.

Eventually you are likely to hit an "Access is denied". Reloading VS Code will allow to build the module again.

Logs

Nothing relevant under default log level.

Activity

  1. added
    bugIssue identified by VS Code Team member as probable bug
    area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.
    info-neededIssue requires more information from poster
    on Aug 29, 2018
  2. d3r3kk commented on Aug 29, 2018

    @d3r3kk

    Is this while running the new Python Language Server, or while using Jedi?
    What is the current setting for python.jediEnabled when you experience this?

  3. segevfiner commented on Aug 29, 2018

    @segevfiner
    Author

    Is this while running the new Python Language Server, or while using Jedi?
    What is the current setting for python.jediEnabled when you experience this?

    I didn't change it. It's set to the default for this version: "python.jediEnabled": true.

  4. brettcannon commented on Aug 29, 2018

    @brettcannon
    Member

    Segev Finer (@segevfiner) please try setting it to "false" and let us know if the problem persists.

  5. segevfiner commented on Aug 30, 2018

    @segevfiner
    Author

    Segev Finer (@segevfiner) please try setting it to "false" and let us know if the problem persists.

    The problem doesn't persist as the Microsoft Python Language Server doesn't even try to generate completions for the extension module, instead punting with the message:

    Unable to resolve '_hello'. IntelliSense may be missing for this module.
    

    Which is quite annoying since it's a noise warning that is mixed with real warnings from the linter. Does it even support any form of completion for extension modules? (Without any external type info in the style of typeshed).

    Even if this doesn't happen with this alternative completion engine, I still think this should be fixed in one way or another with Jedi which is still the default ATM.

  6. brettcannon commented on Aug 30, 2018

    @brettcannon
    Member

    Yes, extension modules should work so please open an issue about your failure.

    And Jedi will not being staying the default. Plus Jedi holding on to the file will probably turn out to be an upstream problem anyway which would mean a short-term fix may not even be possible.

  7. brettcannon commented on Jul 29, 2019

    @brettcannon
    Member

    Closing as this is an upstream issue which we don't have direct control or influence over.

  8. locked as resolved and limited conversation to collaborators on Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bugwindows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions