Skip to content

'Invalid patch string:' #18455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jslomkowski opened this issue Feb 6, 2022 · 3 comments · Fixed by #18481
Closed

'Invalid patch string:' #18455

jslomkowski opened this issue Feb 6, 2022 · 3 comments · Fixed by #18481
Assignees
Labels
area-editor-* User-facing catch-all bug Issue identified by VS Code Team member as probable bug

Comments

@jslomkowski
Copy link

jslomkowski commented Feb 6, 2022

Issue Type: Bug

Behaviour

Expected vs. Actual

In the latest version as of 06.02.2022 which is V2022.0.1786462952 when I right-click on workspace and select 'sort imports', I get a popup in the lower right saying 'Invalid patch string:' and imports don't sort. This doesn't happen when I downgrade to the previous version. I use autopep8 but this behaviour happens regardless of formatter. I have also disabled all other extensions.

Version: 1.64.0 (user setup)
Commit: 5554b12acf27056905806867f251c859323ff7e9
Date: 2022-02-03T04:22:20.678Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19044

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.9.9
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
  • Value of the python.languageServer setting: Pylance
User Settings


defaultLS: {
    "defaultLSType": "Pylance"
}

downloadLanguageServer: true

envFile: "<placeholder>"

venvPath: "<placeholder>"

venvFolders: "<placeholder>"

condaPath: "<placeholder>"

pipenvPath: "<placeholder>"

poetryPath: "<placeholder>"

languageServer: "Pylance"

linting
• enabled: true
• cwd: "<placeholder>"
• Flake8Args: "<placeholder>"
• flake8Enabled: true
• flake8Path: "<placeholder>"
• lintOnSave: true
• banditArgs: "<placeholder>"
• banditEnabled: false
• banditPath: "<placeholder>"
• mypyArgs: "<placeholder>"
• mypyEnabled: false
• mypyPath: "<placeholder>"
• pycodestyleArgs: "<placeholder>"
• pycodestyleEnabled: false
• pycodestylePath: "<placeholder>"
• prospectorArgs: "<placeholder>"
• prospectorEnabled: false
• prospectorPath: "<placeholder>"
• pydocstyleArgs: "<placeholder>"
• pydocstyleEnabled: false
• pydocstylePath: "<placeholder>"
• pylamaArgs: "<placeholder>"
• pylamaEnabled: false
• pylamaPath: "<placeholder>"
• pylintArgs: "<placeholder>"
• pylintPath: "<placeholder>"

sortImports
• args: "<placeholder>"
• path: "<placeholder>"

formatting
• autopep8Args: "<placeholder>"
• autopep8Path: "<placeholder>"
• provider: "autopep8"
• blackArgs: "<placeholder>"
• blackPath: "<placeholder>"
• yapfArgs: "<placeholder>"
• yapfPath: "<placeholder>"

testing
• cwd: "<placeholder>"
• debugPort: 3000
• nosetestArgs: "<placeholder>"
• nosetestsEnabled: undefined
• nosetestPath: "<placeholder>"
• promptToConfigure: true
• pytestArgs: "<placeholder>"
• pytestEnabled: false
• pytestPath: "<placeholder>"
• unittestArgs: "<placeholder>"
• unittestEnabled: false
• autoTestDiscoverOnSaveEnabled: true

terminal
• activateEnvironment: true
• executeInFileDir: "<placeholder>"
• launchArgs: "<placeholder>"

experiments
• enabled: true
• optInto: []
• optOutFrom: []

insidersChannel: "off"

tensorBoard
• logDirectory: "<placeholder>"

Extension version: 2022.0.1786462952
VS Code version: Code 1.64.0 (5554b12acf27056905806867f251c859323ff7e9, 2022-02-03T04:22:20.678Z)
OS version: Windows_NT x64 10.0.19044
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i5-8600K CPU @ 3.60GHz (6 x 3600)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.95GB (9.34GB free)
Process Argv --crash-reporter-id 5ff370a8-8791-4c5c-82cc-4dd4149db46a
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392cf:30425750
pythontb:30283811
pythonptprofiler:30281270
vsdfh931:30280409
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
vsc1dsc:30433058
pythonvs932:30410667
wslgetstarted:30433507
vs360cf:30404996
vsrem710cf:30416617

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Feb 6, 2022
@ppeetteerrs
Copy link

ppeetteerrs commented Feb 6, 2022

I was wondering why no one raised this issue earlier and whether it is just me. Good to know that I'm not alone! Anyway, for now the solution is just to add the following to your .vscode/settings.json for every workspace:

{
	"python.sortImports.path": <wherever your `which isort` points to>
}

Hope it gets fixed soon though

@karthiknadig
Copy link
Member

