Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit223e501

Browse files
tiranmiss-islington
authored andcommitted
bpo-34791: xml package obeys ignore env flags (GH-9544)
The xml.sax and xml.dom.domreg modules now obeysys.flags.ignore_environment.Signed-off-by: Christian Heimes <christian@python.org>https://bugs.python.org/issue34791
1 parenta46467f commit223e501

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

‎Lib/xml/dom/domreg.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# should be published by posting to xml-sig@python.org, and are
77
# subsequently recorded in this file.
88

9+
importsys
10+
911
well_known_implementations= {
1012
'minidom':'xml.dom.minidom',
1113
'4DOM':'xml.dom.DOMImplementation',
@@ -55,7 +57,7 @@ def getDOMImplementation(name=None, features=()):
5557
returnmod.getDOMImplementation()
5658
elifname:
5759
returnregistered[name]()
58-
elif"PYTHON_DOM"inos.environ:
60+
elifnotsys.flags.ignore_environmentand"PYTHON_DOM"inos.environ:
5961
returngetDOMImplementation(name=os.environ["PYTHON_DOM"])
6062

6163
# User did not specify a name, try implementations in arbitrary

‎Lib/xml/sax/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def parseString(string, handler, errorHandler=ErrorHandler()):
5858
importxml.sax.expatreader
5959

6060
importos,sys
61-
if"PY_SAX_PARSER"inos.environ:
61+
ifnotsys.flags.ignore_environmentand"PY_SAX_PARSER"inos.environ:
6262
default_parser_list=os.environ["PY_SAX_PARSER"].split(",")
6363
delos
6464

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The xml.sax and xml.dom.domreg no longer use environment variables to
2+
override parser implementations when sys.flags.ignore_environment is set by
3+
-E or -I arguments.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp