Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint: specify encoding when using 'open' #748

Merged
merged 2 commits into from
Oct 8, 2021
Merged

Conversation

umarcor
Copy link
Member

@umarcor umarcor commented Sep 28, 2021

Apart from the f-string issues, pylint is complaining about using open without specifying the encoding:

 ************* Module vunit.ui
vunit/ui/__init__.py:251:13: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
vunit/ui/__init__.py:831:13: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
************* Module vunit.test.runner
vunit/test/runner.py:310:13: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)

See:

https://pylint.pycqa.org/en/latest/technical_reference/features.html
unspecified-encoding (W1514)

Using open without explicitly specifying an encoding It is better to specify an encoding when opening documents. Using the system default implicitly can create problems on other operating systems. See https://www.python.org/dev/peps/pep-0597/

In this PR, I set the encoding to utf-8 (because of https://www.python.org/dev/peps/pep-0597/#prepare-to-change-the-default-encoding-to-utf-8).

@eine eine added this to the v4.6.0 milestone Sep 28, 2021
@umarcor umarcor force-pushed the fix-open-encoding branch from 6a02997 to 9f032d0 Compare October 8, 2021 13:12
@umarcor umarcor force-pushed the fix-open-encoding branch from 9f032d0 to ff58c79 Compare October 8, 2021 13:20
@umarcor umarcor force-pushed the fix-open-encoding branch from ff58c79 to 13ce559 Compare October 8, 2021 13:25
@eine eine merged commit 59cc9b9 into VUnit:master Oct 8, 2021
@umarcor umarcor deleted the fix-open-encoding branch October 8, 2021 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants