question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting sortImports.args produces Invalid patch string

See original GitHub issue

Issue Type: Bug

I recently set the following option to improve the compatibility of isort with black:

"python.sortImports.args": [
    "--profile", "black"
]

However, the following error occurs when activating it:

Invalid patch string: >>>PYTHON-EXEC-OUTPUT

This does not happen if this option is not set. Maybe there is a problem with escaping the parameters?

Extension version: 2022.4.0 VS Code version: Code 1.66.0 (e18005f0f1b33c29e81d732535d8c0e47cafb0b5, 2022-03-30T05:50:04.419Z) OS version: Darwin x64 19.6.0 Restricted Mode: No

System Info
Item Value
CPUs Intel® Core™ i7-5557U CPU @ 3.10GHz (4 x 3100)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 5, 7, 8
Memory (System) 16.00GB (0.34GB free)
Process Argv
Screen Reader no
VM 0%

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
karthiknadigcommented, May 10, 2022

For anyone running into this issue, please try https://marketplace.visualstudio.com/items?itemName=ms-python.isort . It might handle these cases better, and we plan on eventually switching to that extension.

2reactions
karrtikrcommented, Nov 9, 2022

We’ve a new isort extension which solves this: https://marketplace.visualstudio.com/items?itemName=ms-python.isort

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to configure line length for VS Code python Sort Imports ...
From the documentation, it seems like "python.sortImports.args": ["-l", "100"] should work, but it's giving me an error: Invalid patch string ...
Read more >
Settings Reference for Python - Visual Studio Code
Settings Reference for the Python extension in Visual Studio Code. ... Diagnostics for invalid escape sequences used within string literals.
Read more >
Pylint features - Pylint 2.16.0-dev documentation
TypeVar cannot be both covariant and contravariant Emitted when both the "covariant" and "contravariant" keyword arguments are set to "True" in a TypeVar....
Read more >
Changelog — documentación de Python - 3.6.15
bpo-35643: Fixed a SyntaxWarning: invalid escape sequence in Modules/_sha3/cleanup.py. Patch by Mickaël Schoentgen. bpo-35121: Don't set cookie for a request ...
Read more >
Configuration options for isort
Tells isort to set the known standard library based on the specified ... Python & Config File Name: py_version ... Sort imports by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found