File paramiko_language_tag-v2.diff of Package python-paramiko

=== modified file 'paramiko/sftp_server.py'
---
 paramiko/sftp_server.py |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/paramiko/sftp_server.py
+++ b/paramiko/sftp_server.py
@@ -45,7 +45,7 @@ class SFTPServer (BaseSFTP, SubsystemHan
     Use L{Transport.set_subsystem_handler} to activate this class.
     """
 
-    def __init__(self, channel, name, server, sftp_si=SFTPServerInterface, *largs, **kwargs):
+    def __init__(self, channel, name, server, sftp_si=SFTPServerInterface, language=None, *largs, **kwargs):
         """
         The constructor for SFTPServer is meant to be called from within the
         L{Transport} as a subsystem handler.  C{server} and any additional
@@ -62,6 +62,9 @@ class SFTPServer (BaseSFTP, SubsystemHan
         @param sftp_si: a subclass of L{SFTPServerInterface} to use for handling
             individual requests.
         @type sftp_si: class
+        @param language: RFC 1766-compliant language code; errors given to the
+            client should be in this language.
+        @type language: str
         """
         BaseSFTP.__init__(self)
         SubsystemHandler.__init__(self, channel, name, server)
@@ -73,6 +76,9 @@ class SFTPServer (BaseSFTP, SubsystemHan
         self.file_table = { }
         self.folder_table = { }
         self.server = sftp_si(server, *largs, **kwargs)
+        if language in (None, 'C'):
+            language = ''
+        self.language = language
         
     def _log(self, level, msg):
         if issubclass(type(msg), list):
@@ -209,7 +215,7 @@ class SFTPServer (BaseSFTP, SubsystemHan
             except IndexError:
                 desc = 'Unknown'
         # some clients expect a "langauge" tag at the end (but don't mind it being blank)
-        self._response(request_number, CMD_STATUS, code, desc, '')
+        self._response(request_number, CMD_STATUS, code, desc, self.language)
 
     def _open_folder(self, request_number, path):
         resp = self.server.list_folder(path)
openSUSE Build Service is sponsored by