Black: Vim plugin needs updates for black 19.3b0

Created on 14 Mar 2019  路  2Comments  路  Source: psf/black

With black 19.3b0, I now see a AttributeError: type object 'FileMode' has no attribute 'AUTO_DETECT' when I call :Black in vim. I think black.vim needs some updates to work with the new API.

It may also be a good idea while we're looking at this to spec out a minimal stable API between vim and the black module, since there's really no guarantee that black.py and black.vim are on the same version.

Operating system: Linux
Python version: 3.7.1
Black version: 19.3b0
Does also happen on master: Yes (well, haven't tried, but just based on black.vim code vs black.py)

Most helpful comment

For those looking for a workaround for now:

If you need to do anything special to make your virtualenv work and install Black (for example you want to run a version from master), create a virtualenv manually and point g:black_virtualenv to it. The plugin will use it.

Just install black==18.9b0 for now.

All 2 comments

For those looking for a workaround for now:

If you need to do anything special to make your virtualenv work and install Black (for example you want to run a version from master), create a virtualenv manually and point g:black_virtualenv to it. The plugin will use it.

Just install black==18.9b0 for now.

Thanks to @tlv and @JelleZijlstra, this was fixed in https://github.com/ambv/black/pull/766. This issue can now be closed!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Lukas0907 picture Lukas0907  路  66Comments

adamehirsch picture adamehirsch  路  48Comments

spapanik picture spapanik  路  23Comments

rouge8 picture rouge8  路  20Comments

underyx picture underyx  路  22Comments