babel icon indicating copy to clipboard operation
babel copied to clipboard

Remove u string prefix from docs

Open verhovsky opened this issue 1 year ago • 3 comments

I did a search and replace for u" and (?<!')\bu' and checked each case. I also updated some strings to include the character instead of \u and \x literals since that's what the Python 3 REPL does and I also noticed some literals in docstrings were not escaped correctly (you need to escape the backslash unless it's a r""" docstring, otherwise the docstring will contain the actual character instead of the literal)

verhovsky avatar Jan 16 '25 10:01 verhovsky

It would be good to add doctest to babel to check that the REPL output in the examples actually matches what you get if you were to run the code, but I'm not going to work on that.

verhovsky avatar Jan 16 '25 12:01 verhovsky

It would be good to add doctest to babel to check that the REPL output in the examples actually matches what you get if you were to run the code, but I'm not going to work on that.

We do have that... https://github.com/python-babel/babel/blob/98b9562c05e5276038c27ec12c12f3e92dc027b6/conftest.py#L22-L24

akx avatar Jan 24 '25 07:01 akx

I thought it would catch the incorrectly escaped strings but it turns out doctest thinks that

['E d.\\u2009–\\u2009', 'E d.M.']

and

['E d.\u2009–\u2009', 'E d.M.']

are the same, which is surprising because they obviously are not but they wont fix it https://github.com/python/cpython/issues/129257#issuecomment-2612251436

verhovsky avatar Jan 24 '25 10:01 verhovsky

@verhovsky Very sorry for the delay! Can you rebase this (to fix the setup.cfg conflict)?

akx avatar Jun 24 '25 06:06 akx

Codecov Report

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

Project coverage is 91.98%. Comparing base (de44e18) to head (17d20c8). Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1174   +/-   ##
=======================================
  Coverage   91.98%   91.98%           
=======================================
  Files          27       27           
  Lines        4693     4693           
=======================================
  Hits         4317     4317           
  Misses        376      376           
Flag Coverage Δ
macos-14-3.10 91.02% <ø> (ø)
macos-14-3.11 90.96% <ø> (ø)
macos-14-3.12 91.17% <ø> (ø)
macos-14-3.13 91.17% <ø> (ø)
macos-14-3.8 90.89% <ø> (ø)
macos-14-3.9 90.95% <ø> (ø)
macos-14-pypy3.10 91.02% <ø> (ø)
ubuntu-24.04-3.10 91.05% <ø> (ø)
ubuntu-24.04-3.11 90.98% <ø> (ø)
ubuntu-24.04-3.12 91.19% <ø> (ø)
ubuntu-24.04-3.13 91.19% <ø> (ø)
ubuntu-24.04-3.8 90.91% <ø> (ø)
ubuntu-24.04-3.9 90.98% <ø> (ø)
ubuntu-24.04-pypy3.10 91.05% <ø> (ø)
windows-2022-3.10 91.04% <ø> (ø)
windows-2022-3.11 90.97% <ø> (ø)
windows-2022-3.12 91.19% <ø> (ø)
windows-2022-3.13 91.19% <ø> (ø)
windows-2022-3.8 91.01% <ø> (ø)
windows-2022-3.9 90.97% <ø> (ø)
windows-2022-pypy3.10 91.04% <ø> (ø)

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

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

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Jun 30 '25 09:06 codecov[bot]