Skip to content

The formatter fails in this file #1226

Open
@jefer94

Description

@jefer94

Details

Error

Traceback (most recent call last):
  File "/home/runner/.cache/pre-commit/repoai0oqknz/py_env-python3.12/lib/python3.12/site-packages/yapf/yapflib/yapf_api.py", line 198, in FormatCode
    tree = pytree_utils.ParseCodeToTree(unformatted_source)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.cache/pre-commit/repoai0oqknz/py_env-python3.12/lib/python3.12/site-packages/yapf/pytree/pytree_utils.py", line 113, in ParseCodeToTree
    tree = parser_driver.parse_string(code, debug=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.cache/pre-commit/repoai0oqknz/py_env-python3.12/lib/python3.12/site-packages/yapf_third_party/_ylib2to3/pgen2/driver.py", line 188, in parse_string
    return self.parse_tokens(tokens, debug)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.cache/pre-commit/repoai0oqknz/py_env-python3.12/lib/python3.12/site-packages/yapf_third_party/_ylib2to3/pgen2/driver.py", line 157, in parse_tokens
    if p.addtoken(type, value, (prefix, start)):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.cache/pre-commit/repoai0oqknz/py_env-python3.12/lib/python3.12/site-packages/yapf_third_party/_ylib2to3/pgen2/parse.py", line 230, in addtoken
    return self._addtoken(ilabel, type, value, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.cache/pre-commit/repoai0oqknz/py_env-python3.12/lib/python3.12/site-packages/yapf_third_party/_ylib2to3/pgen2/parse.py", line 313, in _addtoken
    raise ParseError('bad input', type, value, context)
yapf_third_party._ylib2to3.pgen2.parse.ParseError: bad input: type=1, value='_', context=('', (221, 60))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/.cache/pre-commit/repoai0oqknz/py_env-python3.12/lib/python3.12/site-packages/yapf/__init__.py", line 241, in _FormatFile
    reformatted_code, encoding, has_change = yapf_api.FormatFile(
                                             ^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.cache/pre-commit/repoai0oqknz/py_env-python3.12/lib/python3.12/site-packages/yapf/yapflib/yapf_api.py", line 88, in FormatFile
    reformatted_source, changed = FormatCode(
                                  ^^^^^^^^^^^
  File "/home/runner/.cache/pre-commit/repoai0oqknz/py_env-python3.12/lib/python3.12/site-packages/yapf/yapflib/yapf_api.py", line 201, in FormatCode
    raise errors.YapfError(errors.FormatErrorMsg(e))
                           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.cache/pre-commit/repoai0oqknz/py_env-python3.12/lib/python3.12/site-packages/yapf/yapflib/errors.py", line 37, in FormatErrorMsg
    return '{}:{}:{}: {}'.format(e.args[1][0], e.args[1][1], e.args[1][2], e.msg)
                                 ~~~~~~^^^
IndexError: tuple index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/.cache/pre-commit/repoai0oqknz/py_env-python3.12/bin/yapf", line 8, in <module>
    sys.exit(run_main())
             ^^^^^^^^^^
  File "/home/runner/.cache/pre-commit/repoai0oqknz/py_env-python3.12/lib/python3.12/site-packages/yapf/__init__.py", line 380, in run_main
    sys.exit(main(sys.argv))
             ^^^^^^^^^^^^^^
  File "/home/runner/.cache/pre-commit/repoai0oqknz/py_env-python3.12/lib/python3.12/site-packages/yapf/__init__.py", line 139, in main
    changed = FormatFiles(
              ^^^^^^^^^^^^
  File "/home/runner/.cache/pre-commit/repoai0oqknz/py_env-python3.12/lib/python3.12/site-packages/yapf/__init__.py", line 217, in FormatFiles
    changed |= _FormatFile(filename, lines, style_config, no_local_style,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.cache/pre-commit/repoai0oqknz/py_env-python3.12/lib/python3.12/site-packages/yapf/__init__.py", line 251, in _FormatFile
    raise errors.YapfError(errors.FormatErrorMsg(e))
                           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.cache/pre-commit/repoai0oqknz/py_env-python3.12/lib/python3.12/site-packages/yapf/yapflib/errors.py", line 37, in FormatErrorMsg
    return '{}:{}:{}: {}'.format(e.args[1][0], e.args[1][1], e.args[1][2], e.msg)
                                 ~~~~~~^^^
IndexError: tuple index out of range

Deps

activecampaign-python==1.0.10
adrf==0.1.6
aiodns==3.2.0
aiohttp==3.9.5
aiohttp-retry==2.8.3
aiosignal==1.3.1
amqp==5.2.0
aniso8601==9.0.1
annotated-types==0.6.0
anyio==4.3.0
asgiref==3.8.1
async-property==0.2.2
async-timeout==4.0.3
attrs==23.2.0
autobahn==23.6.2
Automat==22.10.0
Babel==2.14.0
beautifulsoup4==4.12.3
billiard==4.2.0
bleach==6.1.0
Brotli==1.1.0
cachetools==5.3.3
celery==5.4.0
celery-task-manager==1.4.0
certifi==2024.2.2
cffi==1.16.0
cfgv==3.4.0
channels==4.1.0
channels-redis==4.2.0
charset-normalizer==3.3.2
circuitbreaker==2.0.0
click==8.1.7
click-didyoumean==0.3.1
click-plugins==1.1.1
click-repl==0.3.0
colorama==0.4.6
constantly==23.10.4
contextlib2==21.6.0
coralogix-logger==2.0.6
coverage==7.4.4
coveralls==4.0.0
cryptography==42.0.5
cssselect==1.2.0
cssutils==2.10.2
currencies==2020.12.12
daphne==4.1.2
defusedxml==0.7.1
Deprecated==1.2.14
distlib==0.3.8
distro==1.9.0
dj-database-url==2.1.0
Django==5.0.4
django-cors-headers==4.3.1
django-heroku==0.3.1
django-minify-html==1.7.1
django-phonenumber-field==7.3.0
django-redis==5.4.0
django-sql-explorer==4.0.2
django-storages==1.14.2
djangorestframework==3.15.1
djangorestframework-csv==3.0.2
dnspython==2.6.1
docopt==0.6.2
drf-yasg==1.21.7
eventbrite==3.3.5
eventlet==0.36.1
exceptiongroup==1.2.1
execnet==2.1.1
expiringdict==1.2.2
Faker==12.0.1
fastjsonschema==2.19.1
filelock==3.14.0
flake8==7.0.0
flake8-bugbear==24.4.26
flake8-docstrings==1.7.0
frozenlist==1.4.1
gevent==24.2.1
ghp-import==2.1.0
google-api-core==2.19.0
google-auth==2.29.0
google-cloud-bigquery==3.21.0
google-cloud-bigquery-storage==2.24.0
google-cloud-core==2.4.1
google-cloud-datastore==2.19.0
google-cloud-firestore==2.16.0
google-cloud-ndb==2.3.1
google-cloud-recaptcha-enterprise==1.20.0
google-cloud-storage==2.16.0
google-crc32c==1.5.0
google-resumable-media==2.7.0
googleapis-common-protos==1.63.0
graphene==3.3
graphene-django==3.2.1
graphene-django-optimizer==0.10.0
graphql-core==3.2.3
graphql-relay==3.2.0
greenlet==3.0.3
griffe==0.44.0
grpcio==1.63.0
grpcio-status==1.62.2
gunicorn==22.0.0
h11==0.14.0
h2==4.1.0
hiredis==2.3.2
hpack==4.0.0
httpcore==1.0.5
httpx==0.27.0
hyperframe==6.0.1
hyperlink==21.0.0
icalendar==5.0.12
identify==2.5.36
idna==3.7
importlib_metadata==7.1.0
incremental==22.10.0
inflection==0.5.1
iniconfig==2.0.0
Jinja2==3.1.3
jsonschema==4.22.0
jsonschema-specifications==2023.12.1
jupyter_client==8.6.1
jupyter_core==5.7.2
jupyterlab_pygments==0.3.0
kombu==5.3.7
launchdarkly-eventsource==1.2.0
launchdarkly-server-sdk==9.4.0
linked-services==1.2.1
lxml==5.2.1
Markdown==3.6
MarkupSafe==2.1.5
mccabe==0.7.0
mergedeep==1.3.4
minify_html==0.15.0
mistune==3.0.2
mixer==7.2.2
mkdocs==1.6.0
mkdocs-autorefs==1.0.1
mkdocs-get-deps==0.2.0
mkdocs-material==9.5.20
mkdocs-material-extensions==1.3.1
mkdocstrings==0.25.0
mkdocstrings-python==1.10.0
msgpack==1.0.8
multidict==6.0.5
nbclient==0.10.0
nbconvert==7.16.4
nbformat==5.10.4
newrelic==9.9.0
nodeenv==1.8.0
numpy==1.26.4
openai==1.25.1
packaging==24.0
paginate==0.5.6
pandas==2.2.2
pandocfilters==1.5.1
pathspec==0.12.1
pep8-naming==0.13.3
phonenumberslite==8.13.35
pillow==10.3.0
platformdirs==4.2.1
pluggy==1.5.0
pre-commit==3.7.0
premailer==3.10.0
priority==1.3.0
promise==2.3
prompt-toolkit==3.0.43
proto-plus==1.23.0
protobuf==4.25.3
psycopg==3.1.18
psycopg-binary==3.1.18
psycopg-pool==3.2.1
psycopg2==2.9.9
pyarrow==16.0.0
pyasn1==0.6.0
pyasn1_modules==0.4.0
pycares==4.4.0
pycodestyle==2.11.1
pycparser==2.22
pydantic==2.7.1
pydantic_core==2.18.2
pydocstyle==6.3.0
pyfcm==1.5.4
pyflakes==3.2.0
PyGithub==2.3.0
Pygments==2.17.2
PyJWT==2.8.0
pymdown-extensions==10.8.1
pymemcache==4.0.0
PyNaCl==1.5.0
pyOpenSSL==24.1.0
pyRFC3339==1.1
pytest==8.2.0
pytest-asyncio==0.23.6
pytest-cov==5.0.0
pytest-django==4.8.0
pytest-env==1.1.3
pytest-gevent==1.1.0
pytest-xdist==3.6.1
python-dateutil==2.9.0.post0
python-frontmatter==1.1.0
python-slugify==8.0.4
pytz==2024.1
PyYAML==6.0.1
pyyaml_env_tag==0.1
pyzmq==26.0.3
redis==5.0.4
referencing==0.35.1
regex==2024.4.28
requests==2.31.0
rpds-py==0.18.0
rsa==4.9
schema==0.7.5
semver==3.0.2
serpy==0.3.1
service-identity==24.1.0
setuptools==69.5.1
six==1.16.0
sniffio==1.3.1
snowballstemmer==2.2.0
soupsieve==2.5
SQLAlchemy==1.4.52
sqlalchemy-bigquery==1.11.0
sqlparse==0.5.0
stripe==9.4.0
text-unidecode==1.3
timeago==1.0.16
tinycss2==1.3.0
tomli==2.0.1
tornado==6.4
tqdm==4.66.2
traitlets==5.14.3
twilio==9.0.5
Twisted==24.3.0
txaio==23.1.1
typing_extensions==4.11.0
tzdata==2024.1
uritemplate==4.1.1
urllib3==2.2.1
uvicorn==0.29.0
vine==5.1.0
virtualenv==20.26.1
watchdog==4.0.0
wcwidth==0.2.13
webencodings==0.5.1
whitenoise==6.6.0
wrapt==1.16.0
XlsxWriter==3.2.0
yapf==0.40.2
yarl==1.9.4
zipp==3.18.1
zope.event==5.0
zope.interface==6.3
zstandard==0.22.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions