diff --git a/.travis.yml b/.travis.yml index 07b63ab3aa..4a79a6777e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,8 +28,8 @@ addons: - libc6-i386 - libgcc1:i386 - libstdc++6:i386 - - python - - python-pip + - python3 + - python3-pip install: - tools/travis/install_build_tools.sh diff --git a/tools/ss13_genchangelog.py b/tools/ss13_genchangelog.py index c7a31325b1..5c77063e96 100644 --- a/tools/ss13_genchangelog.py +++ b/tools/ss13_genchangelog.py @@ -73,7 +73,7 @@ changelog_cache = os.path.join(args.ymlDir, '.all_changelog.yml') failed_cache_read = True if os.path.isfile(changelog_cache): try: - with open(changelog_cache) as f: + with open(changelog_cache,encoding='utf-8') as f: (_, all_changelog_entries) = yaml.load_all(f) failed_cache_read = False @@ -100,7 +100,7 @@ if failed_cache_read and os.path.isfile(args.targetFile): from bs4 import BeautifulSoup from bs4.element import NavigableString print(' Generating cache...') - with open(args.targetFile, 'r') as f: + with open(args.targetFile, 'r', encoding='utf-8') as f: soup = BeautifulSoup(f) for e in soup.find_all('div', {'class':'commit'}): entry = {} @@ -141,7 +141,7 @@ for fileName in glob.glob(os.path.join(args.ymlDir, "*.yml")): fileName = os.path.abspath(fileName) print(' Reading {}...'.format(fileName)) cl = {} - with open(fileName, 'r') as f: + with open(fileName, 'r',encoding='utf-8') as f: cl = yaml.load(f) f.close() if today not in all_changelog_entries: @@ -170,13 +170,13 @@ for fileName in glob.glob(os.path.join(args.ymlDir, "*.yml")): if args.dryRun: continue cl['changes'] = [] - with open(fileName, 'w') as f: + with open(fileName, 'w', encoding='utf-8') as f: yaml.dump(cl, f, default_flow_style=False) targetDir = os.path.dirname(args.targetFile) -with open(args.targetFile.replace('.htm', '.dry.htm') if args.dryRun else args.targetFile, 'w') as changelog: - with open(os.path.join(targetDir, 'templates', 'header.html'), 'r') as h: +with open(args.targetFile.replace('.htm', '.dry.htm') if args.dryRun else args.targetFile, 'w', encoding='utf-8') as changelog: + with open(os.path.join(targetDir, 'templates', 'header.html'), 'r', encoding='utf-8') as h: for line in h: changelog.write(line) @@ -203,7 +203,7 @@ with open(args.targetFile.replace('.htm', '.dry.htm') if args.dryRun else args.t if write_entry: changelog.write(entry_htm) - with open(os.path.join(targetDir, 'templates', 'footer.html'), 'r') as h: + with open(os.path.join(targetDir, 'templates', 'footer.html'), 'r', encoding='utf-8') as h: for line in h: changelog.write(line) diff --git a/tools/travis/build_tools.sh b/tools/travis/build_tools.sh index 525b45f124..87aaa124c0 100755 --- a/tools/travis/build_tools.sh +++ b/tools/travis/build_tools.sh @@ -12,5 +12,5 @@ then php -l tools/TGUICompiler.php; echo "Checking for JSON errors"; find . -name "*.json" -not -path "./tgui/node_modules/*" | xargs -0 python3 ./tools/json_verifier.py; - python tools/ss13_genchangelog.py html/changelog.html html/changelogs; + python3 tools/ss13_genchangelog.py html/changelog.html html/changelogs; fi; diff --git a/tools/travis/install_build_tools.sh b/tools/travis/install_build_tools.sh index 62127abdf0..76d0dbf69d 100755 --- a/tools/travis/install_build_tools.sh +++ b/tools/travis/install_build_tools.sh @@ -4,8 +4,8 @@ set -e if [ "$BUILD_TOOLS" = true ]; then rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $NODE_VERSION npm install -g gulp-cli - pip install --user PyYaml -q - pip install --user beautifulsoup4 -q + pip3 install --user PyYaml -q + pip3 install --user beautifulsoup4 -q fi;