Skip to content

Commit f0285a2

Browse files
Merge branch 'main' into venv-use-prog
2 parents 918676c + ad6a032 commit f0285a2

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

Doc/faq/programming.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,15 +1868,15 @@ object identity is assured. Generally, there are three circumstances where
18681868
identity is guaranteed:
18691869

18701870
1) Assignments create new names but do not change object identity. After the
1871-
assignment ``new = old``, it is guaranteed that ``new is old``.
1871+
assignment ``new = old``, it is guaranteed that ``new is old``.
18721872

18731873
2) Putting an object in a container that stores object references does not
1874-
change object identity. After the list assignment ``s[0] = x``, it is
1875-
guaranteed that ``s[0] is x``.
1874+
change object identity. After the list assignment ``s[0] = x``, it is
1875+
guaranteed that ``s[0] is x``.
18761876

18771877
3) If an object is a singleton, it means that only one instance of that object
1878-
can exist. After the assignments ``a = None`` and ``b = None``, it is
1879-
guaranteed that ``a is b`` because ``None`` is a singleton.
1878+
can exist. After the assignments ``a = None`` and ``b = None``, it is
1879+
guaranteed that ``a is b`` because ``None`` is a singleton.
18801880

18811881
In most other circumstances, identity tests are inadvisable and equality tests
18821882
are preferred. In particular, identity tests should not be used to check

Lib/test/test_tools/msgfmt_data/general.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
[
33
"",
4-
"Project-Id-Version: PACKAGE VERSION\nPOT-Creation-Date: 2024-10-26 18:06+0200\nPO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\nLast-Translator: FULL NAME <EMAIL@ADDRESS>\nLanguage-Team: LANGUAGE <[email protected]>\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n"
4+
"Project-Id-Version: PACKAGE VERSION\nPO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\nLast-Translator: FULL NAME <EMAIL@ADDRESS>\nLanguage-Team: LANGUAGE <[email protected]>\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n"
55
],
66
[
77
"\n newlines \n",
-41 Bytes
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:program:`msgfmt` no longer adds the ``POT-Creation-Date`` to generated ``.mo`` files
2+
for consistency with GNU ``msgfmt``.

Tools/i18n/msgfmt.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,19 @@ def make(filename, outfile):
158158
msgctxt = b''
159159
elif l.startswith('msgid') and not l.startswith('msgid_plural'):
160160
if section == STR:
161-
add(msgctxt, msgid, msgstr, fuzzy)
162-
msgctxt = None
163161
if not msgid:
162+
# Filter out POT-Creation-Date
163+
# See issue #131852
164+
msgstr = b''.join(line for line in msgstr.splitlines(True)
165+
if not line.startswith(b'POT-Creation-Date:'))
166+
164167
# See whether there is an encoding declaration
165168
p = HeaderParser()
166169
charset = p.parsestr(msgstr.decode(encoding)).get_content_charset()
167170
if charset:
168171
encoding = charset
172+
add(msgctxt, msgid, msgstr, fuzzy)
173+
msgctxt = None
169174
section = ID
170175
l = l[5:]
171176
msgid = msgstr = b''

0 commit comments

Comments
 (0)