diff --git a/CHANGES b/CHANGES index 69c1caf..be3b2ad 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,9 @@ Temporary, post-Paramiko changelog while we get our sh!t together. * #15: Implemented parameter substitution in SSHConfig, matching the implementation of `ssh_config(5)`. Thanks to Olle Lundberg for the patch. +* #24: Switch some internal type checking to use `isinstance` to help prevent + problems with client libraries using subclasses of builtin types. Thanks to + Alex Morega for the patch. ## ssh 1.7.13 (2012-02-13) diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py index 79a7761..f446ba3 100644 --- a/paramiko/sftp_client.py +++ b/paramiko/sftp_client.py @@ -641,13 +641,13 @@ class SFTPClient (BaseSFTP): msg = Message() msg.add_int(self.request_number) for item in arg: - if type(item) is int: + if isinstance(item, int): msg.add_int(item) - elif type(item) is long: + elif isinstance(item, long): msg.add_int64(item) - elif type(item) is str: + elif isinstance(item, str): msg.add_string(item) - elif type(item) is SFTPAttributes: + elif isinstance(item, SFTPAttributes): item._pack(msg) else: raise Exception('unknown type for %r type %r' % (item, type(item)))