From 4556fff1b09d21faad73474a8a2326626772b44f Mon Sep 17 00:00:00 2001 From: Jamie Cockburn Date: Thu, 22 Nov 2018 17:09:58 +0000 Subject: [PATCH] re #2 - Fixed error in restore in python 3 --- pyptables/__init__.py | 3 ++- setup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyptables/__init__.py b/pyptables/__init__.py index cdf6260..6dae4c1 100644 --- a/pyptables/__init__.py +++ b/pyptables/__init__.py @@ -94,11 +94,12 @@ def add_line_numbers(string, start=1): def restore(tables): process = subprocess.Popen( - ["iptables-restore"], + ["cat"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, ) if hasattr(tables, 'to_iptables'): tables = tables.to_iptables() + tables = tables.encode('utf-8') return process.communicate(tables) diff --git a/setup.py b/setup.py index 3cebaac..6c6f5b5 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setuptools.setup( name='PyPTables', - version='1.0.4', + version='1.0.5', author='Jamie Cockburn', author_email='jamie_cockburn@hotmail.co.uk', packages=setuptools.find_packages(),