@jslomkowski this is due to conda/conda#10972. With the latest release we switched to using conda run, which is why you see this with the current release and not the previous one.

You can always use the isort path to work around this problem.

@karthiknadig karthiknadig self-assigned this Feb 7, 2022
@karthiknadig karthiknadig added triage area-editor-* User-facing catch-all bug Issue identified by VS Code Team member as probable bug and removed triage-needed Needs assignment to the proper sub-team labels Feb 7, 2022
@jahan01
Copy link

jahan01 commented Feb 8, 2022

conda run implementation has broken so many things this release. even things that do work with conda run like black formatting, it is pathetic and slow on mac. I had enable sort import and formatting on save. So i had now hard coded the paths of black and isort in workspace settings, thankfully now latency is in acceptable limits.

kimadeline added a commit that referenced this issue Mar 1, 2022
* Fixed namespace and type errors

* Fetch Jupyter Notebook Interpreters if there are multiple available and fetches the path of the interpreter.

* Complying types to reduce errors

* Ran prettier

* News

* Used prettier on service.ts

* Requirements.txt for Python Action Checking

* Removed pr file check

* News

* News

* Updated cffi version

* Ran prettier --check 'src/client/**/*.ts' 'build/**/*.js' for Formatting Multiple Files

* Fixed client factory error and installed react to fix eslint errors.

* Ran global prettier

* Removed unused imports causing errors

* Updated ciffi

* Mass prettier linting

* Removed check python formatting - it was causing errors

* Linting back

* Removed .eslintignore to fix eslint errors - can be generated again

* Added eslint back

* Reverted back to original changes before my commits.

* Updated news

* Error message if you try to run code with no active text editor opened.

* News

* Used IApplicationShell

* Removed unnecessary import

* Used vscode.window to stop errors.

* Testing

* Return error

* Used IApplicationShell for pop up windows. Fixed spelling mistake

* Revered back to vscode while fixing error

* Use IApplicationShell for Error Messages

* Fixed promise types

* Return Error

* Created new constant for message

* Return a message value

* Return the error window

* Using active editor to remove errors while resolving errors.

* Use appshell for errors

* Use an Interface for running the error messages

* Changed types

* Imported window from vscode

* Use IAppShell to display message for testing

* Fixed old python that fail to lint

* Used linting of interpreterInfo to remove error

* Full Stop

* Formatted python Files

* Linted Files

* Linting

* Revert

* Revert

* Python Files reformatted

* Used an Interface in a type file

* Use IAppShell for testing

* Gitignore gitpod for gitpod users

* Reverted

* Incorporate Testing

* Updated prospector

* Test

* Revert

* Revert

* Localised Testing

* Upgrade vsce

* Revert package and package-lock.json

* Remove window import

* Create a window variable

* Remove any types

* Import window from vscode

* Remove unused imports

* Return Types

* Fixed testing

* Await a call - not the function

* Attempt to fix #18455

* New line at the end of the package-lock.json

* New line for package.json

* Window message to check if Isort has been Downloaded

* Window message

* Scrapped idea of a window pop up

* Revert

* Revert

* If no text pointer is found

* Changed type

* Revert

* Testing

* Ran prettier

* Revert

* Revert

* Remove --live-stream from conda run

* Update news

* Remove unused commands

* Add an Extract Method Command #18518

* Fixed linting

* Reverting

* Revert --live-stream to just fix one issue

* Support multiple line input and indented text

* Updated the package-lock.json by updating dependencies..

* Use let instead of var

* Updated test.ts to pass checks -> fix  ```Import may be converted to a default import``` error

* Revert package and package-lock.json

* Fix lint errors

* Revert

* Select the correct python path if  no workspace path is available #18482

* Remove old news

* More testing and return an empty string if no python path is available..

* New tests

* Removed unused dependencies as stated in #16840

* Revert

* Removed unused dependencies with depcheck

* Brung back the loaders in order to load tests and webpack

* Installed more for tests

* Installed webpack-cli

* Uninstalled webpack so only webpack-cli is installed

* Update package-lock.json

* Removed more dependecies

* Install rxjs-compat

* Revert

* Cleanup

* Installed webpack

* Revert

* Revert

* Removed gulp-rename, sourcemaps, gunzip, chmod and unicode

* Reinstated gulp

* Brang back unicode

* Update package-lock.json

* Remove the vscode-debugadapter and the vscode-debugadapter-testsupport

* Removed vscode telemetries.

* Revert before Merge

* Revert

* Merge

* Made changes as requested

* Updated ts-check

* Revert Select the Correct Python Path if no workspace path is available.

* Revert

* Update workspaceFolderUri type after reverting PR

* Revert vscode packages in use

* Merged Changes and Added Back untildify

* Revert

* Revert to PR

* Update package-lock.json

