work for japanese windows #5

Open
nozomi-hiragi wants to merge 1 commit from nozomi-hiragi/work_japanese_env into master

View file

@ -17,6 +17,7 @@
# Update (by Entwicklerpages): Simple fixes for python3 support. Now works on both versions. # Update (by Entwicklerpages): Simple fixes for python3 support. Now works on both versions.
import io
import os import os
import stat import stat
import shutil import shutil
@ -66,7 +67,7 @@ for i in os.listdir(workingDir):
for j in os.listdir(rootFile): for j in os.listdir(rootFile):
# grab the real path # grab the real path
if j == 'pathname': if j == 'pathname':
lines = [line.strip() for line in open(os.path.join(rootFile, j))] lines = [line.strip() for line in open(os.path.join(rootFile, j),'r',encoding="utf-8_sig")]
realPath = lines[0] # should always be on the first line realPath = lines[0] # should always be on the first line
elif j == 'asset': elif j == 'asset':
hasAsset = True hasAsset = True
@ -83,6 +84,8 @@ for i in os.listdir(workingDir):
os.makedirs(outputDir) os.makedirs(outputDir)
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding=sys.stdout.encoding, errors="replace")
for asset in mapping: for asset in mapping:
path, filename = os.path.split(mapping[asset]) path, filename = os.path.split(mapping[asset])