From db2e7fde37a182ece3c3dd3d38256b037bd2a4f6 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 19 Aug 2013 19:21:32 +0200 Subject: [PATCH 1/2] add PyCharm to gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2c7c0b9ae..94e3e614d 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,4 @@ MANIFEST .noseids netlib venv - +.idea \ No newline at end of file From 42aede6181c643bb5bbd35ca81b6c1b1c69ec4b5 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 19 Aug 2013 19:21:47 +0200 Subject: [PATCH 2/2] ensure binary read on windows --- libpathod/pathod.py | 2 +- pathod | 6 +++--- setup.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libpathod/pathod.py b/libpathod/pathod.py index 621ef867c..5fc1fd55b 100644 --- a/libpathod/pathod.py +++ b/libpathod/pathod.py @@ -12,7 +12,7 @@ class SSLOptions: def __init__(self, certfile=None, keyfile=None, not_after_connect=None, request_client_cert=False): self.keyfile = keyfile or utils.data.path("resources/server.key") self.certfile = certfile or utils.data.path("resources/server.crt") - self.cert = certutils.SSLCert.from_pem(file(self.certfile, "r").read()) + self.cert = certutils.SSLCert.from_pem(file(self.certfile, "rb").read()) self.not_after_connect = not_after_connect self.request_client_cert = request_client_cert diff --git a/pathod b/pathod index 60ade46ec..10e9ba55d 100755 --- a/pathod +++ b/pathod @@ -22,9 +22,9 @@ def daemonize (stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'): except OSError, e: sys.stderr.write ("fork #2 failed: (%d) %s\n" % (e.errno, e.strerror) ) sys.exit(1) - si = open(stdin, 'r') - so = open(stdout, 'a+') - se = open(stderr, 'a+', 0) + si = open(stdin, 'rb') + so = open(stdout, 'a+b') + se = open(stderr, 'a+b', 0) os.dup2(si.fileno(), sys.stdin.fileno()) os.dup2(so.fileno(), sys.stdout.fileno()) os.dup2(se.fileno(), sys.stderr.fileno()) diff --git a/setup.py b/setup.py index a71499ca8..bac209035 100644 --- a/setup.py +++ b/setup.py @@ -65,7 +65,7 @@ def findPackages(path, dataExclude=[]): return packages, package_data -long_description = file("README.txt").read() +long_description = file("README.txt","rb").read() packages, package_data = findPackages("libpathod") setup( name = "pathod",