Skip to content

Commit

Permalink
Additional fixes for opening files with codecs
Browse files Browse the repository at this point in the history
  • Loading branch information
josephsnyder committed Oct 1, 2019
1 parent d5f1df8 commit f7babb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Scripts/PackRO.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#---------------------------------------------------------------------------
import codecs
import sys
import os

Expand All @@ -33,7 +34,7 @@ def pack(files, output):
continue
n = os.path.basename(f)[:-2]
n = n.replace("_","%")
m = open(f,"r")
m = codecs.open(f,"r", 'ISO-8859-1', 'ignore')
output.write('%s\n'%n)
for line in m:
output.write(line)
Expand Down
5 changes: 3 additions & 2 deletions Scripts/PrepareMComponentsForImport.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# limitations under the License.
#---------------------------------------------------------------------------
from __future__ import print_function
import codecs
import sys
import os
import PackRO
Expand All @@ -38,8 +39,8 @@ def files_in_tree(pattern, top):
except OSError:
pass

routputfile = open(os.path.join(result.outputdir,"routines.ro"),'w')
goutputfile = open(os.path.join(result.outputdir,"globals.lst"),'w')
routputfile = codecs.open(os.path.join(result.outputdir,"routines.ro"), 'w', 'ISO-8859-1', 'ignore')
goutputfile = codecs.open(os.path.join(result.outputdir,"globals.lst"), 'w', 'ISO-8859-1', 'ignore')

routines=[]
globals=[]
Expand Down

0 comments on commit f7babb8

Please sign in to comment.