Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 5239970

Browse files
committed
Merge pull request #229 from saltduck/upgrade_protobuf
Upgrade protobuf to 3.0.0b2 to fix unicode bugs
2 parents b97efde + 8c8ad17 commit 5239970

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

api/restapi.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,8 @@ def delete_contract(self, request):
580580
if "keywords" in c.contract["vendor_offer"]["listing"]["item"]:
581581
for keyword in c.contract["vendor_offer"]["listing"]["item"]["keywords"]:
582582
if keyword != "":
583+
if isinstance(keyword, unicode):
584+
keyword = keyword.encode('utf8')
583585
self.kserver.delete(keyword.lower(), unhexlify(c.get_contract_id()),
584586
self.keychain.signing_key.sign(
585587
unhexlify(c.get_contract_id()))[:64])

market/contracts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,8 @@ def save(self):
923923
with open(file_path, 'w') as outfile:
924924
outfile.write(json.dumps(self.contract, indent=4))
925925

926+
if isinstance(self.previous_title, unicode):
927+
self.previous_title = self.previous_title.encode('utf8')
926928
if self.previous_title and self.previous_title != self.contract["vendor_offer"]["listing"]["item"]["title"]:
927929
old_name = str(self.previous_title[:100])
928930
old_name = re.sub(r"[^\w\s]", '', file_name)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
protobuf==2.6.1
1+
protobuf==3.0.0b2
22
Twisted==14.0.2
33
txrudp==0.5.1
44
pystun==0.1.0

0 commit comments

Comments
 (0)