Skip to content
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

Error: Invalid patch string when linting file #2814

Closed
albireox opened this issue Oct 8, 2018 · 4 comments
Closed

Error: Invalid patch string when linting file #2814

albireox opened this issue Oct 8, 2018 · 4 comments
Labels
area-formatting bug Issue identified by VS Code Team member as probable bug

Comments

@albireox
Copy link

albireox commented Oct 8, 2018

init.py.zip

Environment data

  • VS Code version: 1.28.0-insiders
  • Extension version (available under the Extensions sidebar): 2018.9.0
  • OS and version: macOS 10.14
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.0 (pyenv)
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: N/A

Actual behavior

When I try to save the attached file I get the following error:

##########Linting Output - flake8##########
Error: Invalid patch string: Skipped 1 files

Expected behavior

No error and correct linting.

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

##########Linting Output - flake8##########
Error: Invalid patch string: Skipped 1 files

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

[ms-python.python]Invalid patch string: Skipped 1 files
e.$onExtensionRuntimeError @ mainThreadExtensionService.ts:43
t._doInvokeHandler @ rpcProtocol.ts:442
t._invokeHandler @ rpcProtocol.ts:427
t._receiveRequest @ rpcProtocol.ts:344
t._receiveOneMessage @ rpcProtocol.ts:274
(anonymous) @ rpcProtocol.ts:149
e.fire @ event.ts:140
a @ ipc.net.ts:105
n._socketDataListener @ ipc.net.ts:134
emitOne @ events.js:116
emit @ events.js:211
addChunk @ _stream_readable.js:263
readableAddChunk @ _stream_readable.js:250
Readable.push @ _stream_readable.js:208
onread @ net.js:594
mainThreadExtensionService.ts:44 

Error: Invalid patch string: Skipped 1 files
	at diff_match_patch.patch_fromText (/Users/albireo/.vscode-insiders/extensions/ms-python.python-2018.9.0/out/client/common/editor.js:240:19)
	at EditorUtils.getWorkspaceEditsFromPatch (/Users/albireo/.vscode-insiders/extensions/ms-python.python-2018.9.0/out/client/common/editor.js:327:40)
	at SortImportsEditingProvider.<anonymous> (/Users/albireo/.vscode-insiders/extensions/ms-python.python-2018.9.0/out/client/providers/importSortProvider.js:80:41)
	at Generator.next (<anonymous>)
	at fulfilled (/Users/albireo/.vscode-insiders/extensions/ms-python.python-2018.9.0/out/client/providers/importSortProvider.js:13:58)
	at <anonymous>
@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug needs PR area-formatting labels Oct 9, 2018
@DonJayamanne
Copy link

I can replicate this.

@noonedeadpunk
Copy link

Case for me as well.

@damienflament
Copy link

I got the same issue while sorting imports.

It seems to happen only for __init__.py files.
Renaming the file (e.g. to foo.py) fix the issue and make me able to sort the imports.

@luabud luabud mentioned this issue Jul 16, 2019
@luabud luabud assigned luabud and kimadeline and unassigned luabud Sep 11, 2019
@kimadeline
Copy link

Closing, doesn't happen anymore with the file provided in the original comment.

@ghost ghost removed the needs PR label Sep 12, 2019
@kimadeline kimadeline removed their assignment Sep 12, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-formatting bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

6 participants