Closed Bug 1746120 Opened 3 years ago Closed 3 years ago

NoneType object is not subscriptable when linting

Categories

(Developer Infrastructure :: Lint and Formatting, defect)

defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: anatal, Unassigned)

References

Details

macbookpro:gecko anatal$ rm -rf ../obj-x86_64-apple-darwin20.
obj-x86_64-apple-darwin20.4.0/ obj-x86_64-apple-darwin20.6.0/
macbookpro:gecko anatal$ rm -rf ../obj-x86_64-apple-darwin20.*
macbookpro:gecko anatal$ ./mach lint --fix -l flake8 js/src/intgemm/detect_avx2.py
The "mach" virtualenv is not up-to-date, please run "./mach create-mach-environment"
macbookpro:gecko anatal$ ./mach create-mach-environment
created virtual environment CPython3.9.8.final.0-64 in 118ms
  creator CPython3Posix(dest=/Users/anatal/.mozbuild/_virtualenvs/mach, clear=False, no_vcs_ignore=False, global=False)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator
Collecting glean-sdk==40.0.0
  Using cached glean_sdk-40.0.0-cp36-abi3-macosx_10_7_x86_64.whl (873 kB)
Collecting glean-parser==3.6.0
  Using cached glean_parser-3.6.0-py3-none-any.whl (80 kB)
Collecting cffi>=1.13.0
  Using cached cffi-1.15.0-cp39-cp39-macosx_10_9_x86_64.whl (178 kB)
Requirement already satisfied: diskcache>=4 in ./third_party/python/diskcache (from glean-parser==3.6.0->glean-sdk==40.0.0) (4.1.0)
Requirement already satisfied: Jinja2>=2.10.1 in ./third_party/python/Jinja2 (from glean-parser==3.6.0->glean-sdk==40.0.0) (2.11.3)
Requirement already satisfied: yamllint>=1.18.0 in ./third_party/python/yamllint (from glean-parser==3.6.0->glean-sdk==40.0.0) (1.23.0)
Requirement already satisfied: Click>=7 in ./third_party/python/Click (from glean-parser==3.6.0->glean-sdk==40.0.0) (7.0)
Requirement already satisfied: PyYAML>=5.3.1 in ./third_party/python/PyYAML/lib3 (from glean-parser==3.6.0->glean-sdk==40.0.0) (5.4.1)
Requirement already satisfied: jsonschema<4,>=3.0.2 in ./third_party/python/jsonschema (from glean-parser==3.6.0->glean-sdk==40.0.0) (3.2.0)
Requirement already satisfied: appdirs>=1.4 in ./third_party/python/appdirs (from glean-parser==3.6.0->glean-sdk==40.0.0) (1.4.4)
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Requirement already satisfied: MarkupSafe>=0.23 in ./third_party/python/MarkupSafe/src (from Jinja2>=2.10.1->glean-parser==3.6.0->glean-sdk==40.0.0) (1.1.1)
Requirement already satisfied: six>=1.11.0 in ./third_party/python/six (from jsonschema<4,>=3.0.2->glean-parser==3.6.0->glean-sdk==40.0.0) (1.13.0)
Requirement already satisfied: pyrsistent>=0.14.0 in ./third_party/python/pyrsistent (from jsonschema<4,>=3.0.2->glean-parser==3.6.0->glean-sdk==40.0.0) (0.16.0)
Requirement already satisfied: attrs>=17.4.0 in ./third_party/python/attrs (from jsonschema<4,>=3.0.2->glean-parser==3.6.0->glean-sdk==40.0.0) (19.1.0)
Requirement already satisfied: setuptools in ./third_party/python/setuptools (from jsonschema<4,>=3.0.2->glean-parser==3.6.0->glean-sdk==40.0.0) (51.2.0)
Requirement already satisfied: pathspec>=0.5.3 in ./third_party/python/pathspec (from yamllint>=1.18.0->glean-parser==3.6.0->glean-sdk==40.0.0) (0.8.0)
Installing collected packages: pycparser, glean-parser, cffi, glean-sdk
Successfully installed cffi-1.15.0 glean-parser-3.6.0 glean-sdk-40.0.0 pycparser-2.21
Collecting psutil<=5.8.0,>=5.4.2
  Using cached psutil-5.8.0-cp39-cp39-macosx_10_9_x86_64.whl (236 kB)
Installing collected packages: psutil
Successfully installed psutil-5.8.0
Collecting zstandard<=0.16.0,>=0.11.1
  Using cached zstandard-0.16.0-cp39-cp39-macosx_10_9_x86_64.whl (621 kB)
Installing collected packages: zstandard
Successfully installed zstandard-0.16.0
Mach environment created.
macbookpro:gecko anatal$ ./mach lint --fix -l flake8 js/src/intgemm/detect_avx2.py
created virtual environment CPython3.9.8.final.0-64 in 89ms
  creator CPython3Posix(dest=/Users/anatal/projects/mozilla/obj-x86_64-apple-darwin20.6.0/_virtualenvs/common, clear=False, no_vcs_ignore=False, global=False)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator
✖ 0 problems (0 errors, 0 warnings, 0 fixed)
macbookpro:gecko anatal$ ./mach lint --fix -l black js/src/intgemm/detect_avx2.py
Traceback (most recent call last):
  File "/Users/anatal/projects/mozilla/gecko/python/mozlint/mozlint/roller.py", line 66, in _run_worker
    res = func(paths, config, **lintargs)
  File "/Users/anatal/projects/mozilla/gecko/python/mozlint/mozlint/types.py", line 57, in __call__
    return self._lint(paths, config, **lintargs)
  File "/Users/anatal/projects/mozilla/gecko/python/mozlint/mozlint/types.py", line 148, in _lint
    return func(files, config, **lintargs)
  File "/Users/anatal/projects/mozilla/gecko/tools/lint/python/black.py", line 168, in lint
    return run_black(
  File "/Users/anatal/projects/mozilla/gecko/tools/lint/python/black.py", line 147, in run_black
    log.debug("Black version {}".format(get_black_version(binary)))
  File "/Users/anatal/projects/mozilla/gecko/tools/lint/python/black.py", line 55, in get_black_version
    return re.match(r"black.*, version (.*)$", output)[1]
TypeError: 'NoneType' object is not subscriptable
A failure occurred in the black linter.
✖ 1 problem (0 errors, 0 warnings, 1 failure, 0 fixed)
Flags: needinfo?(mhentges)

Hmm, weird.
Which revision are you on? Can you reproduce this on current central?

Flags: needinfo?(mhentges) → needinfo?(anatal)

bookmarks/central on hg::https://hg.mozilla.org/mozilla-unified

Flags: needinfo?(anatal)

The "mach" virtualenv is not up-to-date, please run "./mach create-mach-environment"

This behaviour was gone as of fc578092665f, which landed in late November.
Perhaps you need to update your local checkout?

Flags: needinfo?(anatal)

Yes, I can't reproduce this anymore. Thanks!

Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(anatal)
Resolution: --- → FIXED

Generally we use works for me as a resolution when something is fixed but we don't know what it was, or we use duplicate when we do know what fixed it.

Resolution: FIXED → DUPLICATE

This is related to 1717051, but not quite a dupe.

Resolution: DUPLICATE → WORKSFORME
Depends on: 1717051
Type: task → defect
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.