extras-buildsys/common LockFile.py, 1.1.2.1, 1.1.2.2 SSLConnection.py, 1.3.4.5.4.4, 1.3.4.5.4.5 XMLRPCServerProxy.py, 1.5.4.4.4.1, 1.5.4.4.4.2
Michael Schwendt
mschwendt at fedoraproject.org
Tue Aug 10 15:30:25 UTC 2010
Author: mschwendt
Update of /cvs/fedora/extras-buildsys/common
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv16875/common
Modified Files:
Tag: Plague-0_4_5
LockFile.py SSLConnection.py XMLRPCServerProxy.py
Log Message:
Release 0.4.5.8: fixes for Python 2.7 and Python 2.4
Index: LockFile.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/common/Attic/LockFile.py,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- LockFile.py 29 Sep 2008 16:05:53 -0000 1.1.2.1
+++ LockFile.py 10 Aug 2010 15:30:22 -0000 1.1.2.2
@@ -30,8 +30,10 @@
def __init__(self, name, blocking=False):
self._fname = name
- self._lock = struct.pack('hhqqhh', fcntl.F_WRLCK, os.SEEK_SET, 0, 0, 0, 0)
- self._unlock = struct.pack('hhqqhh', fcntl.F_UNLCK, os.SEEK_SET, 0, 0, 0, 0)
+ # since Python 2.5: os.SEEK_SET = 0
+ whence = 0
+ self._lock = struct.pack('hhqqhh', fcntl.F_WRLCK, whence, 0, 0, 0, 0)
+ self._unlock = struct.pack('hhqqhh', fcntl.F_UNLCK, whence, 0, 0, 0, 0)
if blocking:
self._l_cmd = fcntl.F_SETLKW
else:
Index: SSLConnection.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/common/SSLConnection.py,v
retrieving revision 1.3.4.5.4.4
retrieving revision 1.3.4.5.4.5
diff -u -r1.3.4.5.4.4 -r1.3.4.5.4.5
--- SSLConnection.py 12 Jun 2009 17:30:05 -0000 1.3.4.5.4.4
+++ SSLConnection.py 10 Aug 2010 15:30:22 -0000 1.3.4.5.4.5
@@ -9,7 +9,7 @@
from OpenSSL import SSL, crypto
-import os, string, time, socket, select
+import os, string, time, socket, select, sys
class SSLConnection:
@@ -63,7 +63,7 @@
c, a = self.__dict__["conn"].accept()
return (SSLConnection(c), a)
- def makefile(self, mode, bufsize):
+ def makefile(self, mode='r', bufsize=-1):
"""
We need to use socket._fileobject Because SSL.Connection
doesn't have a 'dup'. Not exactly sure WHY this is, but
@@ -97,6 +97,9 @@
if not con in write:
raise socket.timeout((110, "Operation timed out."))
+ if sys.version_info[:2] >= (2, 7):
+ if type(data) == memoryview:
+ data = data.tobytes()
starttime = time.time()
origlen = len(data)
sent = -1
Index: XMLRPCServerProxy.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/common/XMLRPCServerProxy.py,v
retrieving revision 1.5.4.4.4.1
retrieving revision 1.5.4.4.4.2
diff -u -r1.5.4.4.4.1 -r1.5.4.4.4.2
--- XMLRPCServerProxy.py 31 Jan 2008 13:48:41 -0000 1.5.4.4.4.1
+++ XMLRPCServerProxy.py 10 Aug 2010 15:30:22 -0000 1.5.4.4.4.2
@@ -39,7 +39,10 @@
# Yay for Python 2.2
pass
_host, _port = urllib.splitport(host)
- return SSLCommon.PlgHTTPS(_host, int(_port), ssl_context=self.ssl_ctx, timeout=self._timeout)
+ if sys.version_info[:2] >= (2, 7):
+ return SSLCommon.PlgHTTPSConnection(_host, int(_port), ssl_context=self.ssl_ctx, timeout=self._timeout)
+ else:
+ return SSLCommon.PlgHTTPS(_host, int(_port), ssl_context=self.ssl_ctx, timeout=self._timeout)
class PlgXMLRPCServerProxy(xmlrpclib.ServerProxy):
More information about the scm-commits
mailing list