[PATCH 22/24] pynfs: python3 support plan: fix ord() failure on python3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Jianhong.Yin" <yin-jianhong@xxxxxxx>

Signed-off-by: Jianhong Yin <yin-jianhong@xxxxxxx>
---
 nfs4.0/nfs4lib.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/nfs4.0/nfs4lib.py b/nfs4.0/nfs4lib.py
index 79e386e..82fa4d8 100644
--- a/nfs4.0/nfs4lib.py
+++ b/nfs4.0/nfs4lib.py
@@ -144,7 +144,10 @@ class CBServer(rpc.RPCServer):
         self.client = client
         rpc.RPCServer.__init__(self, prog=self.prog, vers=1, port=self.port)
         packed = struct.pack('>H', self.port)
-        self.dotport = '.%s.%s' % (ord(packed[0]), ord(packed[1]))
+        try:     #for python2
+            self.dotport = '.%s.%s' % (ord(packed[0]), ord(packed[1]))
+        except:  #for python3
+            self.dotport = '.%s.%s' % ((packed[0]), (packed[1]))
         self.nfs4packer = FancyNFS4Packer()
         self.nfs4unpacker = FancyNFS4Unpacker('')
         self.recall_lock = threading.Lock()
-- 
2.17.1

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux