From ac028179e16549ccb318e98091dce2e6de12bd84 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Mon, 8 Apr 2013 17:15:50 -0500 Subject: LocalFilesystem: Use binary data format The pickle class returns 'bytes' objects in python 3 instead of 'str' objects which were returned in python2. Signed-off-by: Sol Jerome --- src/lib/Bcfg2/Reporting/Transport/LocalFilesystem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/Bcfg2/Reporting/Transport/LocalFilesystem.py') diff --git a/src/lib/Bcfg2/Reporting/Transport/LocalFilesystem.py b/src/lib/Bcfg2/Reporting/Transport/LocalFilesystem.py index 0a0f032e5..c7d5c512a 100644 --- a/src/lib/Bcfg2/Reporting/Transport/LocalFilesystem.py +++ b/src/lib/Bcfg2/Reporting/Transport/LocalFilesystem.py @@ -87,7 +87,7 @@ class LocalFilesystem(TransportBase): # using a tmpfile to hopefully avoid the file monitor from grabbing too # soon - saved = open(tmp_file, 'w') + saved = open(tmp_file, 'wb') try: saved.write(payload) except IOError: @@ -123,7 +123,7 @@ class LocalFilesystem(TransportBase): self.debug_log("Handling event %s" % event.filename) payload = os.path.join(self.work_path, event.filename) try: - payloadfd = open(payload, "r") + payloadfd = open(payload, "rb") interaction = cPickle.load(payloadfd) payloadfd.close() os.unlink(payload) -- cgit v1.2.3-1-g7c22