From c1233bd26b72ffd9ba2587fd807b405a9116370c Mon Sep 17 00:00:00 2001 From: David Amrhein Date: Mon, 22 Aug 2016 19:55:08 -0400 Subject: [PATCH] Make 'rb' file mode windows specific --- lbrynet/lbrynet_daemon/LBRYPublisher.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lbrynet/lbrynet_daemon/LBRYPublisher.py b/lbrynet/lbrynet_daemon/LBRYPublisher.py index 4d975c56b..ec7b908dc 100644 --- a/lbrynet/lbrynet_daemon/LBRYPublisher.py +++ b/lbrynet/lbrynet_daemon/LBRYPublisher.py @@ -57,9 +57,14 @@ class Publisher(object): self.bid_amount = bid self.metadata = metadata + if os.name == "nt": + file_mode = 'rb' + else: + file_mode = 'r' + d = self._check_file_path(self.file_path) d.addCallback(lambda _: create_lbry_file(self.session, self.lbry_file_manager, - self.file_name, open(self.file_path, 'rb'))) + self.file_name, open(self.file_path, file_mode))) d.addCallback(self.add_to_lbry_files) d.addCallback(lambda _: self._create_sd_blob()) d.addCallback(lambda _: self._claim_name())