* Added unicode

* Added unicode

* Revert

* Removed the Unused Dependecies, Typescript Char and Typescript Formatter from the Package and Package-lock.json

* Update news

* Update news entry

Co-authored-by: Kim-Adeline Miguel <kimiguel@microsoft.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 11, 2022
wesm pushed a commit to posit-dev/positron that referenced this issue Mar 28, 2024
* Fixed namespace and type errors

* Fetch Jupyter Notebook Interpreters if there are multiple available and fetches the path of the interpreter.

* Complying types to reduce errors

* Ran prettier

* News

* Used prettier on service.ts

* Requirements.txt for Python Action Checking

* Removed pr file check

* News

* News

* Updated cffi version

* Ran prettier --check 'src/client/**/*.ts' 'build/**/*.js' for Formatting Multiple Files

* Fixed client factory error and installed react to fix eslint errors.

* Ran global prettier

* Removed unused imports causing errors

* Updated ciffi

* Mass prettier linting

* Removed check python formatting - it was causing errors

* Linting back

* Removed .eslintignore to fix eslint errors - can be generated again

* Added eslint back

* Reverted back to original changes before my commits.

* Updated news

* Error message if you try to run code with no active text editor opened.

* News

* Used IApplicationShell

* Removed unnecessary import

* Used vscode.window to stop errors.

* Testing

* Return error

* Used IApplicationShell for pop up windows. Fixed spelling mistake

* Revered back to vscode while fixing error

* Use IApplicationShell for Error Messages

* Fixed promise types

* Return Error

* Created new constant for message

* Return a message value

* Return the error window

* Using active editor to remove errors while resolving errors.

* Use appshell for errors

* Use an Interface for running the error messages

* Changed types

* Imported window from vscode

* Use IAppShell to display message for testing

* Fixed old python that fail to lint

* Used linting of interpreterInfo to remove error

* Full Stop

* Formatted python Files

* Linted Files

* Linting

* Revert

* Revert

* Python Files reformatted

* Used an Interface in a type file

* Use IAppShell for testing

* Gitignore gitpod for gitpod users

* Reverted

* Incorporate Testing

* Updated prospector

* Test

* Revert

* Revert

* Localised Testing

* Upgrade vsce

* Revert package and package-lock.json

* Remove window import

* Create a window variable

* Remove any types

* Import window from vscode

* Remove unused imports

* Return Types

* Fixed testing

* Await a call - not the function

* Attempt to fix microsoft/vscode-python#18455

* New line at the end of the package-lock.json

* New line for package.json

* Window message to check if Isort has been Downloaded

* Window message

* Scrapped idea of a window pop up

* Revert

* Revert

* If no text pointer is found

* Changed type

* Revert

* Testing

* Ran prettier

* Revert

* Revert

* Remove --live-stream from conda run

* Update news

* Remove unused commands

* Add an Extract Method Command microsoft/vscode-python#18518

* Fixed linting

* Reverting

* Revert --live-stream to just fix one issue

* Support multiple line input and indented text

* Updated the package-lock.json by updating dependencies..

* Use let instead of var

* Updated test.ts to pass checks -> fix  ```Import may be converted to a default import``` error

* Revert package and package-lock.json

* Fix lint errors

* Revert

* Select the correct python path if  no workspace path is available microsoft/vscode-python#18482

* Remove old news

* More testing and return an empty string if no python path is available..

* New tests

* Removed unused dependencies as stated in microsoft/vscode-python#16840

* Revert

* Removed unused dependencies with depcheck

* Brung back the loaders in order to load tests and webpack

* Installed more for tests

* Installed webpack-cli

* Uninstalled webpack so only webpack-cli is installed

* Update package-lock.json

* Removed more dependecies

* Install rxjs-compat

* Revert

* Cleanup

* Installed webpack

* Revert

* Revert

* Removed gulp-rename, sourcemaps, gunzip, chmod and unicode

* Reinstated gulp

* Brang back unicode

* Update package-lock.json

* Remove the vscode-debugadapter and the vscode-debugadapter-testsupport

* Removed vscode telemetries.

* Revert before Merge

* Revert

* Merge

* Made changes as requested

* Updated ts-check

* Revert Select the Correct Python Path if no workspace path is available.

* Revert

* Update workspaceFolderUri type after reverting PR

* Revert vscode packages in use

* Merged Changes and Added Back untildify

* Revert

* Revert to PR

* Update package-lock.json

* Added unicode

* Added unicode

* Revert

* Removed the Unused Dependecies, Typescript Char and Typescript Formatter from the Package and Package-lock.json

* Update news

* Update news entry

Co-authored-by: Kim-Adeline Miguel <kimiguel@microsoft.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-editor-* User-facing catch-all bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants