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

Allow parsing .po files that have an extant but empty Language header #1101

Closed akx closed 4 months ago

akx commented 4 months ago

Fixes #1087.

Some tools apparently generate somewhat strange Language MIME headers, so we'll treat them like the Language was unset.

Trying catalog.locale = "" by hand will still happily crash; this only affects MIME parsing.

codecov[bot] commented 4 months ago

Codecov Report

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

Project coverage is 91.09%. Comparing base (2f87363) to head (3abacbc).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1101 +/- ## ======================================= Coverage 91.09% 91.09% ======================================= Files 26 26 Lines 4470 4470 ======================================= Hits 4072 4072 Misses 398 398 ``` | [Flag](https://app.codecov.io/gh/python-babel/babel/pull/1101/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/1101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.91% <100.00%> (ø)` | | | [macos-12-3.11](https://app.codecov.io/gh/python-babel/babel/pull/1101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.91% <100.00%> (ø)` | | | [macos-12-3.12](https://app.codecov.io/gh/python-babel/babel/pull/1101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.20% <100.00%> (ø)` | | | [macos-12-3.8](https://app.codecov.io/gh/python-babel/babel/pull/1101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.83% <100.00%> (ø)` | | | [macos-12-3.9](https://app.codecov.io/gh/python-babel/babel/pull/1101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.90% <100.00%> (ø)` | | | [macos-12-pypy3.10](https://app.codecov.io/gh/python-babel/babel/pull/1101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.91% <100.00%> (ø)` | | | [ubuntu-22.04-3.10](https://app.codecov.io/gh/python-babel/babel/pull/1101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.93% <100.00%> (ø)` | | | [ubuntu-22.04-3.11](https://app.codecov.io/gh/python-babel/babel/pull/1101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.93% <100.00%> (ø)` | | | [ubuntu-22.04-3.12](https://app.codecov.io/gh/python-babel/babel/pull/1101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.22% <100.00%> (ø)` | | | [ubuntu-22.04-3.8](https://app.codecov.io/gh/python-babel/babel/pull/1101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.85% <100.00%> (ø)` | | | [ubuntu-22.04-3.9](https://app.codecov.io/gh/python-babel/babel/pull/1101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.92% <100.00%> (ø)` | | | [ubuntu-22.04-pypy3.10](https://app.codecov.io/gh/python-babel/babel/pull/1101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `89.93% <100.00%> (ø)` | | | [windows-2022-3.10](https://app.codecov.io/gh/python-babel/babel/pull/1101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.27% <100.00%> (ø)` | | | [windows-2022-3.11](https://app.codecov.io/gh/python-babel/babel/pull/1101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.27% <100.00%> (ø)` | | | [windows-2022-3.12](https://app.codecov.io/gh/python-babel/babel/pull/1101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.57% <100.00%> (ø)` | | | [windows-2022-3.8](https://app.codecov.io/gh/python-babel/babel/pull/1101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.20% <100.00%> (ø)` | | | [windows-2022-3.9](https://app.codecov.io/gh/python-babel/babel/pull/1101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.27% <100.00%> (ø)` | | | [windows-2022-pypy3.10](https://app.codecov.io/gh/python-babel/babel/pull/1101/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-babel) | `90.27% <100.00%> (ø)` | | 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.