Skip to content

Commit

Permalink
Merge pull request #1434 from mosen/hotfix/purl_python3_bytestring
Browse files Browse the repository at this point in the history
python3 compatibility in purl/reportcommon
  • Loading branch information
mosen authored Jan 11, 2022
2 parents 46c8894 + 265bb53 commit 42f2677
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def initWithOptions_(self, options):
if options.get("content_type") is not None:
self.additional_headers["Content-Type"] = options.get("content_type")
self.body = options.get("body")
self.response_data = ""
self.response_data = b''

self.log = options.get("logging_function", NSLog)

Expand Down Expand Up @@ -420,4 +420,4 @@ def connection_didReceiveData_(self, connection, data):

# we don't actually use the connection argument, so
# pylint: disable=W0613
self.response_data = self.response_data + str(data)
self.response_data = self.response_data + data
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def process(serial, items):

# Decode response
try:
result = unserialize(server_data)
result = unserialize(server_data.decode('utf8'))
except Exception as e:
display_error("Could not unserialize server data: %s" % str(e))
display_error("Request: %s" % str(values))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/usr/local/munkireport/python3
# encoding: utf-8
'''Postflight script'''
"""Postflight script"""

from munkilib import reportcommon
from munkilib import FoundationPlist
import hashlib
import sys
import os


def main():
'''Main'''
"""Main"""

reportcommon.display_detail("## Starting MunkiReport run")

Expand Down Expand Up @@ -61,5 +62,6 @@ def main():
reportcommon.process(serial, items)
reportcommon.finish_run()


if __name__ == '__main__':
main()

0 comments on commit 42f2677

Please sign in to comment.