Skip to content
New issue

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

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

Already on GitHub? # to your account

[Fix] Read in rb mode then decode #983

Merged
merged 5 commits into from
May 13, 2021
Merged

[Fix] Read in rb mode then decode #983

merged 5 commits into from
May 13, 2021

Conversation

wangruohui
Copy link
Member

On Windows :

with open("some_file", r) as f:
    f.read()

will decode the content of the file based on windows's system language setting.

Using rb mode then decode within python will force using utf-8.

note: the ruby precommit hook does not work on windows and I will recover it when everything other is good before actual merge.

@codecov
Copy link

codecov bot commented Apr 24, 2021

Codecov Report

Merging #983 (7fe987f) into master (841a078) will decrease coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #983      +/-   ##
==========================================
- Coverage   65.27%   65.19%   -0.09%     
==========================================
  Files         151      154       +3     
  Lines        9619     9911     +292     
  Branches     1741     1807      +66     
==========================================
+ Hits         6279     6461     +182     
- Misses       3017     3116      +99     
- Partials      323      334      +11     
Flag Coverage Δ
unittests 65.19% <100.00%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmcv/utils/config.py 89.85% <100.00%> (ø)
mmcv/runner/hooks/optimizer.py 17.74% <0.00%> (-6.01%) ⬇️
mmcv/runner/hooks/logger/pavi.py 70.58% <0.00%> (-4.86%) ⬇️
mmcv/ops/corner_pool.py 51.35% <0.00%> (-4.59%) ⬇️
mmcv/utils/testing.py 96.00% <0.00%> (-4.00%) ⬇️
mmcv/runner/base_module.py 75.67% <0.00%> (-3.12%) ⬇️
mmcv/runner/fp16_utils.py 59.73% <0.00%> (-1.59%) ⬇️
mmcv/runner/hooks/logger/text.py 71.42% <0.00%> (-1.21%) ⬇️
mmcv/engine/test.py 26.04% <0.00%> (-0.85%) ⬇️
mmcv/utils/registry.py 98.31% <0.00%> (-0.02%) ⬇️
... and 18 more

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 841a078...7fe987f. Read the comment docs.

@wangruohui wangruohui requested a review from grimoire April 25, 2021 11:56
@hellock hellock requested review from ZwwWayne and removed request for grimoire April 25, 2021 12:03
mmcv/utils/config.py Outdated Show resolved Hide resolved
@zhouzaida zhouzaida changed the title read in rb mode then decode [Fix] Read in rb mode then decode Apr 27, 2021
@ZwwWayne ZwwWayne mentioned this pull request Apr 28, 2021
13 tasks
@ZwwWayne
Copy link
Collaborator

Kindly ping @wangruohui

@ZwwWayne
Copy link
Collaborator

@wangruohui ,lint failed. The comments are too long and need to be separated in two lines.

@ZwwWayne ZwwWayne merged commit 8ee8f69 into open-mmlab:master May 13, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants