Skip to content

Fails pylint's unspecified-encoding check #64

Closed
@magnusbaeck

Description

@magnusbaeck

Description

While making a dummy PR I stumbled upon that we nowadays get pylint 2.10.2 (compared to last week's 2.9.5 or something) and with that version we fail the unspecified-encoding check in a few places.

pylint create: /home/runner/work/eiffel-graphql-api/eiffel-graphql-api/.tox/pylint
pylint installdeps: pylint, pytest, pytest-cov, mongomock
pylint inst: /home/runner/work/eiffel-graphql-api/eiffel-graphql-api/.tox/.tmp/package/1/eiffel-graphql-api-0.0.post0.dev1+g21a65f9.zip
pylint installed: aniso8601==7.0.0,astroid==2.7.2,attrs==21.2.0,certifi==2021.5.30,chardet==3.0.4,click==8.0.1,coverage==5.5,dataclasses==0.8,dnspython==1.16.0,eiffel-graphql-api @ file:///home/runner/work/eiffel-graphql-api/eiffel-graphql-api/.tox/.tmp/package/1/eiffel-graphql-api-0.0.post0.dev1%2Bg21a65f9.zip,eiffellib==1.2.0,Flask==1.1.1,Flask-GraphQL==2.0.0,gevent==1.4.0,gql==0.1.0,graphene==2.1.8,graphql-core==2.2.1,graphql-relay==2.0.1,graphql-server-core==1.1.3,greenlet==1.1.1,gunicorn==20.0.4,idna==2.8,importlib-metadata==4.6.4,iniconfig==1.1.1,isort==5.9.3,itsdangerous==2.0.1,Jinja2==3.0.1,jsonschema==3.0.0a2,lazy-object-proxy==1.6.0,MarkupSafe==2.0.1,mccabe==0.6.1,mongomock==3.23.0,packaging==21.0,pika==1.0.1,platformdirs==2.2.0,pluggy==0.13.1,promise==2.3,py==1.10.0,pylint==2.10.2,pymongo==3.12.0,pyparsing==2.4.7,pyrsistent==0.18.0,pytest==6.2.4,pytest-cov==2.12.1,requests==2.22.0,Rx==1.6.1,sentinels==1.0.0,six==1.16.0,toml==0.10.2,typed-ast==1.4.3,typing-extensions==3.10.0.0,urllib3==1.25.11,Werkzeug==2.0.1,wrapt==1.12.1,zipp==3.5.0
pylint run-test-pre: PYTHONHASHSEED='2740057181'
pylint run-test: commands[0] | pylint src/eiffel_graphql_api tests
************* Module eiffel_graphql_api.storage
src/eiffel_graphql_api/storage.py:34:9: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
src/eiffel_graphql_api/storage.py:37:9: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
************* Module eiffel_graphql_api.graphql.schemas.lib.generic
src/eiffel_graphql_api/graphql/schemas/lib/generic.py:55:9: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)

-----------------------------------
Your code has been rated at 9.98/10

ERROR: InvocationError for command /home/runner/work/eiffel-graphql-api/eiffel-graphql-api/.tox/pylint/bin/pylint src/eiffel_graphql_api tests (exited with code 4)

Apart from fixing this violation we should consider locking the linters to fixed versions to avoid surprises. Perhaps consider using Poetry for dependency management?

Motivation

All configured linters should pass.

Exemplification

N/A

Benefits

Working CI.

Possible Drawbacks

None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions