To: vim_dev@googlegroups.com Subject: Patch 7.4.1621 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1621 Problem: Channel test doesn't work with Python 2.6. Solution: Add number in formatting placeholder. (Wiredool) Files: src/testdir/test_channel.py *** ../vim-7.4.1620/src/testdir/test_channel.py 2016-03-20 16:40:33.218484399 +0100 --- src/testdir/test_channel.py 2016-03-20 18:23:25.903023350 +0100 *************** *** 35,41 **** if received == '': print("=== socket closed ===") break ! print("received: {}".format(received)) # We may receive two messages at once. Take the part up to the # matching "]" (recognized by finding "]["). --- 35,41 ---- if received == '': print("=== socket closed ===") break ! print("received: {0}".format(received)) # We may receive two messages at once. Take the part up to the # matching "]" (recognized by finding "]["). *************** *** 49,55 **** used = todo[:splitidx + 1] todo = todo[splitidx + 1:] if used != received: ! print("using: {}".format(used)) try: decoded = json.loads(used) --- 49,55 ---- used = todo[:splitidx + 1] todo = todo[splitidx + 1:] if used != received: ! print("using: {0}".format(used)) try: decoded = json.loads(used) *************** *** 70,117 **** # replying to the request. cmd = '["ex","call append(\\"$\\",\\"added1\\")"]' cmd += '["ex","call append(\\"$\\",\\"added2\\")"]' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'do normal': # Send a normal command. cmd = '["normal","G$s more\u001b"]' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'eval-works': # Send an eval request. We ignore the response. cmd = '["expr","\\"foo\\" . 123", -1]' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'eval-fails': # Send an eval request that will fail. cmd = '["expr","xxx", -2]' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'eval-error': # Send an eval request that works but the result can't # be encoded. cmd = '["expr","function(\\"tr\\")", -3]' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'eval-bad': # Send an eval request missing the third argument. cmd = '["expr","xxx"]' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'malformed1': cmd = '["ex",":"]wrong!["ex","smi"]' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'malformed2': cmd = '"unterminated string' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" # Need to wait for Vim to give up, otherwise the double --- 70,117 ---- # replying to the request. cmd = '["ex","call append(\\"$\\",\\"added1\\")"]' cmd += '["ex","call append(\\"$\\",\\"added2\\")"]' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'do normal': # Send a normal command. cmd = '["normal","G$s more\u001b"]' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'eval-works': # Send an eval request. We ignore the response. cmd = '["expr","\\"foo\\" . 123", -1]' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'eval-fails': # Send an eval request that will fail. cmd = '["expr","xxx", -2]' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'eval-error': # Send an eval request that works but the result can't # be encoded. cmd = '["expr","function(\\"tr\\")", -3]' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'eval-bad': # Send an eval request missing the third argument. cmd = '["expr","xxx"]' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'malformed1': cmd = '["ex",":"]wrong!["ex","smi"]' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'malformed2': cmd = '"unterminated string' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" # Need to wait for Vim to give up, otherwise the double *************** *** 119,125 **** time.sleep(0.2) elif decoded[1] == 'malformed3': cmd = '["ex","missing ]"' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" # Need to wait for Vim to give up, otherwise the ] --- 119,125 ---- time.sleep(0.2) elif decoded[1] == 'malformed3': cmd = '["ex","missing ]"' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" # Need to wait for Vim to give up, otherwise the ] *************** *** 127,163 **** time.sleep(0.2) elif decoded[1] == 'split': cmd = '["ex","let ' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) time.sleep(0.01) cmd = 'g:split = 123"]' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'an expr': # Send an expr request. cmd = '["expr","setline(\\"$\\", [\\"one\\",\\"two\\",\\"three\\"])"]' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'call-func': cmd = '["call","MyFunction",[1,2,3], 0]' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'redraw': cmd = '["redraw",""]' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'redraw!': cmd = '["redraw","force"]' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'empty-request': cmd = '[]' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'eval-result': --- 127,163 ---- time.sleep(0.2) elif decoded[1] == 'split': cmd = '["ex","let ' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) time.sleep(0.01) cmd = 'g:split = 123"]' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'an expr': # Send an expr request. cmd = '["expr","setline(\\"$\\", [\\"one\\",\\"two\\",\\"three\\"])"]' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'call-func': cmd = '["call","MyFunction",[1,2,3], 0]' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'redraw': cmd = '["redraw",""]' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'redraw!': cmd = '["redraw","force"]' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'empty-request': cmd = '[]' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'eval-result': *************** *** 165,181 **** response = last_eval elif decoded[1] == 'call me': cmd = '[0,"we called you"]' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'call me again': cmd = '[0,"we did call you"]' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "" elif decoded[1] == 'send zero': cmd = '[0,"zero index"]' ! print("sending: {}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "sent zero" elif decoded[1] == 'close me': --- 165,181 ---- response = last_eval elif decoded[1] == 'call me': cmd = '[0,"we called you"]' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "ok" elif decoded[1] == 'call me again': cmd = '[0,"we did call you"]' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "" elif decoded[1] == 'send zero': cmd = '[0,"zero index"]' ! print("sending: {0}".format(cmd)) self.request.sendall(cmd.encode('utf-8')) response = "sent zero" elif decoded[1] == 'close me': *************** *** 199,205 **** print("no response") else: encoded = json.dumps([decoded[0], response]) ! print("sending: {}".format(encoded)) self.request.sendall(encoded.encode('utf-8')) # Negative numbers are used for "eval" responses. --- 199,205 ---- print("no response") else: encoded = json.dumps([decoded[0], response]) ! print("sending: {0}".format(encoded)) self.request.sendall(encoded.encode('utf-8')) # Negative numbers are used for "eval" responses. *************** *** 212,218 **** def writePortInFile(port): # Write the port number in Xportnr, so that the test knows it. f = open("Xportnr", "w") ! f.write("{}".format(port)) f.close() if __name__ == "__main__": --- 212,218 ---- def writePortInFile(port): # Write the port number in Xportnr, so that the test knows it. f = open("Xportnr", "w") ! f.write("{0}".format(port)) f.close() if __name__ == "__main__": *************** *** 238,244 **** writePortInFile(port) ! print("Listening on port {}".format(port)) # Main thread terminates, but the server continues running # until server.shutdown() is called. --- 238,244 ---- writePortInFile(port) ! print("Listening on port {0}".format(port)) # Main thread terminates, but the server continues running # until server.shutdown() is called. *** ../vim-7.4.1620/src/version.c 2016-03-20 18:15:17.060026391 +0100 --- src/version.c 2016-03-20 18:23:03.379253970 +0100 *************** *** 750,751 **** --- 750,753 ---- { /* Add new patch number below this line */ + /**/ + 1621, /**/ -- From "know your smileys": 8-O "Omigod!!" (done "rm -rf *" ?) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///