diff options
author | Dave Reisner <dreisner@archlinux.org> | 2018-08-19 21:12:33 -0400 |
---|---|---|
committer | Andrew Gregory <andrew.gregory.8@gmail.com> | 2018-10-18 18:05:19 -0700 |
commit | afb9c0140fd6949ede64cc1a304e9349772fca04 (patch) | |
tree | 6995c7eb8f090f5af64ae6219f872b42db2eb9d3 /test/pacman/pmdb.py | |
parent | ffde85aadfe0e08fb710102d0a547335e9d1a200 (diff) | |
download | pacman-afb9c0140fd6949ede64cc1a304e9349772fca04.tar.xz |
Port pactest to python3
Use BytesIO instead of StringIO, and ensure that we unicode-encode data
where needed.
Diffstat (limited to 'test/pacman/pmdb.py')
-rw-r--r-- | test/pacman/pmdb.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/pacman/pmdb.py b/test/pacman/pmdb.py index f7671987..95aa8756 100644 --- a/test/pacman/pmdb.py +++ b/test/pacman/pmdb.py @@ -15,9 +15,9 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. +from io import BytesIO import os import shutil -from StringIO import StringIO import tarfile import pmpkg @@ -251,7 +251,7 @@ class pmdb(object): filename = os.path.join(pkg.fullname(), name) info = tarfile.TarInfo(filename) info.size = len(data) - tar.addfile(info, StringIO(data)) + tar.addfile(info, BytesIO(data.encode('utf8'))) tar.close() # TODO: this is a bit unnecessary considering only one test uses it serverpath = os.path.join(self.root, util.SYNCREPO, self.treename) |