diff --git a/.travis.yml b/.travis.yml index dab897a8..90cba453 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,9 @@ matrix: - os: linux python: 2.7 include: + - os: linux + python: 3.8 + dist: xenial - os: linux python: 3.7 dist: xenial diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bf824c2..ec2178e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - `mode` parameter added to `font_list` and `art_list` functions - `decoration` parameter added to `text2art`, `tprint` and `tsave` functions - `\n` support bug fixed +- `tsave` function bug in Windows fixed ### Removed - `requirements.txt` ## [4.5] - 2020-01-29 diff --git a/appveyor.yml b/appveyor.yml index ab67d9a4..11559d70 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,12 +2,6 @@ build: false environment: matrix: - - PYTHON: "C:\\Python27" - PYTHON_VERSION: "2.7.2" - PYTHON_ARCH: "32" - - PYTHON: "C:\\Python27" - PYTHON_VERSION: "2.7.2" - PYTHON_ARCH: "64" - PYTHON: "C:\\Python35" PYTHON_VERSION: "3.5.5" PYTHON_ARCH: "32" @@ -26,6 +20,12 @@ environment: - PYTHON: "C:\\Python37" PYTHON_VERSION: "3.7.0" PYTHON_ARCH: "32" + - PYTHON: "C:\\Python38" + PYTHON_VERSION: "3.8.0" + PYTHON_ARCH: "64" + - PYTHON: "C:\\Python38" + PYTHON_VERSION: "3.8.0" + PYTHON_ARCH: "32" - PYTHON: "C:\\Python34" PYTHON_VERSION: "3.4.6" PYTHON_ARCH: "64" diff --git a/art/art.py b/art/art.py index 11448dad..2616f659 100644 --- a/art/art.py +++ b/art/art.py @@ -5,7 +5,6 @@ import os import sys import random -import codecs class artError(Exception): # pragma: no cover @@ -278,18 +277,13 @@ def tsave( index = index + 1 else: break - file = codecs.open(test_name + extension, "w", encoding='utf-8') + file = open(test_name + extension, "w", encoding='utf-8') result = text2art( text, font=font, decoration=decoration, chr_ignore=chr_ignore) - try: - file.write(result) - except UnicodeDecodeError: # pragma: no cover - file.close() - file = codecs.open(test_name + extension, "w") - file.write(result) + file.write(result) file.close() if print_status: print("Saved! \nFilename: " + test_name + extension) diff --git a/art/test.py b/art/test.py index f96a1a74..ebaa77df 100644 --- a/art/test.py +++ b/art/test.py @@ -4646,6 +4646,12 @@ 'OK' >>> Data["Status"] True +>>> result = [] +>>> for i in FONT_NAMES: +... t = tsave("save-test",font=i,filename="save_test.txt",print_status=False,overwrite=True) +... result.append(t["Status"]) +>>> all(result) +True >>> os.remove("art.txt") >>> os.remove("art2.txt") >>> os.remove("art3.txt") @@ -4653,5 +4659,6 @@ >>> os.remove("test.txt") >>> os.remove("test1.txt") >>> os.remove("test1.2.txt") +>>> os.remove("save_test.txt") '''