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

Fix DeprecationWarning about 'U' open mode #138

Merged
merged 1 commit into from
Dec 20, 2018

Conversation

stanislavlevin
Copy link
Contributor

According to https://docs.python.org/3.3/library/functions.html#open :
"'U' universal newlines mode (for backwards compatibility; should not
be used in new code)"
To control how universal newlines works there is "newline" option.
So, to fix it is enough to remove "U" from a set of open options.

Fixes: #137

@ionelmc
Copy link
Owner

ionelmc commented Dec 20, 2018

Note that we have a constant for PY3 in https://github.com/ionelmc/pytest-benchmark/blob/master/src/pytest_benchmark/compat.py#L3 - makes it easier to find all the python version checks though the code.

According to https://docs.python.org/3.3/library/functions.html#open :
"'U' universal newlines mode (for backwards compatibility; should not
be used in new code)"
To control how universal newlines works there is "newline" option.
So, to fix it is enough to remove "U" from set of open options.

Fixes: ionelmc#137
Signed-off-by: Stanislav Levin <[email protected]>
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@a37bb0e). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #138   +/-   ##
=========================================
  Coverage          ?   78.05%           
=========================================
  Files             ?       16           
  Lines             ?     1736           
  Branches          ?      316           
=========================================
  Hits              ?     1355           
  Misses            ?      322           
  Partials          ?       59
Impacted Files Coverage Δ
src/pytest_benchmark/storage/file.py 70.29% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a37bb0e...b204711. Read the comment docs.

@stanislavlevin
Copy link
Contributor Author

Thanks, fixed.

@ionelmc ionelmc merged commit ac7e7cb into ionelmc:master Dec 20, 2018
@ionelmc
Copy link
Owner

ionelmc commented Dec 20, 2018

Thanks!

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.

DeprecationWarning: 'U' mode is deprecated
3 participants