python-babel / babel

The official repository for Babel, the Python Internationalization Library
http://babel.pocoo.org/
BSD 3-Clause "New" or "Revised" License
1.34k stars 448 forks source link

Simplify `read_mo` logic regarding `catalog.charset` #1148

Open tomasr8 opened 3 weeks ago

tomasr8 commented 3 weeks ago

Catalog.charset is set to utf-8 when no charset is provided (which is the case here) so the if check is redundant.

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.27%. Comparing base (f1c8633) to head (1e648b5). Report is 3 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1148 +/- ## ========================================== - Coverage 91.31% 91.27% -0.04% ========================================== Files 27 27 Lines 4618 4621 +3 ========================================== + Hits 4217 4218 +1 - Misses 401 403 +2 ``` | [Flag](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | Coverage Δ | | |---|---|---| | [macos-12-3.10](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.04% <100.00%> (-0.04%)` | :arrow_down: | | [macos-12-3.11](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.98% <100.00%> (-0.04%)` | :arrow_down: | | [macos-12-3.12](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.19% <100.00%> (-0.04%)` | :arrow_down: | | [macos-12-3.13-dev](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.72% <100.00%> (-0.04%)` | :arrow_down: | | [macos-12-3.8](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.97% <100.00%> (-0.04%)` | :arrow_down: | | [macos-12-3.9](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.97% <100.00%> (-0.04%)` | :arrow_down: | | [macos-12-pypy3.10](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.04% <100.00%> (-0.04%)` | :arrow_down: | | [ubuntu-22.04-3.10](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.06% <100.00%> (-0.04%)` | :arrow_down: | | [ubuntu-22.04-3.11](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.00% <100.00%> (-0.04%)` | :arrow_down: | | [ubuntu-22.04-3.12](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.21% <100.00%> (-0.04%)` | :arrow_down: | | [ubuntu-22.04-3.13-dev](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.74% <100.00%> (-0.04%)` | :arrow_down: | | [ubuntu-22.04-3.8](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.99% <100.00%> (-0.04%)` | :arrow_down: | | [ubuntu-22.04-3.9](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.99% <100.00%> (-0.04%)` | :arrow_down: | | [ubuntu-22.04-pypy3.10](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.06% <100.00%> (-0.04%)` | :arrow_down: | | [windows-2022-3.10](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.18% <100.00%> (-0.04%)` | :arrow_down: | | [windows-2022-3.11](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.12% <100.00%> (-0.04%)` | :arrow_down: | | [windows-2022-3.12](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.33% <100.00%> (-0.04%)` | :arrow_down: | | [windows-2022-3.13-dev](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.86% <100.00%> (-0.04%)` | :arrow_down: | | [windows-2022-3.8](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.11% <100.00%> (-0.04%)` | :arrow_down: | | [windows-2022-3.9](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.11% <100.00%> (-0.04%)` | :arrow_down: | | [windows-2022-pypy3.10](https://app.codecov.io/gh/python-babel/babel/pull/1148/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.18% <100.00%> (-0.04%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.