[PATCH 1 of 3] py3: in doc module, replace "ru" string with "r" string

6 views
Skip to first unread message

Antonio Muci

unread,
Nov 10, 2023, 7:09:38 AM11/10/23
to thg...@googlegroups.com, a....@inwind.it
# HG changeset patch
# User Antonio Muci <a....@inwind.it>
# Date 1699614954 -3600
# Fri Nov 10 12:15:54 2023 +0100
# Branch stable
# Node ID 82e55282396f68e782dc3c831400a15e6a83adb9
# Parent 7e2f66c6c4052763f95737b68f71556d8d577a97
py3: in doc module, replace "ru" string with "r" string

Raw unicode strings are not syntactically legal in python3.

Command to quickly replicate the problem (python3.8 is the earliest python I
have on my system):
find . -name "__pycache__" -print0 | xargs -0 rm -rf && python3.8 -B -m compileall -q .

diff --git a/doc/source-cs/conf.py b/doc/source-cs/conf.py
--- a/doc/source-cs/conf.py
+++ b/doc/source-cs/conf.py
@@ -172,8 +172,8 @@ htmlhelp_basename = 'TortoiseHg'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class [howto/manual]).
latex_documents = [
- ('index', 'TortoiseHg.tex', ur'TortoiseHg Documentation',
- ur'Steve Borho and others', 'manual'),
+ ('index', 'TortoiseHg.tex', r'TortoiseHg Documentation',
+ r'Steve Borho and others', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
diff --git a/doc/source-ja/conf.py b/doc/source-ja/conf.py
--- a/doc/source-ja/conf.py
+++ b/doc/source-ja/conf.py
@@ -168,8 +168,8 @@ htmlhelp_basename = 'TortoiseHg'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class [howto/manual]).
latex_documents = [
- ('index', 'TortoiseHg.tex', ur'TortoiseHg マニュアル',
- ur'Steve Borho、他', 'manual'),
+ ('index', 'TortoiseHg.tex', r'TortoiseHg マニュアル',
+ r'Steve Borho、他', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of

Antonio Muci

unread,
Nov 10, 2023, 7:09:39 AM11/10/23
to thg...@googlegroups.com, a....@inwind.it
# HG changeset patch
# User Antonio Muci <a....@inwind.it>
# Date 1699615022 -3600
# Fri Nov 10 12:17:02 2023 +0100
# Branch stable
# Node ID 48fdb3a947fdcf145be035a451b484c72bb7f5c3
# Parent 7df99fd57e48d48760e27694483f59ddb658b89e
tests: use raw docstring when the text contains backslashes

This little problem was also discovered by a syntactic check like the ones did
in the previous commit, but I placed it in a dedicated commit because it would
already be warranted by pep 257.

From https://peps.python.org/pep-0257/ :
For consistency, always use """triple double quotes""" around docstrings.
Use r"""raw triple double quotes""" if you use any backslashes in your
docstrings.

diff --git a/tests/helpers.py b/tests/helpers.py
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -529,7 +529,7 @@ class GraphBuilder(object):
self._runcmd(self.hg.debugobsolete, n, *succ)

def buildgraph(path, textgraph):
- """create test repostory with dag specified by graphlog like format
+ r"""create test repostory with dag specified by graphlog like format

Example:
buildgraph('./testrepo', r'''

Yuya Nishihara

unread,
Nov 10, 2023, 8:02:34 AM11/10/23
to 'Antonio Muci' via TortoiseHg Developers, a....@inwind.it
On Fri, 10 Nov 2023 13:09:35 +0100, 'Antonio Muci' via TortoiseHg Developers wrote:
> # HG changeset patch
> # User Antonio Muci <a....@inwind.it>
> # Date 1699614954 -3600
> # Fri Nov 10 12:15:54 2023 +0100
> # Branch stable
> # Node ID 82e55282396f68e782dc3c831400a15e6a83adb9
> # Parent 7e2f66c6c4052763f95737b68f71556d8d577a97
> py3: in doc module, replace "ru" string with "r" string

Queued for stable, thanks.
Reply all
Reply to author
Forward
0 new messages