parent
26348022b4
commit
7912e8d090
@ -0,0 +1,34 @@
|
||||
diff --git a/BitTorrent/HTTPHandler.py b/BitTorrent/HTTPHandler.py
|
||||
index afabc63..91a745d 100644
|
||||
--- a/BitTorrent/HTTPHandler.py
|
||||
+++ b/BitTorrent/HTTPHandler.py
|
||||
@@ -110,6 +110,8 @@ class HTTPConnector(object):
|
||||
#this is nasty but i'm unsure of a better way at the moment
|
||||
compressed = StringIO()
|
||||
gz = GzipFile(fileobj = compressed, mode = 'wb', compresslevel = 9)
|
||||
+ if type(data) == unicode:
|
||||
+ data = data.encode("utf8")
|
||||
gz.write(data)
|
||||
gz.close()
|
||||
compressed.seek(0,0)
|
||||
@@ -151,6 +153,8 @@ class HTTPConnector(object):
|
||||
r.write(key + ': ' + str(value) + '\r\n')
|
||||
r.write('\r\n')
|
||||
if self.command != 'HEAD':
|
||||
+ if type(data)==unicode:
|
||||
+ data=data.encode("utf8")
|
||||
r.write(data)
|
||||
self.connection.write(r.getvalue())
|
||||
if self.connection.is_flushed():
|
||||
diff --git a/BitTorrent/track.py b/BitTorrent/track.py
|
||||
index ebedb70..4995b9c 100644
|
||||
--- a/BitTorrent/track.py
|
||||
+++ b/BitTorrent/track.py
|
||||
@@ -54,6 +54,7 @@ import threading
|
||||
import traceback
|
||||
|
||||
NOISY = False
|
||||
+_ = lambda x:x
|
||||
|
||||
def quote(x):
|
||||
return urllib.quote(x, safe='')
|
Loading…
Reference in new issue