60 initGlobals() |
60 initGlobals() |
61 |
61 |
62 try: |
62 try: |
63 filename = \ |
63 filename = \ |
64 os.path.join(pyxmlModDir, "parsers", "xmlproc", "xmlutils.py") |
64 os.path.join(pyxmlModDir, "parsers", "xmlproc", "xmlutils.py") |
65 f = open(filename, "r") |
65 f = open(filename, "r", encoding = "utf-8") |
66 except EnvironmentError: |
66 except EnvironmentError: |
67 print("Could not find the pyXML distribution. Please use the patch_pyxml.py") |
67 print("Could not find the pyXML distribution. Please use the patch_pyxml.py") |
68 print("script to apply a patch needed to fix a bug causing it to fail for") |
68 print("script to apply a patch needed to fix a bug causing it to fail for") |
69 print("XML files containing non ASCII characters.") |
69 print("XML files containing non ASCII characters.") |
70 return True # fake a found patch |
70 return True # fake a found patch |
97 initGlobals() |
97 initGlobals() |
98 |
98 |
99 try: |
99 try: |
100 filename = \ |
100 filename = \ |
101 os.path.join(pyxmlModDir, "parsers", "xmlproc", "xmlutils.py") |
101 os.path.join(pyxmlModDir, "parsers", "xmlproc", "xmlutils.py") |
102 f = open(filename, "r") |
102 f = open(filename, "r", encoding = "utf-8") |
103 except EnvironmentError: |
103 except EnvironmentError: |
104 print("The file %s does not exist. Aborting." % filename) |
104 print("The file %s does not exist. Aborting." % filename) |
105 sys.exit(1) |
105 sys.exit(1) |
106 |
106 |
107 lines = f.readlines() |
107 lines = f.readlines() |
109 |
109 |
110 patchPositionFound = False |
110 patchPositionFound = False |
111 patched = False |
111 patched = False |
112 |
112 |
113 sn = "xmlutils.py" |
113 sn = "xmlutils.py" |
114 s = open(sn, "w") |
114 s = open(sn, "w", encoding = "utf-8") |
115 for line in lines: |
115 for line in lines: |
116 if patchPositionFound: |
116 if patchPositionFound: |
117 if not line.startswith(\ |
117 if not line.startswith(\ |
118 " # patched by eric5 install script.") and \ |
118 " # patched by eric5 install script.") and \ |
119 not line.startswith(\ |
119 not line.startswith(\ |