Skip to content

'Symbols' object has no attribute 'namedexpr_test' #980

@CuriousLearner

Description

@CuriousLearner

Error: 'Symbols' object has no attribute 'namedexpr_test'

Operating system: OSX
Python version: 3.7
Black version: master
Does also happen on master:

To answer the last question, you have two options:

  1. Use the online formatter at https://black.now.sh/?version=master, which will use the latest master branch.
  2. Or run black on your machine:
    • create a new virtualenv (make sure it's the same Python version);
    • clone this repository;
    • run pip install -e .;
    • make sure it's sane by running python setup.py test; and
    • run black like you did last time.

I've run this using pre-commit hooks which gives the following error:

black....................................................................Failed
hookid: black

error: cannot format /Users/sanyamkhurana/work/mymp/mymp/maps/serializers.py: 'Symbols' object has no attribute 'namedexpr_test'
error: cannot format /Users/sanyamkhurana/work/mymp/mymp/maps/models.py: 'Symbols' object has no attribute 'namedexpr_test'
error: cannot format /Users/sanyamkhurana/work/mymp/mymp/maps/services.py: 'Symbols' object has no attribute 'namedexpr_test'
Oh no! 💥 💔 💥
1 file left unchanged, 3 files failed to reformat.

Note that if I install black using pip and try to reformat, these files are reformatted properly without any errors. The version I got from pip install is 19.3b0 which is working fine, but the master is breaking.

Here is my pre-commit-config.yaml

repos:
- repo: https://github.com/ambv/black
  rev: master
  hooks:
    - id: black
      language_version: python3.7

I've trimmed it for brevity. Please note that this was working fine 5 days earlier.

Please let me know if you need any more details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions