]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind: drop py2 support
authorKefu Chai <kchai@redhat.com>
Sun, 28 Jun 2020 11:13:14 +0000 (19:13 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 5 Jul 2020 02:58:28 +0000 (10:58 +0800)
the python bindings are compiled using python3-cython, and packaged as
python3-{rados,rbd,cephfs,rgw}, so there is no need and is wrong to
claim that they are python2 compatible.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/cephfs/cephfs.pyx
src/pybind/cephfs/setup.py
src/pybind/rados/rados.pyx
src/pybind/rados/setup.py
src/pybind/rbd/rbd.pyx
src/pybind/rbd/setup.py
src/pybind/rgw/setup.py

index 9ead55560123d7395209f5acd3547f1b8081fc85..6687cb86a15b5c8e671f1a8889419f3e32668810 100644 (file)
@@ -13,15 +13,8 @@ from collections import namedtuple
 from datetime import datetime
 import errno
 import os
-import sys
 import time
 
-# Are we running Python 2.x
-if sys.version_info[0] < 3:
-    str_type = basestring
-else:
-    str_type = str
-
 AT_NO_ATTR_SYNC = 0x4000
 AT_SYMLINK_NOFOLLOW = 0x100
 cdef int AT_SYMLINK_NOFOLLOW_CDEF = AT_SYMLINK_NOFOLLOW
@@ -634,7 +627,7 @@ cdef class LibCephFS(object):
                 conffile = None
             self.conf_read_file(conffile)
         if conf is not None:
-            for key, value in conf.iteritems():
+            for key, value in conf.items():
                 self.conf_set(key, value)
 
     def get_addrs(self):
index 57aa127b522564c58606dba709387b49692a0ff9..40466614f67a93b6aa23a2b7d6c0687cbd42c4b9 100755 (executable)
@@ -208,9 +208,7 @@ setup(
         'License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)',
         'Operating System :: POSIX :: Linux',
         'Programming Language :: Cython',
-        'Programming Language :: Python :: 2.7',
-        'Programming Language :: Python :: 3.4',
-        'Programming Language :: Python :: 3.5'
+        'Programming Language :: Python :: 3',
     ],
     cmdclass=cmdclass,
 )
index ed4b6cd2fa5981f236a1b62adcec9ddb31aa0793..2bda6d315d722ad05ddfa0e20917c7e44f7a032f 100644 (file)
@@ -19,7 +19,6 @@ from libc cimport errno
 from libc.stdint cimport *
 from libc.stdlib cimport malloc, realloc, free
 
-import sys
 import threading
 import time
 
@@ -31,12 +30,6 @@ from datetime import datetime, timedelta
 from functools import partial, wraps
 from itertools import chain
 
-# Are we running Python 2.x
-if sys.version_info[0] < 3:
-    str_type = basestring
-else:
-    str_type = str
-
 
 cdef extern from "Python.h":
     # These are in cpython/string.pxd, but use "object" types instead of
@@ -715,8 +708,8 @@ cdef class Rados(object):
         PyEval_InitThreads()
         self.__setup(*args, **kwargs)
 
-    @requires(('rados_id', opt(str_type)), ('name', opt(str_type)), ('clustername', opt(str_type)),
-              ('conffile', opt(str_type)))
+    @requires(('rados_id', opt(str)), ('name', opt(str)), ('clustername', opt(str)),
+              ('conffile', opt(str)))
     def __setup(self, rados_id=None, name=None, clustername=None,
                 conf_defaults=None, conffile=None, conf=None, flags=0,
                 context=None):
@@ -832,7 +825,7 @@ Rados object in state %s." % self.state)
             rados_version(&major, &minor, &extra)
         return Version(major, minor, extra)
 
-    @requires(('path', opt(str_type)))
+    @requires(('path', opt(str)))
     def conf_read_file(self, path=None):
         """
         Configure the cluster handle using a Ceph config file.
@@ -900,7 +893,7 @@ Rados object in state %s." % self.state)
         if ret != 0:
             raise make_ex(ret, "error calling conf_parse_env")
 
-    @requires(('option', str_type))
+    @requires(('option', str))
     def conf_get(self, option):
         """
         Get the value of a configuration option
@@ -934,7 +927,7 @@ Rados object in state %s." % self.state)
         finally:
             free(ret_buf)
 
-    @requires(('option', str_type), ('val', str_type))
+    @requires(('option', str), ('val', str))
     def conf_set(self, option, val):
         """
         Set the value of a configuration option
@@ -1046,7 +1039,7 @@ Rados object in state %s." % self.state)
                 'kb_avail': stats.kb_avail,
                 'num_objects': stats.num_objects}
 
-    @requires(('pool_name', str_type))
+    @requires(('pool_name', str))
     def pool_exists(self, pool_name):
         """
         Checks if a given pool exists.
@@ -1072,7 +1065,7 @@ Rados object in state %s." % self.state)
         else:
             raise make_ex(ret, "error looking up pool '%s'" % pool_name)
 
-    @requires(('pool_name', str_type))
+    @requires(('pool_name', str))
     def pool_lookup(self, pool_name):
         """
         Returns a pool's ID based on its name.
@@ -1133,7 +1126,7 @@ Rados object in state %s." % self.state)
         finally:
             free(name)
 
-    @requires(('pool_name', str_type), ('crush_rule', opt(int)), ('auid', opt(int)))
+    @requires(('pool_name', str), ('crush_rule', opt(int)), ('auid', opt(int)))
     def create_pool(self, pool_name, crush_rule=None, auid=None):
         """
         Create a pool:
@@ -1196,7 +1189,7 @@ Rados object in state %s." % self.state)
             raise make_ex(ret, "get_pool_base_tier(%d)" % pool_id)
         return int(base_tier)
 
-    @requires(('pool_name', str_type))
+    @requires(('pool_name', str))
     def delete_pool(self, pool_name):
         """
         Delete a pool and all data inside it.
@@ -1303,7 +1296,7 @@ Rados object in state %s." % self.state)
         finally:
             free(ret_buf)
 
-    @requires(('ioctx_name', str_type))
+    @requires(('ioctx_name', str))
     def open_ioctx(self, ioctx_name):
         """
         Create an io context
@@ -1654,7 +1647,7 @@ Rados object in state %s." % self.state)
         self.monitor_callback = None
         self.monitor_callback2 = cb
 
-    @requires(('service', str_type), ('daemon', str_type), ('metadata', dict))
+    @requires(('service', str), ('daemon', str), ('metadata', dict))
     def service_daemon_register(self, service, daemon, metadata):
         """
         :param str service: service name (e.g. "rgw")
@@ -2096,7 +2089,7 @@ cdef class WriteOp(object):
         with nogil:
             rados_write_op_set_flags(self.write_op, _flags)
 
-    @requires(('xattr_name', str_type), ('xattr_value', bytes))
+    @requires(('xattr_name', str), ('xattr_value', bytes))
     def set_xattr(self, xattr_name, xattr_value):
         """
         Set an extended attribute on an object.
@@ -2113,7 +2106,7 @@ cdef class WriteOp(object):
         with nogil:
             rados_write_op_setxattr(self.write_op, _xattr_name, _xattr_value, _xattr_value_len)
 
-    @requires(('xattr_name', str_type))
+    @requires(('xattr_name', str))
     def rm_xattr(self, xattr_name):
         """  
         Removes an extended attribute on from an object.
@@ -2218,7 +2211,7 @@ cdef class WriteOp(object):
         with nogil:
             rados_write_op_truncate(self.write_op,  _offset)
 
-    @requires(('cls', str_type), ('method', str_type), ('data', bytes))
+    @requires(('cls', str), ('method', str), ('data', bytes))
     def execute(self, cls, method, data):
         """
         Execute an OSD class method on an object
@@ -2525,7 +2518,7 @@ cdef class Ioctx(object):
         ioctx.set_namespace(self.get_namespace())
         return ioctx
 
-    @requires(('object_name', str_type), ('oncomplete', opt(Callable)))
+    @requires(('object_name', str), ('oncomplete', opt(Callable)))
     def aio_stat(self, object_name, oncomplete):
         """
         Asynchronously get object stats (size/mtime)
@@ -2571,7 +2564,7 @@ cdef class Ioctx(object):
             raise make_ex(ret, "error stating %s" % object_name)
         return completion
 
-    @requires(('object_name', str_type), ('to_write', bytes), ('offset', int),
+    @requires(('object_name', str), ('to_write', bytes), ('offset', int),
               ('oncomplete', opt(Callable)), ('onsafe', opt(Callable)))
     def aio_write(self, object_name, to_write, offset=0,
                   oncomplete=None, onsafe=None):
@@ -2616,7 +2609,7 @@ cdef class Ioctx(object):
             raise make_ex(ret, "error writing object %s" % object_name)
         return completion
 
-    @requires(('object_name', str_type), ('to_write', bytes), ('oncomplete', opt(Callable)),
+    @requires(('object_name', str), ('to_write', bytes), ('oncomplete', opt(Callable)),
               ('onsafe', opt(Callable)))
     def aio_write_full(self, object_name, to_write,
                        oncomplete=None, onsafe=None):
@@ -2661,7 +2654,7 @@ cdef class Ioctx(object):
             raise make_ex(ret, "error writing object %s" % object_name)
         return completion
 
-    @requires(('object_name', str_type), ('to_write', bytes), ('write_len', int),
+    @requires(('object_name', str), ('to_write', bytes), ('write_len', int),
               ('offset', int), ('oncomplete', opt(Callable)))
     def aio_writesame(self, object_name, to_write, write_len, offset=0,
                       oncomplete=None):
@@ -2704,7 +2697,7 @@ cdef class Ioctx(object):
             raise make_ex(ret, "error writing object %s" % object_name)
         return completion
 
-    @requires(('object_name', str_type), ('to_append', bytes), ('oncomplete', opt(Callable)),
+    @requires(('object_name', str), ('to_append', bytes), ('oncomplete', opt(Callable)),
               ('onsafe', opt(Callable)))
     def aio_append(self, object_name, to_append, oncomplete=None, onsafe=None):
         """
@@ -2758,7 +2751,7 @@ cdef class Ioctx(object):
         if ret < 0:
             raise make_ex(ret, "error flushing")
 
-    @requires(('object_name', str_type), ('length', int), ('offset', int),
+    @requires(('object_name', str), ('length', int), ('offset', int),
               ('oncomplete', opt(Callable)))
     def aio_read(self, object_name, length, offset, oncomplete):
         """
@@ -2811,7 +2804,7 @@ cdef class Ioctx(object):
             raise make_ex(ret, "error reading %s" % object_name)
         return completion
 
-    @requires(('object_name', str_type), ('cls', str_type), ('method', str_type),
+    @requires(('object_name', str), ('cls', str), ('method', str),
               ('data', bytes), ('length', int),
               ('oncomplete', opt(Callable)), ('onsafe', opt(Callable)))
     def aio_execute(self, object_name, cls, method, data,
@@ -2882,7 +2875,7 @@ cdef class Ioctx(object):
             raise make_ex(ret, "error executing %s::%s on %s" % (cls, method, object_name))
         return completion
 
-    @requires(('object_name', str_type), ('oncomplete', opt(Callable)), ('onsafe', opt(Callable)))
+    @requires(('object_name', str), ('oncomplete', opt(Callable)), ('onsafe', opt(Callable)))
     def aio_remove(self, object_name, oncomplete=None, onsafe=None):
         """
         Asynchronously remove an object
@@ -2924,7 +2917,7 @@ cdef class Ioctx(object):
         if self.state != "open":
             raise IoctxStateError("The pool is %s" % self.state)
 
-    @requires(('loc_key', str_type))
+    @requires(('loc_key', str))
     def set_locator_key(self, loc_key):
         """
         Set the key for mapping objects to pgs within an io context.
@@ -2972,7 +2965,7 @@ cdef class Ioctx(object):
         with nogil:
             rados_ioctx_snap_set_read(self.io, _snap_id)
 
-    @requires(('nspace', str_type))
+    @requires(('nspace', str))
     def set_namespace(self, nspace):
         """
         Set the namespace for objects within an io context.
@@ -3020,7 +3013,7 @@ cdef class Ioctx(object):
             self.state = "closed"
 
 
-    @requires(('key', str_type), ('data', bytes))
+    @requires(('key', str), ('data', bytes))
     def write(self, key, data, offset=0):
         """
         Write data to an object synchronously
@@ -3056,7 +3049,7 @@ cdef class Ioctx(object):
             raise LogicError("Ioctx.write(%s): rados_write \
 returned %d, but should return zero on success." % (self.name, ret))
 
-    @requires(('key', str_type), ('data', bytes))
+    @requires(('key', str), ('data', bytes))
     def write_full(self, key, data):
         """
         Write an entire object synchronously.
@@ -3091,7 +3084,7 @@ returned %d, but should return zero on success." % (self.name, ret))
             raise LogicError("Ioctx.write_full(%s): rados_write_full \
 returned %d, but should return zero on success." % (self.name, ret))
 
-    @requires(('key', str_type), ('data', bytes), ('write_len', int), ('offset', int))
+    @requires(('key', str), ('data', bytes), ('write_len', int), ('offset', int))
     def writesame(self, key, data, write_len, offset=0):
         """
         Write the same buffer multiple times
@@ -3124,7 +3117,7 @@ returned %d, but should return zero on success." % (self.name, ret))
                            % (self.name, key))
         assert(ret == 0)
 
-    @requires(('key', str_type), ('data', bytes))
+    @requires(('key', str), ('data', bytes))
     def append(self, key, data):
         """
         Append data to an object synchronously
@@ -3156,7 +3149,7 @@ returned %d, but should return zero on success." % (self.name, ret))
             raise LogicError("Ioctx.append(%s): rados_append \
 returned %d, but should return zero on success." % (self.name, ret))
 
-    @requires(('key', str_type))
+    @requires(('key', str))
     def read(self, key, length=8192, offset=0):
         """
         Read data from an object synchronously
@@ -3200,7 +3193,7 @@ returned %d, but should return zero on success." % (self.name, ret))
             # itself and set ret_s to NULL, hence XDECREF).
             ref.Py_XDECREF(ret_s)
 
-    @requires(('key', str_type), ('cls', str_type), ('method', str_type), ('data', bytes))
+    @requires(('key', str), ('cls', str), ('method', str), ('data', bytes))
     def execute(self, key, cls, method, data, length=8192):
         """
         Execute an OSD class method on an object.
@@ -3306,7 +3299,7 @@ returned %d, but should return zero on success." % (self.name, ret))
                 "num_wr": stats.num_wr,
                 "num_wr_kb": stats.num_wr_kb}
 
-    @requires(('key', str_type))
+    @requires(('key', str))
     def remove_object(self, key):
         """
         Delete an object
@@ -3331,7 +3324,7 @@ returned %d, but should return zero on success." % (self.name, ret))
             raise make_ex(ret, "Failed to remove '%s'" % key)
         return True
 
-    @requires(('key', str_type))
+    @requires(('key', str))
     def trunc(self, key, size):
         """
         Resize an object
@@ -3361,7 +3354,7 @@ returned %d, but should return zero on success." % (self.name, ret))
             raise make_ex(ret, "Ioctx.trunc(%s): failed to truncate %s" % (self.name, key))
         return ret
    
-    @requires(('key', str_type), ('cmp_buf', bytes), ('offset', int))
+    @requires(('key', str), ('cmp_buf', bytes), ('offset', int))
     def cmpext(self, key, cmp_buf, offset=0):
         '''
         Compare an on-disk object range with a buffer
@@ -3389,7 +3382,7 @@ returned %d, but should return zero on success." % (self.name, ret))
         assert ret < -MAX_ERRNO or ret == 0, "Ioctx.cmpext(%s): failed to compare %s" % (self.name, key)        
         return ret
 
-    @requires(('key', str_type))
+    @requires(('key', str))
     def stat(self, key):
         """
         Get object stats (size/mtime)
@@ -3415,7 +3408,7 @@ returned %d, but should return zero on success." % (self.name, ret))
             raise make_ex(ret, "Failed to stat %r" % key)
         return psize, time.localtime(pmtime)
 
-    @requires(('key', str_type), ('xattr_name', str_type))
+    @requires(('key', str), ('xattr_name', str))
     def get_xattr(self, key, xattr_name):
         """
         Get the value of an extended attribute on an object.
@@ -3454,7 +3447,7 @@ returned %d, but should return zero on success." % (self.name, ret))
         finally:
             free(ret_buf)
 
-    @requires(('oid', str_type))
+    @requires(('oid', str))
     def get_xattrs(self, oid):
         """
         Start iterating over xattrs on an object.
@@ -3469,7 +3462,7 @@ returned %d, but should return zero on success." % (self.name, ret))
         self.require_ioctx_open()
         return XattrIterator(self, oid)
 
-    @requires(('key', str_type), ('xattr_name', str_type), ('xattr_value', bytes))
+    @requires(('key', str), ('xattr_name', str), ('xattr_value', bytes))
     def set_xattr(self, key, xattr_name, xattr_value):
         """
         Set an extended attribute on an object.
@@ -3502,7 +3495,7 @@ returned %d, but should return zero on success." % (self.name, ret))
             raise make_ex(ret, "Failed to set xattr %r" % xattr_name)
         return True
 
-    @requires(('key', str_type), ('xattr_name', str_type))
+    @requires(('key', str), ('xattr_name', str))
     def rm_xattr(self, key, xattr_name):
         """
         Removes an extended attribute on from an object.
@@ -3531,7 +3524,7 @@ returned %d, but should return zero on success." % (self.name, ret))
                           (key, xattr_name))
         return True
 
-    @requires(('obj', str_type), ('msg', str_type), ('timeout_ms', int))
+    @requires(('obj', str), ('msg', str), ('timeout_ms', int))
     def notify(self, obj, msg='', timeout_ms=5000):
         """
         Send a rados notification to an object.
@@ -3565,7 +3558,7 @@ returned %d, but should return zero on success." % (self.name, ret))
             raise make_ex(ret, "Failed to notify %r" % (obj))
         return True
 
-    @requires(('obj', str_type), ('callback', opt(Callable)),
+    @requires(('obj', str), ('callback', opt(Callable)),
               ('error_callback', opt(Callable)), ('timeout', int))
     def watch(self, obj, callback, error_callback=None, timeout=None):
         """
@@ -3643,7 +3636,7 @@ returned %d, but should return zero on success." % (self.name, ret))
             free(name)
 
 
-    @requires(('snap_name', str_type))
+    @requires(('snap_name', str))
     def create_snap(self, snap_name):
         """
         Create a pool-wide snapshot
@@ -3663,7 +3656,7 @@ returned %d, but should return zero on success." % (self.name, ret))
         if ret != 0:
             raise make_ex(ret, "Failed to create snap %s" % snap_name)
 
-    @requires(('snap_name', str_type))
+    @requires(('snap_name', str))
     def remove_snap(self, snap_name):
         """
         Removes a pool-wide snapshot
@@ -3683,7 +3676,7 @@ returned %d, but should return zero on success." % (self.name, ret))
         if ret != 0:
             raise make_ex(ret, "Failed to remove snap %s" % snap_name)
 
-    @requires(('snap_name', str_type))
+    @requires(('snap_name', str))
     def lookup_snap(self, snap_name):
         """
         Get the id of a pool snapshot
@@ -3707,7 +3700,7 @@ returned %d, but should return zero on success." % (self.name, ret))
             raise make_ex(ret, "Failed to lookup snap %s" % snap_name)
         return Snap(self, snap_name, int(snap_id))
 
-    @requires(('oid', str_type), ('snap_name', str_type))
+    @requires(('oid', str), ('snap_name', str))
     def snap_rollback(self, oid, snap_name):
         """
         Rollback an object to a snapshot
@@ -3804,7 +3797,7 @@ returned %d, but should return zero on success." % (self.name, ret))
         finally:
             free(_snaps)
 
-    @requires(('oid', str_type), ('snap_id', int))
+    @requires(('oid', str), ('snap_id', int))
     def rollback_self_managed_snap(self, oid, snap_id):
         """
         Rolls an specific object back to a self-managed snapshot revision
@@ -3905,7 +3898,7 @@ returned %d, but should return zero on success." % (self.name, ret))
             free(_values)
             free(_lens)
 
-    @requires(('write_op', WriteOp), ('oid', str_type), ('mtime', opt(int)), ('flags', opt(int)))
+    @requires(('write_op', WriteOp), ('oid', str), ('mtime', opt(int)), ('flags', opt(int)))
     def operate_write_op(self, write_op, oid, mtime=0, flags=LIBRADOS_OPERATION_NOFLAG):
         """
         execute the real write operation
@@ -3931,7 +3924,7 @@ returned %d, but should return zero on success." % (self.name, ret))
         if ret != 0:
             raise make_ex(ret, "Failed to operate write op for oid %s" % oid)
 
-    @requires(('write_op', WriteOp), ('oid', str_type), ('oncomplete', opt(Callable)), ('onsafe', opt(Callable)), ('mtime', opt(int)), ('flags', opt(int)))
+    @requires(('write_op', WriteOp), ('oid', str), ('oncomplete', opt(Callable)), ('onsafe', opt(Callable)), ('mtime', opt(int)), ('flags', opt(int)))
     def operate_aio_write_op(self, write_op, oid, oncomplete=None, onsafe=None, mtime=0, flags=LIBRADOS_OPERATION_NOFLAG):
         """
         execute the real write operation asynchronously
@@ -3973,7 +3966,7 @@ returned %d, but should return zero on success." % (self.name, ret))
             raise make_ex(ret, "Failed to operate aio write op for oid %s" % oid)
         return completion
 
-    @requires(('read_op', ReadOp), ('oid', str_type), ('flag', opt(int)))
+    @requires(('read_op', ReadOp), ('oid', str), ('flag', opt(int)))
     def operate_read_op(self, read_op, oid, flag=LIBRADOS_OPERATION_NOFLAG):
         """
         execute the real read operation
@@ -3995,7 +3988,7 @@ returned %d, but should return zero on success." % (self.name, ret))
         if ret != 0:
             raise make_ex(ret, "Failed to operate read op for oid %s" % oid)
 
-    @requires(('read_op', ReadOp), ('oid', str_type), ('oncomplete', opt(Callable)), ('onsafe', opt(Callable)), ('flag', opt(int)))
+    @requires(('read_op', ReadOp), ('oid', str), ('oncomplete', opt(Callable)), ('onsafe', opt(Callable)), ('flag', opt(int)))
     def operate_aio_read_op(self, read_op, oid, oncomplete=None, onsafe=None, flag=LIBRADOS_OPERATION_NOFLAG):
         """
         execute the real read operation
@@ -4029,7 +4022,7 @@ returned %d, but should return zero on success." % (self.name, ret))
             raise make_ex(ret, "Failed to operate aio read op for oid %s" % oid)
         return completion
 
-    @requires(('read_op', ReadOp), ('start_after', str_type), ('filter_prefix', str_type), ('max_return', int))
+    @requires(('read_op', ReadOp), ('start_after', str), ('filter_prefix', str), ('max_return', int))
     def get_omap_vals(self, read_op, start_after, filter_prefix, max_return):
         """
         get the omap values
@@ -4060,7 +4053,7 @@ returned %d, but should return zero on success." % (self.name, ret))
         it.ctx = iter_addr
         return it, 0   # 0 is meaningless; there for backward-compat
 
-    @requires(('read_op', ReadOp), ('start_after', str_type), ('max_return', int))
+    @requires(('read_op', ReadOp), ('start_after', str), ('max_return', int))
     def get_omap_keys(self, read_op, start_after, max_return):
         """
         get the omap keys
@@ -4150,7 +4143,7 @@ returned %d, but should return zero on success." % (self.name, ret))
         with nogil:
             rados_write_op_omap_clear(_write_op.write_op)
 
-    @requires(('key', str_type), ('name', str_type), ('cookie', str_type), ('desc', str_type),
+    @requires(('key', str), ('name', str), ('cookie', str), ('desc', str),
               ('duration', opt(int)), ('flags', int))
     def lock_exclusive(self, key, name, cookie, desc="", duration=None, flags=0):
 
@@ -4201,8 +4194,8 @@ returned %d, but should return zero on success." % (self.name, ret))
         if ret < 0:
             raise make_ex(ret, "Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %s" % (self.name, name, key))
 
-    @requires(('key', str_type), ('name', str_type), ('cookie', str_type), ('tag', str_type),
-              ('desc', str_type), ('duration', opt(int)), ('flags', int))
+    @requires(('key', str), ('name', str), ('cookie', str), ('tag', str),
+              ('desc', str), ('duration', opt(int)), ('flags', int))
     def lock_shared(self, key, name, cookie, tag, desc="", duration=None, flags=0):
 
         """
@@ -4255,7 +4248,7 @@ returned %d, but should return zero on success." % (self.name, ret))
         if ret < 0:
             raise make_ex(ret, "Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %s" % (self.name, name, key))
 
-    @requires(('key', str_type), ('name', str_type), ('cookie', str_type))
+    @requires(('key', str), ('name', str), ('cookie', str))
     def unlock(self, key, name, cookie):
 
         """
index 9173f451fdd7b2fdc07e7c3d98914c2d714f9255..5b40a806e60181ee69e63cd07983c378d8ca1fa1 100755 (executable)
@@ -203,9 +203,7 @@ setup(
         'License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)',
         'Operating System :: POSIX :: Linux',
         'Programming Language :: Cython',
-        'Programming Language :: Python :: 2.7',
-        'Programming Language :: Python :: 3.4',
-        'Programming Language :: Python :: 3.5'
+        'Programming Language :: Python :: 3'
     ],
     cmdclass=cmdclass,
 )
index db11432365e11d13a1c8ca155eba4a3b7f483f5a..8e081e3a4b5dca6159084ec8e788f10d54aa93eb 100644 (file)
@@ -1036,8 +1036,6 @@ def cstr(val, name, encoding="utf-8", opt=False):
         return val
     elif isinstance(val, str):
         return val.encode(encoding)
-    elif sys.version_info < (3, 0) and isinstance(val, unicode):
-        return val.encode(encoding)
     else:
         raise InvalidArgument('%s must be a string' % name)
 
index 458d82578ac465285072b72a4913f5a0f70a01fa..1f4d9ed79825bbc2254010364bd0b57d305dab35 100755 (executable)
@@ -206,9 +206,7 @@ setup(
         'License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)',
         'Operating System :: POSIX :: Linux',
         'Programming Language :: Cython',
-        'Programming Language :: Python :: 2.7',
-        'Programming Language :: Python :: 3.4',
-        'Programming Language :: Python :: 3.5'
+        'Programming Language :: Python :: 3'
     ],
     cmdclass=cmdclass,
 )
index 5c37a64c721eb68419d30797c5ed49de1f9b941c..d53aec7f84c120a4e4d5ead02b8a7868e8d09014 100755 (executable)
@@ -206,9 +206,7 @@ setup(
         'License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)',
         'Operating System :: POSIX :: Linux',
         'Programming Language :: Cython',
-        'Programming Language :: Python :: 2.7',
-        'Programming Language :: Python :: 3.4',
-        'Programming Language :: Python :: 3.5'
+        'Programming Language :: Python :: 3',
     ],
     cmdclass=cmdclass,
 )