|
From: <mi...@us...> - 2021-10-12 11:42:35
|
Revision: 8849
http://sourceforge.net/p/docutils/code/8849
Author: milde
Date: 2021-10-12 11:42:33 +0000 (Tue, 12 Oct 2021)
Log Message:
-----------
Fix a bug in nodes.document.set_name_id_map().
Don't change a list while looping over it.
Thanks to Mickey Endito.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/nodes.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2021-10-05 21:47:38 UTC (rev 8848)
+++ trunk/docutils/HISTORY.txt 2021-10-12 11:42:33 UTC (rev 8849)
@@ -16,6 +16,12 @@
Will be merged on release.
+* docutils/nodes.py
+
+ - Don't change a list while looping over it (in
+ document.set_name_id_map()). Thanks to Mickey Endito.
+
+
Release 0.18b1 (2021-10-05)
===========================
@@ -117,9 +123,8 @@
Use class value "backrefs" instead of "fn-backref" for a span of
back-references.
- - Do not write class values handled by the HTML writer
- ("colwidths-auto", "colwidths-given", "colwidths-grid") to the
- output.
+ - Do not write class values handled by the HTML writer ("colwidths-auto",
+ "colwidths-given", "colwidths-grid") to the output.
- Move space character between section number and heading into
"sectnum" span.
@@ -183,6 +188,7 @@
- Fix: double quotes need to be escaped on macro invocation.
Done everywhere.
+
Release 0.17.1 (2021-04-16)
===========================
@@ -857,6 +863,7 @@
- Apply [ 115 ] respect fixed 2to3 string literal conversion behavior.
+
Release 0.11 (2013-07-22)
=========================
@@ -924,6 +931,7 @@
- Fix [3607063] handle lines starting with a period.
- Fix option separating comma was bold (thanks to Bill Morris).
+
Release 0.10 (2012-12-16)
=========================
@@ -1033,6 +1041,7 @@
- class `Tee`: catch UnicodeError when writing to "ascii" stream or
file under Python 3.
+
Release 0.9 (2012-05-02)
========================
@@ -1127,6 +1136,7 @@
- Do not emit comment line with trailing blank. Problematic for VCS.
+
Release 0.8.1 (2011-08-30)
==========================
@@ -1143,6 +1153,7 @@
- Clean up Babel language setting. Restores Sphinx compatibility.
+
Release 0.8 (2011-07-07)
========================
@@ -1240,6 +1251,7 @@
- Do not close() sys.stdin, sys.stdout, or sys.stderr. Prevents
``Exception ValueError: 'I/O operation on closed file.'`` with Python 3.
+
Release 0.7 (2010-07-07)
========================
@@ -1463,6 +1475,7 @@
* docutils/tools/rst2man.py
+
Release 0.5 (2008-06-25)
========================
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2021-10-05 21:47:38 UTC (rev 8848)
+++ trunk/docutils/docutils/nodes.py 2021-10-12 11:42:33 UTC (rev 8849)
@@ -1402,25 +1402,26 @@
booleans representing hyperlink type (True==explicit,
False==implicit). This method updates the mappings.
- The following state transition table shows how `self.nameids` ("ids")
- and `self.nametypes` ("types") change with new input (a call to this
- method), and what actions are performed ("implicit"-type system
- messages are INFO/1, and "explicit"-type system messages are ERROR/3):
+ The following state transition table shows how `self.nameids` items
+ ("id") and `self.nametypes` items ("type") change with new input
+ (a call to this method), and what actions are performed
+ ("implicit"-type system messages are INFO/1, and
+ "explicit"-type system messages are ERROR/3):
==== ===== ======== ======== ======= ==== ===== =====
Old State Input Action New State Notes
----------- -------- ----------------- ----------- -----
- ids types new type sys.msg. dupname ids types
+ id type new type sys.msg. dupname id type
==== ===== ======== ======== ======= ==== ===== =====
- - explicit - - new True
- - implicit - - new False
- None False explicit - - new True
+ - False explicit - - new True
old False explicit implicit old new True
- None True explicit explicit new None True
- old True explicit explicit new,old None True [#]_
- None False implicit implicit new None False
- old False implicit implicit new,old None False
- None True implicit implicit new None True
+ - True explicit explicit new - True
+ old True explicit explicit new,old - True [#]_
+ - False implicit implicit new - False
+ old False implicit implicit new,old - False
+ - True implicit implicit new - True
old True implicit implicit new old True
==== ===== ======== ======== ======= ==== ===== =====
@@ -1428,9 +1429,10 @@
both old and new targets are external and refer to identical URIs.
The new target is invalidated regardless.
"""
- for name in node['names']:
+ for name in tuple(node['names']):
if name in self.nameids:
self.set_duplicate_name_id(node, id, name, msgnode, explicit)
+ # attention: modifies node['names']
else:
self.nameids[name] = id
self.nametypes[name] = explicit
@@ -1483,7 +1485,7 @@
# "note" here is an imperative verb: "take note of".
def note_implicit_target(self, target, msgnode=None):
id = self.set_id(target, msgnode)
- self.set_name_id_map(target, id, msgnode, explicit=None)
+ self.set_name_id_map(target, id, msgnode, explicit=False)
def note_explicit_target(self, target, msgnode=None):
id = self.set_id(target, msgnode)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|